Fix various netconf warnings 39/22039/2
authorRobert Varga <rovarga@cisco.com>
Sat, 6 Jun 2015 19:43:10 +0000 (21:43 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 8 Jun 2015 07:18:01 +0000 (07:18 +0000)
Overridden version, potentially static methods.

Change-Id: I54af7e8b48335b4b81594d4deeb0f75e21dbc932
Signed-off-by: Robert Varga <rovarga@cisco.com>
19 files changed:
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSessionTest.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/AbstractNetconfSessionNegotiator.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfChunkAggregator.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java
opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ChunkedFramingMechanismEncoderTest.java
opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfEXIHandlersTest.java
opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java
opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/ops/CreateSubscription.java
opendaylight/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/controller/netconf/notifications/impl/ops/GetTest.java
opendaylight/netconf/netconf-ssh/pom.xml
opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/SshProxyServerConfigurationBuilder.java
opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/AuthProviderTracker.java

index f4017fbe5897521e5589f36e987abdc454cfb895..b9a6f4104ff147c246a3ccb135e8bd9cdae5acbc 100644 (file)
@@ -105,7 +105,7 @@ public class NetconfClientSessionNegotiator extends
                 && containsExi10Capability(sessionPreferences.getHelloMessage().getDocument());
     }
 
-    private boolean containsExi10Capability(final Document doc) {
+    private static boolean containsExi10Capability(final Document doc) {
         final NodeList nList = doc.getElementsByTagName(XmlNetconfConstants.CAPABILITY);
         for (int i = 0; i < nList.getLength(); i++) {
             if (nList.item(i).getTextContent().contains(EXI_1_0_CAPABILITY_MARKER)) {
@@ -115,7 +115,7 @@ public class NetconfClientSessionNegotiator extends
         return false;
     }
 
-    private long extractSessionId(final Document doc) {
+    private static long extractSessionId(final Document doc) {
         String textContent = getSessionIdWithXPath(doc, sessionIdXPath);
         if (Strings.isNullOrEmpty(textContent)) {
             textContent = getSessionIdWithXPath(doc, sessionIdXPathNoNamespace);
@@ -127,7 +127,7 @@ public class NetconfClientSessionNegotiator extends
         return Long.valueOf(textContent);
     }
 
-    private String getSessionIdWithXPath(final Document doc, final XPathExpression sessionIdXPath) {
+    private static String getSessionIdWithXPath(final Document doc, final XPathExpression sessionIdXPath) {
         final Node sessionIdNode = (Node) XmlUtil.evaluateXPath(sessionIdXPath, doc, XPathConstants.NODE);
         return sessionIdNode != null ? sessionIdNode.getTextContent() : null;
     }
index ce18ac057944e4d6676a8a018083e5e1a224cfad..eb45a4dcd4b8075dbbdbeb7ce04709371d328407 100644 (file)
@@ -16,7 +16,6 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
-
 import com.google.common.base.Optional;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -64,7 +63,7 @@ public class NetconfClientSessionNegotiatorTest {
         channel = mockChannel();
     }
 
-    private ChannelHandler mockChannelHandler() {
+    private static ChannelHandler mockChannelHandler() {
         ChannelHandler handler = mock(ChannelHandler.class);
         return handler;
     }
@@ -83,13 +82,13 @@ public class NetconfClientSessionNegotiatorTest {
         return channel;
     }
 
-    private ChannelFuture mockChannelFuture() {
+    private static ChannelFuture mockChannelFuture() {
         ChannelFuture future = mock(ChannelFuture.class);
         doReturn(future).when(future).addListener(any(GenericFutureListener.class));
         return future;
     }
 
-    private ChannelPipeline mockChannelPipeline() {
+    private static ChannelPipeline mockChannelPipeline() {
         ChannelPipeline pipeline = mock(ChannelPipeline.class);
         ChannelHandler handler = mock(ChannelHandler.class);
         doReturn(pipeline).when(pipeline).addAfter(anyString(), anyString(), any(ChannelHandler.class));
index 4368f7ec7940152ef038a1b4320dbc3c858732cf..6b306bc1907dda1f221630234ea5f01c95c0c9af 100644 (file)
@@ -135,7 +135,7 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
         return builder.build();
     }
 
-    private Class<? extends Transport> getTransportForString(final String transport) {
+    private static Class<? extends Transport> getTransportForString(final String transport) {
         switch(transport) {
         case "ssh" :
             return NetconfSsh.class;
@@ -146,7 +146,8 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
         }
     }
 
-    private String formatDateTime(final Date loginTime) {
+    private static String formatDateTime(final Date loginTime) {
+        // FIXME: thread-local cache?
         SimpleDateFormat dateFormat = new SimpleDateFormat(ISO_DATE_FORMAT);
         return dateFormat.format(loginTime);
     }
index e83e0b0227e236bf592ad5d2c4b327efd795db80..bc6a2f7284e0c3eadd354924339f8ad26589d95c 100644 (file)
@@ -33,7 +33,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
     private final NetconfOperationRouter operationRouter;
     private final AutoCloseable onSessionDownCloseable;
 
-    public NetconfServerSessionListener(final NetconfOperationRouter operationRouter, NetconfMonitoringService monitoringService,
+    public NetconfServerSessionListener(final NetconfOperationRouter operationRouter, final NetconfMonitoringService monitoringService,
                                         final AutoCloseable onSessionDownCloseable) {
         this.operationRouter = operationRouter;
         this.monitoringService = monitoringService;
@@ -133,7 +133,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
         }
     }
 
-    private void checkMessageId(final Node rootNode) throws NetconfDocumentedException {
+    private static void checkMessageId(final Node rootNode) throws NetconfDocumentedException {
 
         NamedNodeMap attributes = rootNode.getAttributes();
 
index cf489608cab7c2a5ff36e2253c7fcc9516a296e4..d010b5cefc0c20c364a5ad255c6aec0fbede7dce 100644 (file)
@@ -71,7 +71,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
         this.baseCapabilities = validateBaseCapabilities(baseCapabilities);
     }
 
-    private ImmutableSet<String> validateBaseCapabilities(final Set<String> baseCapabilities) {
+    private static ImmutableSet<String> validateBaseCapabilities(final Set<String> baseCapabilities) {
         // Check base capabilities to be supported by the server
         final Sets.SetView<String> unknownBaseCaps = Sets.difference(baseCapabilities, DEFAULT_BASE_CAPABILITIES);
         Preconditions.checkArgument(unknownBaseCaps.isEmpty(),
index fb0d3448a3f3606b30550bf3af9b8626d53e94af..13e56d71e80a3f8c04e3908094216a9045c0da92 100644 (file)
@@ -42,8 +42,8 @@ public class DefaultCommit extends AbstractNetconfOperation {
     private final NetconfMonitoringService cap;
     private final NetconfOperationRouter operationRouter;
 
-    public DefaultCommit(CommitNotifier notifier, NetconfMonitoringService cap,
-                         String netconfSessionIdForReporting, NetconfOperationRouter netconfOperationRouter) {
+    public DefaultCommit(final CommitNotifier notifier, final NetconfMonitoringService cap,
+                         final String netconfSessionIdForReporting, final NetconfOperationRouter netconfOperationRouter) {
         super(netconfSessionIdForReporting);
         this.notificationProducer = notifier;
         this.cap = cap;
@@ -69,7 +69,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
     }
 
     @Override
-    public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
+    public Document handle(final Document requestMessage, final NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
         Preconditions.checkArgument(!subsequentOperation.isExecutionTermination(),
                 "Subsequent netconf operation expected by %s", this);
 
@@ -97,7 +97,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
     }
 
     @Override
-    protected Element handle(Document document, XmlElement message, NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
+    protected Element handle(final Document document, final XmlElement message, final NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
         throw new UnsupportedOperationException("Never gets called");
     }
 
@@ -106,11 +106,11 @@ public class DefaultCommit extends AbstractNetconfOperation {
         return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1);
     }
 
-    private void removePersisterAttributes(Document message) {
+    private static void removePersisterAttributes(final Document message) {
         message.getDocumentElement().removeAttribute(NOTIFY_ATTR);
     }
 
-    private boolean isCommitWithoutNotification(Document message) {
+    private static boolean isCommitWithoutNotification(final Document message) {
         XmlElement xmlElement = null;
         try {
             xmlElement = XmlElement.fromDomElementWithExpected(message.getDocumentElement(),
@@ -132,7 +132,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
         }
     }
 
-    private Element getConfigSnapshot(NetconfOperationRouter opRouter) throws NetconfDocumentedException {
+    private Element getConfigSnapshot(final NetconfOperationRouter opRouter) throws NetconfDocumentedException {
         final Document responseDocument = opRouter.onNetconfMessage(
                 getConfigMessage, null);
 
index b45b116b1262cbc67879de52a49482e0f7b43128..9afa76148e31967abd9dd041775c921b4f2ad742 100644 (file)
@@ -16,7 +16,6 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
-
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.util.concurrent.GenericFutureListener;
@@ -47,7 +46,7 @@ public class DefaultCloseSessionTest {
         doReturn(mock(ChannelFuture.class)).when(channel).close();
 
         final ChannelFuture sendFuture = mock(ChannelFuture.class);
-        doAnswer(new Answer() {
+        doAnswer(new Answer<Object>() {
             @Override
             public Object answer(final InvocationOnMock invocation) throws Throwable {
                 ((GenericFutureListener) invocation.getArguments()[0]).operationComplete(sendFuture);
index 9e1edc337661fc808f1dc50e549b0bdeb3e6ae68..635baab924d0ec6f43eb65ce70614f2318eeaf39 100644 (file)
@@ -229,7 +229,7 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
         this.state = newState;
     }
 
-    private boolean containsBase11Capability(final Document doc) {
+    private static boolean containsBase11Capability(final Document doc) {
         final NodeList nList = doc.getElementsByTagName(XmlNetconfConstants.CAPABILITY);
         for (int i = 0; i < nList.getLength(); i++) {
             if (nList.item(i).getTextContent().contains(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1)) {
index 6a7b752023fef30717e1067d57d029ea7c6eee2f..0066b17754129bf5ed321af917cadc38325d540d 100644 (file)
@@ -40,29 +40,29 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
     private long chunkSize;
     private CompositeByteBuf chunk;
 
-    private void checkNewLine(byte b,String errorMessage){
+    private static void checkNewLine(final byte b,final String errorMessage) {
         if (b != '\n') {
             LOG.debug(GOT_PARAM_WHILE_WAITING_FOR_PARAM, b, (byte)'\n');
             throw new IllegalStateException(errorMessage);
         }
     }
 
-    private void checkHash(byte b,String errorMessage){
+    private static void checkHash(final byte b,final String errorMessage) {
         if (b != '#') {
             LOG.debug(GOT_PARAM_WHILE_WAITING_FOR_PARAM, b, (byte)'#');
             throw new IllegalStateException(errorMessage);
         }
     }
 
-    private void checkChunkSize(){
+    private void checkChunkSize() {
         if (chunkSize > maxChunkSize) {
             LOG.debug("Parsed chunk size {}, maximum allowed is {}", chunkSize, maxChunkSize);
             throw new IllegalStateException("Maximum chunk size exceeded");
         }
-
     }
+
     @Override
-    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws IllegalStateException {
+    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) throws IllegalStateException {
         while (in.isReadable()) {
             switch (state) {
             case HEADER_ONE:
@@ -164,7 +164,7 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
         in.discardReadBytes();
     }
 
-    private void extractNewChunkOrMessageEnd(byte b) {
+    private void extractNewChunkOrMessageEnd(final byte b) {
         if (isHeaderLengthFirst(b)) {
             // Extract header length#1 from new chunk
             chunkSize = processHeaderLengthFirst(b);
@@ -182,14 +182,14 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
         chunk = Unpooled.compositeBuffer();
     }
 
-    private void aggregateChunks(ByteBuf newChunk) {
+    private void aggregateChunks(final ByteBuf newChunk) {
         chunk.addComponent(chunk.numComponents(), newChunk);
 
         // Update writer index, addComponent does not update it
         chunk.writerIndex(chunk.writerIndex() + newChunk.readableBytes());
     }
 
-    private static int processHeaderLengthFirst(byte b) {
+    private static int processHeaderLengthFirst(final byte b) {
         if (!isHeaderLengthFirst(b)) {
             LOG.debug(GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM, b, (byte)'1', (byte)'9');
             throw new IllegalStateException("Invalid chunk size encountered (byte 0)");
@@ -198,7 +198,7 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
         return b - '0';
     }
 
-    private static boolean isHeaderLengthFirst(byte b) {
+    private static boolean isHeaderLengthFirst(final byte b) {
         return b >= '1' && b <= '9';
     }
 }
index e6c5e5482da3328263599a6942df22e159f14dcb..10f699f8d52d07957908925dac791e119b1b1a52 100644 (file)
@@ -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();
     }
 
index 667a4f6bf8dd23414986ba1de71598861155565e..2716072889484c0ff3e5f7bfd63359d3e1914a33 100644 (file)
@@ -171,7 +171,7 @@ public final class AsyncSshHandlerWriter implements AutoCloseable {
         asyncIn = null;
     }
 
-    private Buffer toBuffer(final ByteBuf msg) {
+    private static Buffer toBuffer(final ByteBuf msg) {
         // TODO Buffer vs ByteBuf translate, Can we handle that better ?
         msg.resetReaderIndex();
         final byte[] temp = new byte[msg.readableBytes()];
index 4488c5e1be63bc2f82bfb01575df6b5cbaa7be33..fd9a84d97a592d22605b675e6f4e6690499cb169 100644 (file)
@@ -60,7 +60,7 @@ public class ChunkedFramingMechanismEncoderTest {
         assertTrue(s.endsWith("\n#20\naaaaaaaaaaaaaaaaaaaa\n##\n"));
     }
 
-    private byte[] getByteArray(final int size) {
+    private static byte[] getByteArray(final int size) {
         final byte[] bytes = new byte[size];
         for (int i = 0; i < size; i++) {
             bytes[i] = 'a';
index 666da8ad46dc1a7d7241ae989ce26d24c7720ee6..5c5b5a21c3f232705b96d93961f11087e8c781e5 100644 (file)
@@ -47,7 +47,7 @@ public class NetconfEXIHandlersTest {
         this.msgAsExi = msgToExi(msgAsString, codec);
     }
 
-    private byte[] msgToExi(final String msgAsString, final NetconfEXICodec codec) throws EXIOptionsException, TransmogrifierException, IOException {
+    private static byte[] msgToExi(final String msgAsString, final NetconfEXICodec codec) throws EXIOptionsException, TransmogrifierException, IOException {
         final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         final Transmogrifier transmogrifier = codec.getTransmogrifier();
         transmogrifier.setOutputStream(byteArrayOutputStream);
index dfca1b80c41afd3d855216babc3a3ad6e8d45db4..a912ae03f263215b3e78bcd07c42001e66b01fd4 100644 (file)
@@ -21,7 +21,6 @@ import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;
-
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -121,7 +120,7 @@ public class AsyncSshHandlerTest {
     }
 
     @SuppressWarnings("unchecked")
-    private <T extends SshFuture<T>> ListenableFuture<SshFutureListener<T>> stubAddListener(final T future) {
+    private static <T extends SshFuture<T>> ListenableFuture<SshFutureListener<T>> stubAddListener(final T future) {
         final SettableFuture<SshFutureListener<T>> listenerSettableFuture = SettableFuture.create();
 
         doAnswer(new Answer<Object>() {
@@ -413,19 +412,19 @@ public class AsyncSshHandlerTest {
         verify(ctx).fireChannelInactive();
     }
 
-    private OpenFuture getSuccessOpenFuture() {
+    private static OpenFuture getSuccessOpenFuture() {
         final OpenFuture failedOpenFuture = mock(OpenFuture.class);
         doReturn(true).when(failedOpenFuture).isOpened();
         return failedOpenFuture;
     }
 
-    private AuthFuture getSuccessAuthFuture() {
+    private static AuthFuture getSuccessAuthFuture() {
         final AuthFuture authFuture = mock(AuthFuture.class);
         doReturn(true).when(authFuture).isSuccess();
         return authFuture;
     }
 
-    private ConnectFuture getSuccessConnectFuture(final ClientSession sshSession) {
+    private static ConnectFuture getSuccessConnectFuture(final ClientSession sshSession) {
         final ConnectFuture connectFuture = mock(ConnectFuture.class);
         doReturn(true).when(connectFuture).isConnected();
 
@@ -433,7 +432,7 @@ public class AsyncSshHandlerTest {
         return connectFuture;
     }
 
-    private ClientSession getMockedSshSession(final ChannelSubsystem subsystemChannel) throws IOException {
+    private static ClientSession getMockedSshSession(final ChannelSubsystem subsystemChannel) throws IOException {
         final ClientSession sshSession = mock(ClientSession.class);
 
         doReturn("sshSession").when(sshSession).toString();
@@ -476,7 +475,7 @@ public class AsyncSshHandlerTest {
         return subsystemChannel;
     }
 
-    private IoOutputStream getMockedIoOutputStream() {
+    private static IoOutputStream getMockedIoOutputStream() {
         final IoOutputStream mock = mock(IoOutputStream.class);
         final IoWriteFuture ioWriteFuture = mock(IoWriteFuture.class);
         doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.<SshFutureListener<IoWriteFuture>>any());
@@ -495,7 +494,7 @@ public class AsyncSshHandlerTest {
         return mock;
     }
 
-    private IoInputStream getMockedIoInputStream() {
+    private static IoInputStream getMockedIoInputStream() {
         final IoInputStream mock = mock(IoInputStream.class);
         final IoReadFuture ioReadFuture = mock(IoReadFuture.class);
         doReturn(null).when(ioReadFuture).getException();
@@ -554,14 +553,14 @@ public class AsyncSshHandlerTest {
         verify(promise).setFailure(any(Throwable.class));
     }
 
-    private AuthFuture getFailedAuthFuture() {
+    private static AuthFuture getFailedAuthFuture() {
         final AuthFuture authFuture = mock(AuthFuture.class);
         doReturn(false).when(authFuture).isSuccess();
         doReturn(new IllegalStateException()).when(authFuture).getException();
         return authFuture;
     }
 
-    private OpenFuture getFailedOpenFuture() {
+    private static OpenFuture getFailedOpenFuture() {
         final OpenFuture authFuture = mock(OpenFuture.class);
         doReturn(false).when(authFuture).isOpened();
         doReturn(new IllegalStateException()).when(authFuture).getException();
@@ -577,7 +576,7 @@ public class AsyncSshHandlerTest {
         verify(promise).setFailure(any(Throwable.class));
     }
 
-    private ConnectFuture getFailedConnectFuture() {
+    private static ConnectFuture getFailedConnectFuture() {
         final ConnectFuture connectFuture = mock(ConnectFuture.class);
         doReturn(false).when(connectFuture).isConnected();
         doReturn(new IllegalStateException()).when(connectFuture).getException();
index e8b7413069452f61e10ec29a22cbc7801afc7769..0d6b4248f6a9a1ea741c0456e35828e2f15b0ffd 100644 (file)
@@ -84,7 +84,7 @@ public class CreateSubscription extends AbstractLastNetconfOperation implements
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
     }
 
-    private StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws NetconfDocumentedException {
+    private static StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws NetconfDocumentedException {
         final Optional<XmlElement> stream = operationElement.getOnlyChildElementWithSameNamespaceOptionally("stream");
         return stream.isPresent() ? new StreamNameType(stream.get().getTextContent()) : NetconfNotificationManager.BASE_STREAM_NAME;
     }
index 05ed9bf006f79c2cc7937da1e7064f5d76364d6b..ac826a5e4454650c9d58dc9503b5ae013736f394 100644 (file)
@@ -52,7 +52,7 @@ public class GetTest {
                         "</rpc-reply>\n");
     }
 
-    private Document getBlankResponse() throws IOException, SAXException {
+    private static Document getBlankResponse() throws IOException, SAXException {
 
         return XmlUtil.readXmlToDocument("<rpc-reply message-id=\"101\"\n" +
                 "xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n" +
index 03f7a2fac2fe05108825324ef059a26033d10ff3..6ee17e6cad77d8a64a73009aeebeda35ced54a26 100644 (file)
@@ -39,7 +39,6 @@
       <dependency>
           <groupId>org.opendaylight.controller</groupId>
           <artifactId>netty-config-api</artifactId>
-          <version>0.3.0-SNAPSHOT</version>
       </dependency>
 
       <dependency>
index fb8632b99ef3d95b11ced4f1fc66cd7a9ae492e4..65f119873ccb54e8bb52940d15e6f6d3c3cdf24c 100644 (file)
@@ -49,7 +49,7 @@ public final class SshProxyServerConfigurationBuilder {
         return new SshProxyServerConfiguration(bindingAddress, localAddress, authenticator, keyPairProvider, idleTimeout);
     }
 
-    public SshProxyServerConfigurationBuilder create () {
+    public static SshProxyServerConfigurationBuilder create() {
         return new SshProxyServerConfigurationBuilder();
     }
 }
\ No newline at end of file
index c473b70eee7a981dadd71f671ec462abcab215cd..87d23355f356cfc58f599ab20b15b272e156849c 100644 (file)
@@ -47,7 +47,7 @@ final class AuthProviderTracker implements ServiceTrackerCustomizer<AuthProvider
         return authService;
     }
 
-    private Integer getPreference(final ServiceReference<AuthProvider> reference) {
+    private static Integer getPreference(final ServiceReference<AuthProvider> reference) {
         final Object preferenceProperty = reference.getProperty(AuthConstants.SERVICE_PREFERENCE_KEY);
         return preferenceProperty == null ? Integer.MIN_VALUE : Integer.valueOf(preferenceProperty.toString());
     }