Merge "Use readUnsignedByte instead of readByte and typecast."
[bgpcep.git] / bgp / parser-impl / src / main / java / org / opendaylight / protocol / bgp / parser / impl / message / update / ExtendedCommunitiesAttributeParser.java
index 5e7f9e09383b7c668beeed03922f22b0fc7d4696..a4c4ebc916f66db4970b15769dd0827c61f5b369 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,8 +96,8 @@ 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());
     }
 
     /**