RSVP Code Clean Up 62/42262/3
authorClaudio <cgaspari@cisco.com>
Thu, 21 Jul 2016 21:10:39 +0000 (23:10 +0200)
committerMilos Fabian <milfabia@cisco.com>
Tue, 26 Jul 2016 12:42:05 +0000 (12:42 +0000)
Fix sonar complains, naming convention, declare final
method/classes, etc..

Change-Id: I90dadca882618108340d1b2d661357890871e042
Signed-off-by: Claudio <cgaspari@cisco.com>
17 files changed:
rsvp/api/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/rsvp/rev150820/PceIdBuilder.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/DetourObjectIpv4Parser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/DetourObjectIpv6Parser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/ProtectionCommonParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/RecordRouteObjectParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/RequiredAttributesObjectParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/SecondaryRecordRouteObjectParser.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/EROSubobjectParserTest.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/LabelSubobjectParserTest.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/te/TEObjectUtil.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/EROSubobjectUtil.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleRSVPExtensionProviderContext.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleEROSubobjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleLabelRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleRROSubobjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleXROSubobjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/CUISubobjectParserTest.java

index 67d4c3f3de98648c537d225fe161bcf51eadd7e0..3f5db286d09c1d5cf5a1d3ce2320d4cf43a94182 100644 (file)
@@ -12,7 +12,7 @@ import com.google.common.net.InetAddresses;
  * loss of user code.
  *
  */
