X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnettyutil%2Fhandler%2FNetconfXMLToHelloMessageDecoder.java;fp=opendaylight%2Fnetconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnettyutil%2Fhandler%2FNetconfXMLToHelloMessageDecoder.java;h=10f699f8d52d07957908925dac791e119b1b1a52;hp=e6c5e5482da3328263599a6942df22e159f14dcb;hb=c05081da57a5f4740e77c50692735fb02f041657;hpb=51145748ea0c38e8bbfe4bf7a5b2b993f0879974 diff --git a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java index e6c5e5482d..10f699f8d5 100644 --- a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java +++ b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java @@ -109,7 +109,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder } } - private NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc) throws NetconfDocumentedException { + private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc) throws NetconfDocumentedException { NetconfMessage msg = new NetconfMessage(doc); if(NetconfHelloMessage.isHelloMessage(msg)) { if (additionalHeader != null) { @@ -122,7 +122,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder return msg; } - private int getAdditionalHeaderEndIndex(final byte[] bytes) { + private static int getAdditionalHeaderEndIndex(final byte[] bytes) { for (byte[] possibleEnd : POSSIBLE_ENDS) { int idx = findByteSequence(bytes, possibleEnd); @@ -159,13 +159,14 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder return -1; } - - private void logMessage(final byte[] bytes) { - String s = Charsets.UTF_8.decode(ByteBuffer.wrap(bytes)).toString(); - LOG.debug("Parsing message \n{}", s); + private static void logMessage(final byte[] bytes) { + if (LOG.isDebugEnabled()) { + String s = Charsets.UTF_8.decode(ByteBuffer.wrap(bytes)).toString(); + LOG.debug("Parsing message \n{}", s); + } } - private boolean startsWithAdditionalHeader(final byte[] bytes) { + private static boolean startsWithAdditionalHeader(final byte[] bytes) { for (byte[] possibleStart : POSSIBLE_STARTS) { int i = 0; for (byte b : possibleStart) { @@ -182,7 +183,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder return false; } - private String additionalHeaderToString(final byte[] bytes) { + private static String additionalHeaderToString(final byte[] bytes) { return Charsets.UTF_8.decode(ByteBuffer.wrap(bytes)).toString(); }