From 265cd83437fb145caeb8ed9d2a7976d7312cdf21 Mon Sep 17 00:00:00 2001 From: Zsolt Haraszti Date: Thu, 25 Feb 2016 08:40:34 -0800 Subject: [PATCH] Remove groupId casting to short from rest handler Problem: The decoder in GroupCodec (used by the REST layer) chopped the upper 16 bit in caller-provided group IDs. Since group IDs are inherently greater than 16-bit on any OFDPA-based device, the current casting rendered the REST layer unusable for such devices. Fix: removed casting, verified that all tests pass, and verified that I can now create healthy group entries on OFDPA-based switches. Change-Id: Ieb51071ff9b0d47f4ff1f90d80970b6c0df946b7 --- .../src/main/java/org/onosproject/codec/impl/GroupCodec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java index 6a7e40496a..f6e3e9d58c 100644 --- a/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java +++ b/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java @@ -113,7 +113,7 @@ public final class GroupCodec extends JsonCodec { // parse group id int groupIdInt = nullIsIllegal(json.get(GROUP_ID), GROUP_ID + MISSING_MEMBER_MESSAGE).asInt(); - GroupId groupId = new DefaultGroupId((short) groupIdInt); + GroupId groupId = new DefaultGroupId(groupIdInt); // parse group key (appCookie) String groupKeyStr = nullIsIllegal(json.get(APP_COOKIE),