From: Robert Varga Date: Sat, 6 Jun 2015 19:43:10 +0000 (+0200) Subject: Fix various netconf warnings X-Git-Tag: release/lithium~56 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=2660b697228bb3e708a556b53e06a89d5ea00440 Fix various netconf warnings Overridden version, potentially static methods. Change-Id: I54af7e8b48335b4b81594d4deeb0f75e21dbc932 Signed-off-by: Robert Varga --- diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java index f4017fbe58..b9a6f4104f 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java @@ -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; } diff --git a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java index ce18ac0579..eb45a4dcd4 100644 --- a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java +++ b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java @@ -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)); diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java index 4368f7ec79..6b306bc190 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java @@ -135,7 +135,7 @@ public final class NetconfServerSession extends AbstractNetconfSession getTransportForString(final String transport) { + private static Class getTransportForString(final String transport) { switch(transport) { case "ssh" : return NetconfSsh.class; @@ -146,7 +146,8 @@ public final class NetconfServerSession extends AbstractNetconfSession validateBaseCapabilities(final Set baseCapabilities) { + private static ImmutableSet validateBaseCapabilities(final Set baseCapabilities) { // Check base capabilities to be supported by the server final Sets.SetView unknownBaseCaps = Sets.difference(baseCapabilities, DEFAULT_BASE_CAPABILITIES); Preconditions.checkArgument(unknownBaseCaps.isEmpty(), diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java index fb0d3448a3..13e56d71e8 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java @@ -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); diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSessionTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSessionTest.java index b45b116b12..9afa76148e 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSessionTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSessionTest.java @@ -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() { @Override public Object answer(final InvocationOnMock invocation) throws Throwable { ((GenericFutureListener) invocation.getArguments()[0]).operationComplete(sendFuture); diff --git a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index 9e1edc3376..635baab924 100644 --- a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -229,7 +229,7 @@ public abstract class AbstractNetconfSessionNegotiator

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 out) throws IllegalStateException { + protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List 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'; } } 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(); } diff --git a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java index 667a4f6bf8..2716072889 100644 --- a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java +++ b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java @@ -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()]; diff --git a/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ChunkedFramingMechanismEncoderTest.java b/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ChunkedFramingMechanismEncoderTest.java index 4488c5e1be..fd9a84d97a 100644 --- a/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ChunkedFramingMechanismEncoderTest.java +++ b/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ChunkedFramingMechanismEncoderTest.java @@ -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'; diff --git a/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfEXIHandlersTest.java b/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfEXIHandlersTest.java index 666da8ad46..5c5b5a21c3 100644 --- a/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfEXIHandlersTest.java +++ b/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfEXIHandlersTest.java @@ -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); diff --git a/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java b/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java index dfca1b80c4..a912ae03f2 100644 --- a/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java +++ b/opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java @@ -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 > ListenableFuture> stubAddListener(final T future) { + private static > ListenableFuture> stubAddListener(final T future) { final SettableFuture> listenerSettableFuture = SettableFuture.create(); doAnswer(new Answer() { @@ -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.>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(); diff --git a/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/ops/CreateSubscription.java b/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/ops/CreateSubscription.java index e8b7413069..0d6b4248f6 100644 --- a/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/ops/CreateSubscription.java +++ b/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/ops/CreateSubscription.java @@ -84,7 +84,7 @@ public class CreateSubscription extends AbstractLastNetconfOperation implements return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } - private StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws NetconfDocumentedException { + private static StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws NetconfDocumentedException { final Optional stream = operationElement.getOnlyChildElementWithSameNamespaceOptionally("stream"); return stream.isPresent() ? new StreamNameType(stream.get().getTextContent()) : NetconfNotificationManager.BASE_STREAM_NAME; } diff --git a/opendaylight/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/controller/netconf/notifications/impl/ops/GetTest.java b/opendaylight/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/controller/netconf/notifications/impl/ops/GetTest.java index 05ed9bf006..ac826a5e44 100644 --- a/opendaylight/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/controller/netconf/notifications/impl/ops/GetTest.java +++ b/opendaylight/netconf/netconf-notifications-impl/src/test/java/org/opendaylight/controller/netconf/notifications/impl/ops/GetTest.java @@ -52,7 +52,7 @@ public class GetTest { "\n"); } - private Document getBlankResponse() throws IOException, SAXException { + private static Document getBlankResponse() throws IOException, SAXException { return XmlUtil.readXmlToDocument("\n" + diff --git a/opendaylight/netconf/netconf-ssh/pom.xml b/opendaylight/netconf/netconf-ssh/pom.xml index 03f7a2fac2..6ee17e6cad 100644 --- a/opendaylight/netconf/netconf-ssh/pom.xml +++ b/opendaylight/netconf/netconf-ssh/pom.xml @@ -39,7 +39,6 @@ org.opendaylight.controller netty-config-api - 0.3.0-SNAPSHOT diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/SshProxyServerConfigurationBuilder.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/SshProxyServerConfigurationBuilder.java index fb8632b99e..65f119873c 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/SshProxyServerConfigurationBuilder.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/SshProxyServerConfigurationBuilder.java @@ -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 diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/AuthProviderTracker.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/AuthProviderTracker.java index c473b70eee..87d23355f3 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/AuthProviderTracker.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/AuthProviderTracker.java @@ -47,7 +47,7 @@ final class AuthProviderTracker implements ServiceTrackerCustomizer reference) { + private static Integer getPreference(final ServiceReference reference) { final Object preferenceProperty = reference.getProperty(AuthConstants.SERVICE_PREFERENCE_KEY); return preferenceProperty == null ? Integer.MIN_VALUE : Integer.valueOf(preferenceProperty.toString()); }