-public class PceIdBuilder {
+public final class PceIdBuilder {
     private PceIdBuilder() {
         throw new UnsupportedOperationException();
     }
index d8d9b461851c7ac991c8cda618f43a054304c2dc..5bd65a1e137dc10c4827bf8eebfbea5c35aacc0a 100644 (file)
@@ -46,7 +46,7 @@ public final class DetourObjectIpv4Parser extends AbstractRSVPObjectParser {
 
         final List<Plr> list = detourObject.getPlr();
         serializeAttributeHeader(list.size() * 2 * Ipv4Util.IP4_LENGTH, CLASS_NUM, CTYPE, byteAggregator);
-        for (Plr plr : list) {
+        for (final Plr plr : list) {
             ByteBufWriteUtil.writeIpv4Address(plr.getPlrId(), byteAggregator);
             ByteBufWriteUtil.writeIpv4Address(plr.getAvoidNode(), byteAggregator);
         }
index 6f2be51952c1ec7f14cc2e3ffed27fd0d8ea9c4d..a82099ce94a4c27b4ca07cd8895eb048eec61bbe 100644 (file)
@@ -60,11 +60,11 @@ public final class DetourObjectIpv6Parser extends AbstractRSVPObjectParser {
         serializeAttributeHeader((pList.size() * Ipv6Util.IPV6_LENGTH) + (aList.size() * Ipv6Util.IPV6_LENGTH), CLASS_NUM,
             CTYPE, byteAggregator);
 
-        for (PlrId plrId : pList) {
+        for (final PlrId plrId : pList) {
             byteAggregator.writeBytes(Ipv6Util.byteBufForAddress(plrId.getPlrId()));
         }
 
-        for (AvoidNode avoidNode : aList) {
+        for (final AvoidNode avoidNode : aList) {
             byteAggregator.writeBytes(Ipv6Util.byteBufForAddress(avoidNode.getAvoidNode()));
         }
     }
index 67aef33b89997bce878c61ce9497e220cf9b750d..24de5d563e29d85074b5224ab2705eb24a6e44da 100644 (file)
@@ -36,7 +36,7 @@ public class ProtectionCommonParser {
     private static final int FLAGS_SIZE = 8;
     private static final Logger LOG = LoggerFactory.getLogger(ProtectionCommonParser.class);
 
-    protected static final void serializeBodyType1(final ProtectionSubobject protObj, final ByteBuf output) {
+    protected static void serializeBodyType1(final ProtectionSubobject protObj, final ByteBuf output) {
         final BitArray flagBitArray = new BitArray(FLAGS_SIZE);
         flagBitArray.set(SECONDARY, protObj.isSecondary());
         flagBitArray.toByteBuf(output);
@@ -44,7 +44,7 @@ public class ProtectionCommonParser {
         output.writeByte(protObj.getLinkFlags().getIntValue());
     }
 
-    protected static final void serializeBodyType2(final ProtectionSubobject protObj, final ByteBuf output) {
+    protected static void serializeBodyType2(final ProtectionSubobject protObj, final ByteBuf output) {
         final BitArray flagBitArray = new BitArray(FLAGS_SIZE);
         flagBitArray.set(SECONDARY, protObj.isSecondary());
         flagBitArray.set(PROTECTING, protObj.isProtecting());
@@ -62,7 +62,7 @@ public class ProtectionCommonParser {
         output.writeZero(ByteBufWriteUtil.SHORT_BYTES_LENGTH);
     }
 
-    protected static final ProtectionSubobject parseCommonProtectionBodyType2(final ByteBuf byteBuf) throws RSVPParsingException {
+    protected static ProtectionSubobject parseCommonProtectionBodyType2(final ByteBuf byteBuf) throws RSVPParsingException {
         if (byteBuf.readableBytes() != CONTENT_LENGTH_C2) {
             throw new RSVPParsingException("Wrong length of array of bytes. Passed: " + byteBuf.readableBytes() + "; Expected: " + CONTENT_LENGTH_C2 + ".");
         }
@@ -90,13 +90,13 @@ public class ProtectionCommonParser {
         return sub.build();
     }
 
-    protected static final ProtectionSubobject parseCommonProtectionBodyType1(final ByteBuf byteBuf) {
-        BitArray bitArray = BitArray.valueOf(byteBuf.readByte());
-        ProtectionSubobjectBuilder sub = new ProtectionSubobjectBuilder();
+    protected static ProtectionSubobject parseCommonProtectionBodyType1(final ByteBuf byteBuf) {
+        final BitArray bitArray = BitArray.valueOf(byteBuf.readByte());
+        final ProtectionSubobjectBuilder sub = new ProtectionSubobjectBuilder();
         sub.setSecondary(bitArray.get(SECONDARY));
         //Skip Reserved
         byteBuf.skipBytes(ByteBufWriteUtil.SHORT_BYTES_LENGTH);
-        int linkFlags = byteBuf.readByte();
+        final int linkFlags = byteBuf.readByte();
         sub.setLinkFlags(LinkFlags.forValue(linkFlags));
         return sub.build();
     }
index c1105a71b043bf0c0cf0c618a7abf1ed4cfa716c..30cc472ea11cca176c819c846b42b4e88d738f43 100644 (file)
@@ -22,7 +22,7 @@ public final class RecordRouteObjectParser extends RROSubobjectListParser {
     public static final short CLASS_NUM = 21;
     public static final short CTYPE = 1;
 
-    public RecordRouteObjectParser(RROSubobjectRegistry subobjReg) {
+    public RecordRouteObjectParser(final RROSubobjectRegistry subobjReg) {
         super(subobjReg);
     }
 
index 04faebb5055e530e172795cab4906cbf3490b026..ade05bf30516637c4ee77515329a3afa27253794 100644 (file)
@@ -61,7 +61,7 @@ public final class RequiredAttributesObjectParser extends AbstractRSVPObjectPars
 
         final ByteBuf bufferAux = Unpooled.buffer();
         int lenght = 0;
-        for (SubobjectContainer subObject : lspAttributesObject.getLspAttributesObject().getSubobjectContainer()) {
+        for (final SubobjectContainer subObject : lspAttributesObject.getLspAttributesObject().getSubobjectContainer()) {
             final LspSubobject lspSubonject = subObject.getLspSubobject();
             if (lspSubonject instanceof FlagsTlv) {
                 final ByteBuf flagTLVValue = Unpooled.buffer();
index ae93fa995de75ecc050f32fea6a8a4ec038d2aa7..4b04dd811e567b957d38710550e658e88ac38337 100644 (file)
@@ -22,7 +22,7 @@ public final class SecondaryRecordRouteObjectParser extends RROSubobjectListPars
     public static final short CLASS_NUM = 201;
     public static final short CTYPE = 1;
 
-    public SecondaryRecordRouteObjectParser(RROSubobjectRegistry subobjReg) {
+    public SecondaryRecordRouteObjectParser(final RROSubobjectRegistry subobjReg) {
         super(subobjReg);
     }
 
index 574df842e7b174bf4cb3e89f58bb84d67fec2c88..8ffa9772da9d58778536c2d8ad36a47c73d742f5 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -50,22 +51,22 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.generalized.label._case.GeneralizedLabelBuilder;
 
 public class EROSubobjectParserTest {
-    private static final byte[] ip4PrefixBytes = {(byte) 0x81, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+    private static final byte[] IP_4_PREFIX_BYTES = {(byte) 0x81, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
         (byte) 0x16, (byte) 0x00};
-    private static final byte[] ip6PrefixBytes = {(byte) 0x02, (byte) 0x14, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+    private static final byte[] IP_6_PREFIX_BYTES = {(byte) 0x02, (byte) 0x14, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
         (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
         (byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0x00};
-    private static final byte[] asNumberBytes = {(byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
-    private static final byte[] unnumberedBytes = {(byte) 0x84, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x12, (byte) 0x34,
+    private static final byte[] AS_NUMBER_BYTES = {(byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
+    private static final byte[] UNNUMBERED_BYTES = {(byte) 0x84, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x12, (byte) 0x34,
         (byte) 0x50, (byte) 0x00, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
-    private static final byte[] pathKey32Bytes = {(byte) 0xc0, (byte) 0x08, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
+    private static final byte[] PATH_KEY_32_BYTES = {(byte) 0xc0, (byte) 0x08, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
         (byte) 0x50, (byte) 0x00};
-    private static final byte[] pathKey128Bytes = {(byte) 0xc1, (byte) 0x14, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
+    private static final byte[] PATH_KEY_128_BYTES = {(byte) 0xc1, (byte) 0x14, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
         (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00,
         (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00};
-    private static final byte[] labelBytes = {(byte) 0x83, (byte) 0x08, (byte) 0x80, (byte) 0x02, (byte) 0x12, (byte) 0x00, (byte) 0x25,
+    private static final byte[] LABEL_BYTES = {(byte) 0x83, (byte) 0x08, (byte) 0x80, (byte) 0x02, (byte) 0x12, (byte) 0x00, (byte) 0x25,
         (byte) 0xFF};
-    private static final byte[] exrsBytes = {(byte) 0xa1, (byte) 0x06, (byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
+    private static final byte[] EXRS_BYTES = {(byte) 0xa1, (byte) 0x06, (byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
 
     private SimpleRSVPExtensionProviderContext ctx;
     private RSVPActivator act;
@@ -77,6 +78,11 @@ public class EROSubobjectParserTest {
         this.act.start(this.ctx);
     }
 
+    @After
+    public void tearDown() {
+        this.act.close();
+    }
+
     @Test
     public void testEROIp4PrefixSubobject() throws RSVPParsingException {
         final EROIpv4PrefixSubobjectParser parser = new EROIpv4PrefixSubobjectParser();
@@ -84,10 +90,10 @@ public class EROSubobjectParserTest {
         subs.setLoose(true);
         subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
             new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build()).build());
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(ip4PrefixBytes, 2)), true));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP_4_PREFIX_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(ip4PrefixBytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(IP_4_PREFIX_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
@@ -113,10 +119,10 @@ public class EROSubobjectParserTest {
                     (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
                     (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}, 22))).build()).build());
         subs.setLoose(false);
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(ip6PrefixBytes, 2)), false));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP_6_PREFIX_BYTES, 2)), false));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(ip6PrefixBytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(IP_6_PREFIX_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
@@ -138,10 +144,10 @@ public class EROSubobjectParserTest {
         final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
         subs.setLoose(true);
         subs.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x64L)).build()).build());
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(asNumberBytes, 2)), true));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(AS_NUMBER_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(asNumberBytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(AS_NUMBER_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
@@ -164,10 +170,10 @@ public class EROSubobjectParserTest {
         subs.setLoose(true);
         subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(
             new UnnumberedBuilder().setRouterId(0x12345000L).setInterfaceId(0xffffffffL).build()).build());
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(unnumberedBytes, 2)), true));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(UNNUMBERED_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(unnumberedBytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(UNNUMBERED_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
@@ -192,10 +198,10 @@ public class EROSubobjectParserTest {
         pBuilder.setPceId(new PceId(new byte[]{(byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00}));
         pBuilder.setPathKey(new PathKey(4660));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(pathKey32Bytes, 2)), true));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_32_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(pathKey32Bytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(PATH_KEY_32_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
@@ -222,10 +228,10 @@ public class EROSubobjectParserTest {
             (byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00}));
         pBuilder.setPathKey(new PathKey(4660));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
-        assertEquals(subs.build(), parser128.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(pathKey128Bytes, 2)), true));
+        assertEquals(subs.build(), parser128.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_128_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(pathKey128Bytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(PATH_KEY_128_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser128.parseSubobject(null, true);
@@ -252,10 +258,10 @@ public class EROSubobjectParserTest {
                 new GeneralizedLabelCaseBuilder().setGeneralizedLabel(
                     new GeneralizedLabelBuilder().setGeneralizedLabel(
                         new byte[]{(byte) 0x12, (byte) 0x00, (byte) 0x25, (byte) 0xFF}).build()).build()).build()).build());
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(labelBytes, 2)), true));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(LABEL_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(labelBytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(LABEL_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
@@ -284,10 +290,10 @@ public class EROSubobjectParserTest {
         builder.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x64L)).build()).build());
         list.add(builder.build());
         subs.setSubobjectType(new ExrsCaseBuilder().setExrs(new ExrsBuilder().setExrs(list).build()).build());
-        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(exrsBytes, 2)), true));
+        assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(EXRS_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeSubobject(subs.build(), buff);
-        Assert.assertArrayEquals(exrsBytes, ByteArray.getAllBytes(buff));
+        Assert.assertArrayEquals(EXRS_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseSubobject(null, true);
index 75874ae3e9d7562ad0a422b3ef63e03e30a93dcf..ef2cedbd837da5f99381471f69d8c7e9aaeec5c8 100644 (file)
@@ -27,23 +27,23 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.waveband.switching.label._case.WavebandSwitchingLabelBuilder;
 
 public class LabelSubobjectParserTest {
-    private static final byte[] generalizedLabelBytes = {(byte) 0x80, 0x02, 0x00, 0x04, 0x12, 0x00, 0x25, (byte) 0xFF};
+    private static final byte[] GENERALIZED_LABEL_BYTES = {(byte) 0x80, 0x02, 0x00, 0x04, 0x12, 0x00, 0x25, (byte) 0xFF};
 
-    private static final byte[] typeOneLabelBytes = {(byte) 0x81, 0x01, 0x12, 0x00, 0x25, (byte) 0xFF};
+    private static final byte[] TYPE_ONE_LABEL_BYTES = {(byte) 0x81, 0x01, 0x12, 0x00, 0x25, (byte) 0xFF};
 
-    private static final byte[] wavebandLabelBytes = {0x01, 0x03, 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, (byte) 0x99, (byte) 0x99, 0x00,
+    private static final byte[] WAVEBAND_LABEL_BYTES = {0x01, 0x03, 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, (byte) 0x99, (byte) 0x99, 0x00,
         0x00, 0x11, 0x11};
 
     @Test
     public void testGeneralizedLabel() throws RSVPParsingException {
         final GeneralizedLabelParser parser = new GeneralizedLabelParser();
         final GeneralizedLabelBuilder iBuilder = new GeneralizedLabelBuilder();
-        iBuilder.setGeneralizedLabel(ByteArray.cutBytes(generalizedLabelBytes, 2));
+        iBuilder.setGeneralizedLabel(ByteArray.cutBytes(GENERALIZED_LABEL_BYTES, 2));
         final GeneralizedLabelCaseBuilder builder = new GeneralizedLabelCaseBuilder().setGeneralizedLabel(iBuilder.build());
-        assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(generalizedLabelBytes, 2))));
+        assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(GENERALIZED_LABEL_BYTES, 2))));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeLabel(true, false, builder.build(), buff);
-        assertArrayEquals(generalizedLabelBytes, ByteArray.getAllBytes(buff));
+        assertArrayEquals(GENERALIZED_LABEL_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseLabel(null);
@@ -68,10 +68,10 @@ public class LabelSubobjectParserTest {
         iBuilder.setStartLabel(0x9999L);
         iBuilder.setEndLabel(0x1111L);
         final WavebandSwitchingLabelCaseBuilder builder = new WavebandSwitchingLabelCaseBuilder().setWavebandSwitchingLabel(iBuilder.build());
-        assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(wavebandLabelBytes, 2))));
+        assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(WAVEBAND_LABEL_BYTES, 2))));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeLabel(false, true, builder.build(), buff);
-        assertArrayEquals(wavebandLabelBytes, ByteArray.getAllBytes(buff));
+        assertArrayEquals(WAVEBAND_LABEL_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseLabel(null);
@@ -93,10 +93,10 @@ public class LabelSubobjectParserTest {
         final Type1LabelBuilder iBuilder = new Type1LabelBuilder();
         iBuilder.setType1Label(0x120025ffL);
         final Type1LabelCaseBuilder builder = new Type1LabelCaseBuilder().setType1Label(iBuilder.build());
-        assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(typeOneLabelBytes, 2))));
+        assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(TYPE_ONE_LABEL_BYTES, 2))));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeLabel(true, true, builder.build(), buff);
-        assertArrayEquals(typeOneLabelBytes, ByteArray.getAllBytes(buff));
+        assertArrayEquals(TYPE_ONE_LABEL_BYTES, ByteArray.getAllBytes(buff));
 
         try {
             parser.parseLabel(null);
index 2d17ca065286553fe839bdb9fc032180dd3fdf1b..bf7081a6469db0c30b53f0494f7b05386ff33fe7 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.protocol.rsvp.parser.impl.te;
 
-public class TEObjectUtil {
+final class TEObjectUtil {
 
     /**
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -17,7 +17,7 @@ public class TEObjectUtil {
      * |R|                        Reserved                       |T|A|D|
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_ADMIN_STATUS = {
+    static final byte[] TE_LSP_ADMIN_STATUS = {
         0x00, (byte) 0x04, (byte) 0xc4, 0x01,  // Lenght, Class, Ctype
         (byte) 0x80, // Reflect
         0x00, 0x00, // Reserved
@@ -40,7 +40,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_SESSION_C1 = {
+    static final byte[] TE_LSP_SESSION_C1 = {
         0x00, (byte) 0x14, (byte) 0xcf, 0x01,  // Lenght, Class, Ctype
         0x01, 0x01, 0x01, 0x01,
         0x02, 0x02, 0x02, 0x02,
@@ -59,7 +59,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_SESSION_C7 = {
+    static final byte[] TE_LSP_SESSION_C7 = {
         0x00, (byte) 0x08, (byte) 0xcf, 0x07,  // Lenght, Class, Ctype
         0x01, 0x02, 0x04, 0x04,
         (byte) 0x41, (byte) 0x41, (byte) 0x41, (byte) 0x41,};
@@ -70,7 +70,7 @@ public class TEObjectUtil {
      * |                        Bandwidth                              |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_BANDWIDTH_1 = {
+    static final byte[] TE_LSP_BANDWIDTH_1 = {
         0x00, (byte) 0x04, (byte) 0x05, 0x01,  // Lenght, Class, Ctype
         0x01, 0x02, 0x03, 0x04,};
     /**
@@ -80,7 +80,7 @@ public class TEObjectUtil {
      * |                        Bandwidth                              |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_BANDWIDTH_2 = {
+    static final byte[] TE_LSP_BANDWIDTH_2 = {
         0x00, (byte) 0x04, (byte) 0x05, 0x02,  // Lenght, Class, Ctype
         0x01, 0x02, 0x03, 0x04,};
 
@@ -93,7 +93,7 @@ public class TEObjectUtil {
      * |                  IPv4 Association Source                      |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_ASSOCIATION_1 = {
+    static final byte[] TE_LSP_ASSOCIATION_1 = {
         0x00, (byte) 0x08, (byte) 0xc7, 0x01,  // Lenght, Class, Ctype
         0x00, 0x01, 0x00, 0x02,
         0x01, 0x02, 0x03, 0x04,};
@@ -112,7 +112,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_ASSOCIATION_2 = {
+    static final byte[] TE_LSP_ASSOCIATION_2 = {
         0x00, (byte) 0x14, (byte) 0xc7, 0x02,  // Lenght, Class, Ctype
         0x00, 0x01, 0x00, 0x02,
         0x01, 0x02, 0x03, 0x04,
@@ -135,7 +135,7 @@ public class TEObjectUtil {
      * |                  Include-all                          |
      * +-------------+-------------+-------------+-------------+
      */
-    public static final byte[] TE_LSP_FAST_REROUTE1 = {
+    static final byte[] TE_LSP_FAST_REROUTE1 = {
         0x00, (byte) 0x14, (byte) 0xcd, 0x01,  // Lenght, Class, Ctype
         (byte) 0x01, (byte) 0x02, (byte) 0x10, (byte) 0x02,
         0x01, 0x01, 0x01, 0x01,
@@ -156,7 +156,7 @@ public class TEObjectUtil {
      * |                  Exclude-any                          |
      * +-------------+-------------+-------------+-------------+
      */
-    public static final byte[] TE_LSP_FAST_REROUTE7 = {
+    static final byte[] TE_LSP_FAST_REROUTE7 = {
         0x00, (byte) 0x10, (byte) 0xcd, 0x07,  // Lenght, Class, Ctype
         (byte) 0x01, (byte) 0x02, (byte) 0x10, 0x00,
         0x01, 0x01, 0x01, 0x01,
@@ -173,7 +173,7 @@ public class TEObjectUtil {
      * |                          metric-value                         |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_METRIC = {
+    static final byte[] TE_LSP_METRIC = {
         0x00, (byte) 0x08, (byte) 0x06, 0x01,  // Lenght, Class, Ctype
         0x00, 0x00, 0x03, 0x02,
         0x01, 0x02, 0x03, 0x04,};
@@ -185,7 +185,7 @@ public class TEObjectUtil {
      * |S|                  Reserved                       | Link Flags|
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_PROTECTION_C1 = {
+    static final byte[] TE_LSP_PROTECTION_C1 = {
         0x00, (byte) 0x04, (byte) 0x25, 0x01,  // Lenght, Class, Ctype
         (byte) 0x80, 0x00, 0x00, (byte) 0x0a,};
 
@@ -198,7 +198,7 @@ public class TEObjectUtil {
      * |I|R|   Reserved    | Seg.Flags |           Reserved            |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_PROTECTION_C2 = {
+    static final byte[] TE_LSP_PROTECTION_C2 = {
         0x00, (byte) 0x08, (byte) 0x25, 0x02,  // Lenght, Class, Ctype
         (byte) 0xf0, 0x08, 0x00, (byte) 0x0a,
         (byte) 0xc0, 0x04, 0x00, (byte) 0x00,};
@@ -220,7 +220,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_ATTRIBUTES = {
+    static final byte[] TE_LSP_ATTRIBUTES = {
         0x00, (byte) 0x0c, (byte) 0xc5, 0x01,  // Lenght, Class, Ctype
         0x00, 0x01, 0x00, 0x08,
         (byte) 0x09, 0x07, 0x03, 0x01,
@@ -243,7 +243,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_REQUIRED_ATTRIBUTES = {
+    static final byte[] TE_LSP_REQUIRED_ATTRIBUTES = {
         0x00, (byte) 0x0c, 0x43, 0x01,  // Lenght, Class, Ctype
         0x00, 0x01, 0x00, 0x08,
         (byte) 0x09, 0x07, 0x03, 0x01,
@@ -266,7 +266,7 @@ public class TEObjectUtil {
      * |                    Avoid_Node_ID  n                   |
      * +-------------+-------------+-------------+-------------+
      */
-    public static final byte[] TE_LSP_DETOUR7 = {
+    static final byte[] TE_LSP_DETOUR7 = {
         0x00, (byte) 0x20, (byte) 0x3f, 0x07,  // Lenght, Class, Ctype
         0x00, 0x00, 0x00, 0x01,
         0x01, 0x02, 0x03, 0x01,
@@ -302,7 +302,7 @@ public class TEObjectUtil {
      * //                        ....                          //
      * +-------------+-------------+-------------+-------------+
      */
-    public static final byte[] TE_LSP_DETOUR8 = {
+    static final byte[] TE_LSP_DETOUR8 = {
         0x00, (byte) 0x40, (byte) 0x3f, 0x08,  // Lenght, Class, Ctype
         0x00, 0x00, 0x00, 0x01,
         0x00, 0x00, 0x00, 0x02,
@@ -342,7 +342,7 @@ public class TEObjectUtil {
      * |  Maximum Packet Size [M]  (32-bit integer)                |
      * -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_SENDER_TSPEC = {
+    static final byte[] TE_LSP_SENDER_TSPEC = {
         0x00, (byte) 0x20, (byte) 0x0c, 0x02,  // Lenght, Class, Ctype
         0x00, 0x00, 0x00, 0x07,
         0x01, 0x00, 0x00, 0x06,
@@ -374,7 +374,7 @@ public class TEObjectUtil {
      * |  Maximum Packet Size [M]  (32-bit integer)                 |
      * -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_FLOWSPEC_H5 = {
+    static final byte[] TE_LSP_FLOWSPEC_H5 = {
         0x00, (byte) 0x20, (byte) 0x09, 0x02,  // Lenght, Class, Ctype
         0x00, 0x00, 0x00, 0x07,
         0x05, 0x00, 0x00, 0x06,
@@ -412,7 +412,7 @@ public class TEObjectUtil {
      * |  Slack Term [S]  (32-bit integer)                          |
      * -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_FLOWSPEC_H2 = {
+    static final byte[] TE_LSP_FLOWSPEC_H2 = {
         0x00, (byte) 0x2c, (byte) 0x09, 0x02,  // Lenght, Class, Ctype
         0x00, 0x00, 0x00, 0x0a,
         0x02, 0x00, 0x00, 0x09,
@@ -470,7 +470,7 @@ public class TEObjectUtil {
      * |      SRLG Id (continued)      |           Reserved            |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_EXCLUDE_ROUTE = {
+    static final byte[] TE_LSP_EXCLUDE_ROUTE = {
         0x00, (byte) 0x34, (byte) 0xe8, 0x01,  // Lenght, Class, Ctype
         (byte) 0x81, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x01,
         (byte) 0x82, (byte) 0x14,
@@ -490,7 +490,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_PRIMARY_PATH_ROUTE = {
+    static final byte[] TE_LSP_PRIMARY_PATH_ROUTE = {
         0x00, (byte) 0x30, (byte) 0x26, 0x01,  // Lenght, Class, Ctype
         (byte) 0x01, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x00,
         (byte) 0x02, (byte) 0x14,
@@ -509,7 +509,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_EXPLICIT = {
+    static final byte[] TE_LSP_EXPLICIT = {
         0x00, (byte) 0x20, (byte) 0x14, 0x01,  // Lenght, Class, Ctype
         (byte) 0x81, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x00,
         (byte) 0x82, (byte) 0x14,
@@ -525,7 +525,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_SECONDARY_EXPLICIT = {
+    static final byte[] TE_LSP_SECONDARY_EXPLICIT = {
         0x00, (byte) 0x2c, (byte) 0xc8, 0x01,  // Lenght, Class, Ctype
         (byte) 0x81, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x00,
         (byte) 0x82, (byte) 0x14,
@@ -544,7 +544,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_RECORD_ROUTE = {
+    static final byte[] TE_LSP_RECORD_ROUTE = {
         0x00, (byte) 0x24, (byte) 0x15, 0x01,  // Lenght, Class, Ctype
         (byte) 0x01, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x01,
         (byte) 0x02, (byte) 0x14,
@@ -561,7 +561,7 @@ public class TEObjectUtil {
      * |                                                               |
      * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      */
-    public static final byte[] TE_LSP_SECONDARY_RECORD_ROUTE = {
+    static final byte[] TE_LSP_SECONDARY_RECORD_ROUTE = {
         0x00, (byte) 0x30, (byte) 0xc9, 0x01,  // Lenght, Class, Ctype
         (byte) 0x01, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x01,
         (byte) 0x02, (byte) 0x14,
@@ -572,21 +572,21 @@ public class TEObjectUtil {
         (byte) 0xf0, 0x04, 0x00, 0x08,
         (byte) 0xc0, 0x04, 0x00, 0x00,
     };
-    public static final byte[] TE_LSP_DYNAMIC_SRRO_PROTECTION = {
+    static final byte[] TE_LSP_DYNAMIC_SRRO_PROTECTION = {
         (byte) 0x25, 0x0c, 0x00, 0x02,
         (byte) 0xf0, 0x04, 0x00, 0x08,
         (byte) 0xc0, 0x04, 0x00, 0x00,
     };
-    public static final byte[] TE_LSP_BASIC_SRRO_PROTECTION = {
+    static final byte[] TE_LSP_BASIC_SRRO_PROTECTION = {
         (byte) 0x25, 0x08, 0x00, 0x01,
         (byte) 0x00, 0x00, 0x00, 0x08,
     };
-    public static final byte[] TE_LSP_DYNAMIC_SERO_PROTECTION = {
+    static final byte[] TE_LSP_DYNAMIC_SERO_PROTECTION = {
         (byte) 0xa5, 0x0c, 0x00, 0x02,
         (byte) 0xf0, 0x04, 0x00, 0x08,
         (byte) 0xc0, 0x04, 0x00, 0x00,
     };
-    public static final byte[] TE_LSP_BASIC_SERO_PROTECTION = {
+    static final byte[] TE_LSP_BASIC_SERO_PROTECTION = {
         (byte) 0xa5, 0x08, 0x00, 0x01,
         (byte) 0x00, 0x00, 0x00, 0x08,
     };
index a8e5788d92cdeac24cde1f980b52bfaf1b858536..8a0f3961246561497529d6d187613362608833db 100644 (file)
@@ -19,7 +19,7 @@ public final class EROSubobjectUtil {
         throw new UnsupportedOperationException();
     }
 
-    public static void formatSubobject(int type, final Boolean loose, final ByteBuf body, final ByteBuf buffer) {
+    public static void formatSubobject(final int type, final Boolean loose, final ByteBuf body, final ByteBuf buffer) {
         if (loose == null) {
             buffer.writeByte(type);
         } else {
index ab67ce055df0dd5619b5154fafa72015c39efd95..69a8a864748223faf3d43d78eaa0de22dea3dd14 100644 (file)
@@ -68,7 +68,7 @@ public class SimpleRSVPExtensionProviderContext extends SimpleRSVPExtensionConsu
     public final synchronized void setMaximumCachedObjects(final int maximumCachedObjects) {
         Preconditions.checkArgument(maximumCachedObjects >= 0);
 
-        Cache<Object, Object> newCache = CacheBuilder.newBuilder().maximumSize(maximumCachedObjects).build();
+        final Cache<Object, Object> newCache = CacheBuilder.newBuilder().maximumSize(maximumCachedObjects).build();
         newCache.putAll(this.cacheRef.get().asMap());
         this.cacheRef.set(newCache);
     }
index f2dfeafcf3cba6614fe8248433a6eb3605ffa2cb..5cd68a060516cba1a0dc3b4fbeb6a7c8ad0d8121 100644 (file)
@@ -68,12 +68,9 @@ public class SimpleEROSubobjectRegistryTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testParseWrongType() {
+    public void testParseWrongType() throws RSVPParsingException {
         final int wrongType = 65536;
-        try {
-            this.simpleEROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
-        } catch (final RSVPParsingException e) {
-        }
+        this.simpleEROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
     }
 
     @Test(expected = IllegalArgumentException.class)
index e05cbcbce85418d8fd8e16176a20962c5b70e96a..9a27f4e7587ae52923bead9e2156b67640b7e068 100644 (file)
@@ -67,12 +67,9 @@ public class SimpleLabelRegistryTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testParseWrongType() {
+    public void testParseWrongType() throws RSVPParsingException {
         final int wrongType = 65536;
-        try {
-            this.simpleLabelRegistry.parseLabel(wrongType, this.input);
-        } catch (RSVPParsingException e) {
-        }
+        this.simpleLabelRegistry.parseLabel(wrongType, this.input);
     }
 
     @Test(expected = IllegalArgumentException.class)
index 83a564f6f6b56a4d5a212ce942e71168cc01bcb0..4866e1ca70731a701b2624e92acfb6a0053acd62 100644 (file)
@@ -69,12 +69,9 @@ public class SimpleRROSubobjectRegistryTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testParseWrongType() {
+    public void testParseWrongType() throws RSVPParsingException {
         final int wrongType = 65536;
-        try {
-            this.simpleRROSubobjectRegistry.parseSubobject(wrongType, this.input);
-        } catch (final RSVPParsingException e) {
-        }
+        this.simpleRROSubobjectRegistry.parseSubobject(wrongType, this.input);
     }
 
     @Test(expected = IllegalArgumentException.class)
index 142c0e34bcdf07be3ee3ff123ce453fd94c954f1..e1c33ded7d2fc88351512f8d3838389f10fa93a3 100644 (file)
@@ -69,12 +69,9 @@ public class SimpleXROSubobjectRegistryTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testParseWrongType() {
+    public void testParseWrongType() throws RSVPParsingException {
         final int wrongType = 65536;
-        try {
-            this.simpleXROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
-        } catch (final RSVPParsingException e) {
-        }
+        this.simpleXROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
     }
 
     @Test(expected = IllegalArgumentException.class)
index 93668ab84434920988b4c7deaa712fcf209053ae..4fa27fd74f21d97b1f25d09592ec67c64d79b374 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 public class CUISubobjectParserTest {
     private final Long routerId = 3735928559L;
     private final Long interfaceId = 3736059631L;
-    CommonUnnumberedInterfaceSubobjectParser parser = new CommonUnnumberedInterfaceSubobjectParser();
+    final CommonUnnumberedInterfaceSubobjectParser parser = new CommonUnnumberedInterfaceSubobjectParser();
     final Unnumbered unnumbered1 = new UnnumberedBuilder().setRouterId(null).build();
     final Unnumbered unnumbered2 = new UnnumberedBuilder().setRouterId(1L).setInterfaceId(null).build();