Sonar isses fix 43/27943/3
authorIveta Halanova <ihalanov@cisco.com>
Mon, 5 Oct 2015 13:21:14 +0000 (15:21 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 8 Oct 2015 15:49:25 +0000 (15:49 +0000)
final Util classes.
private constructor
log exception

Change-Id: Ie4fd89dc31974187d473d29e17122bffc41e5e51
Signed-off-by: Iveta Halanova <ihalanov@cisco.com>
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/attribute/TeLspAttributesParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/subobject/AsNumberCaseParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/subobject/rro/RROSubobjectUtil.java

index d512ef25cd53f84a1a4f7007c92b1ca0c0c69ee0..4a07446f0cb853133ea814bd6103295802c1ff03 100644 (file)
@@ -53,11 +53,16 @@ import org.slf4j.LoggerFactory;
 final class TeLspAttributesParser {
 
     private static final Logger LOG = LoggerFactory.getLogger(TeLspAttributesParser.class);
-    private static final int MAGIC_NUMBER = 99;  // TODO: TBD BY IANA
+    // TODO: TBD BY IANA
+    private static final int MAGIC_NUMBER = 99;
+
+    private TeLspAttributesParser() {
+        throw new UnsupportedOperationException();
+    }
 
     public static LinkStateAttribute parseTeLspAttributes(final RSVPTeObjectRegistry registry, final ByteBuf attributes) throws BGPParsingException {
 
-        TeLspAttributesBuilder builder = new TeLspAttributesBuilder();
+        final TeLspAttributesBuilder builder = new TeLspAttributesBuilder();
         LOG.trace("Initiated parsing TE LSP Objects.");
         while (attributes.isReadable()) {
             final int length = attributes.readUnsignedShort();
@@ -66,7 +71,8 @@ final class TeLspAttributesParser {
             final ByteBuf value = attributes.readSlice(length);
             try {
                 addObject(builder, registry.parseRSPVTe(classNum, cType, value));
-            } catch (RSVPParsingException e) {
+            } catch (final RSVPParsingException e) {
+                LOG.debug("Parsering TE LSP Object error. class number: {} cType: {} value: {}", classNum, cType, value, e);
                 throw new BGPParsingException(e.getMessage());
             }
         }
index 86a4da6abf86a2ec9efbb54d91b01db11e327c1f..64aceb8f6df3652d27d3a2a8a3a4592b0de62560 100644 (file)
@@ -20,7 +20,7 @@ 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.basic.explicit.route.subobjects.subobject.type.AsNumberCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.as.number._case.AsNumberBuilder;
 
-public class AsNumberCaseParser {
+public final class AsNumberCaseParser {
     private static final int CONTENT_LENGTH = 2;
 
     private AsNumberCaseParser() {
index 7aa154fe71bb87e35f3eaeb478fef7aa7ed042de..3e6322886749528cb411cb64d5ea0f5e45849e46 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.rsvp.parser.impl.subobject.rro;
 
 import io.netty.buffer.ByteBuf;
 
-class RROSubobjectUtil {
+final class RROSubobjectUtil {
     private static final int HEADER_SIZE = 2;
 
     private RROSubobjectUtil() {