From efb46612b43dba789b3e9ef3682ea49bb9db0159 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 20 Aug 2018 12:45:14 +0200 Subject: [PATCH] Fix checkstyle violations Updated checkstyle is better at catching violations, fix them up before upgrading. Change-Id: I6a2e6f262dabbb753f905f12c1f2161c409a94ed Signed-off-by: Robert Varga --- .../handler/NetconfChunkAggregator.java | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java index 144b4f5b4c..d9c0bac19a 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java @@ -66,30 +66,26 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder { final ByteBuf in, final List out) throws IllegalStateException { while (in.isReadable()) { switch (state) { - case HEADER_ONE: - { + case HEADER_ONE: { final byte b = in.readByte(); checkNewLine(b, "Malformed chunk header encountered (byte 0)"); state = State.HEADER_TWO; initChunk(); break; } - case HEADER_TWO: - { + case HEADER_TWO: { final byte b = in.readByte(); checkHash(b, "Malformed chunk header encountered (byte 1)"); state = State.HEADER_LENGTH_FIRST; break; } - case HEADER_LENGTH_FIRST: - { + case HEADER_LENGTH_FIRST: { final byte b = in.readByte(); chunkSize = processHeaderLengthFirst(b); state = State.HEADER_LENGTH_OTHER; break; } - case HEADER_LENGTH_OTHER: - { + case HEADER_LENGTH_OTHER: { final byte b = in.readByte(); if (b == '\n') { state = State.DATA; @@ -119,31 +115,27 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder { aggregateChunks(in.readBytes((int) chunkSize)); state = State.FOOTER_ONE; break; - case FOOTER_ONE: - { + case FOOTER_ONE: { final byte b = in.readByte(); checkNewLine(b,"Malformed chunk footer encountered (byte 0)"); state = State.FOOTER_TWO; chunkSize = 0; break; } - case FOOTER_TWO: - { + case FOOTER_TWO: { final byte b = in.readByte(); checkHash(b,"Malformed chunk footer encountered (byte 1)"); state = State.FOOTER_THREE; break; } - case FOOTER_THREE: - { + case FOOTER_THREE: { final byte b = in.readByte(); // In this state, either header-of-new-chunk or message-end is expected // Depends on the next character extractNewChunkOrMessageEnd(b); break; } - case FOOTER_FOUR: - { + case FOOTER_FOUR: { final byte b = in.readByte(); checkNewLine(b,"Malformed chunk footer encountered (byte 3)"); state = State.HEADER_ONE; @@ -151,10 +143,8 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder { chunk = null; break; } - default : - { + default: LOG.info("Unknown state."); - } } } -- 2.36.6