Sonar minor issues fix
[bgpcep.git] / rsvp / impl / src / main / java / org / opendaylight / protocol / rsvp / parser / impl / subobject / rro / RROPathKey32SubobjectParser.java
index 71f42183e4a5765df39c918ec4007f6a1a191650..5375cb9d4a6073197f98f6a22909170e2dccd598 100644 (file)
@@ -60,11 +60,11 @@ public class RROPathKey32SubobjectParser implements RROSubobjectParser, RROSubob
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.subobject.type.path.key._case.PathKey pk = pkcase.getPathKey();
         final ByteBuf body = Unpooled.buffer();
         Preconditions.checkArgument(pk.getPceId() != null, "PceId is mandatory.");
-        if (pk.getPceId().getBinary().length == 16) {
+        if (pk.getPceId().getBinary().length == RROPathKey128SubobjectParser.PCE128_ID_F_LENGTH) {
             RROPathKey128SubobjectParser.serializeSubobject(subobject, buffer);
         }
         Preconditions.checkArgument(pk.getPathKey() != null, "PathKey is mandatory.");
-        Preconditions.checkArgument(pk.getPceId().getBinary().length == 4, "PathKey 32Bit is mandatory.");
+        Preconditions.checkArgument(pk.getPceId().getBinary().length == PCE_ID_F_LENGTH, "PathKey 32Bit is mandatory.");
         writeUnsignedShort(pk.getPathKey().getValue(), body);
         body.writeBytes(pk.getPceId().getBinary());
         RROSubobjectUtil.formatSubobject(TYPE, body, buffer);