Merge "BUG-2571 : flowspec-routes model"
[bgpcep.git] / bgp / parser-impl / src / main / java / org / opendaylight / protocol / bgp / parser / impl / message / update / ExtendedCommunitiesAttributeParser.java
index 5e7f9e09383b7c668beeed03922f22b0fc7d4696..32dfd6e4e3e98640cb18d2937a1b5aec64bb23ac 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
 import com.google.common.base.Preconditions;
-import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
@@ -97,14 +96,16 @@ public class ExtendedCommunitiesAttributeParser implements AttributeParser,Attri
     }
 
     protected void parseHeader(final ExtendedCommunitiesBuilder exBuilder, final ByteBuf buffer) {
-        exBuilder.setCommType((short) UnsignedBytes.toInt(buffer.readByte()));
-        exBuilder.setCommSubType((short) UnsignedBytes.toInt(buffer.readByte()));
+        exBuilder.setCommType(buffer.readUnsignedByte());
+        exBuilder.setCommSubType(buffer.readUnsignedByte());
     }
 
     /**
      * Parse Extended Community according to their type.
      *
-     * @param bytes byte array to be parsed
+     * @param refCache
+     * @param comm ExtendedCommunitiesBuilder based on which community type will be new ExtendedCommunity created
+     * @param buffer byte array to be parsed
      * @return new Specific Extended Community
      * @throws BGPDocumentedException if the type is not recognized
      */