From 676b7818fd81f1322b7e8aa977271f3a3af397a6 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Tue, 24 Jul 2018 15:10:43 +0200 Subject: [PATCH] Remove unused exceptions This drops exception declarations which are never used. If nothing else, it allows simplifying declarations in upstream projects too. Change-Id: I692a50ebb43e76c15a3a57ad88138be53184ce7b Signed-off-by: Stephen Kitt --- .../callhome/protocol/MinaSshNettyChannel.java | 15 +++++++-------- .../callhome/protocol/NetconfCallHomeServer.java | 2 +- .../callhome/mount/CallHomeAuthProviderImpl.java | 2 +- .../callhome/mount/CallhomeStatusReporter.java | 2 +- .../IetfZeroTouchCallHomeServerProvider.java | 2 +- .../mdsal/connector/CurrentSchemaContext.java | 2 +- .../mdsal/connector/TransactionProvider.java | 2 +- .../yang/library/SchemaServiceToMdsalWriter.java | 2 +- .../StreamNotificationTopicRegistration.java | 2 +- .../netconf/api/messages/NetconfHelloMessage.java | 12 ++++-------- .../client/NetconfClientSessionNegotiator.java | 2 +- .../NetconfClientSessionNegotiatorFactory.java | 10 +--------- .../client/SshClientChannelInitializer.java | 11 +++-------- .../client/TcpClientChannelInitializer.java | 2 +- .../client/TlsClientChannelInitializer.java | 2 +- .../NetconfServerSessionNegotiatorFactory.java | 12 +++--------- .../impl/mapping/operations/DefaultStartExi.java | 2 +- .../impl/mapping/operations/DefaultStopExi.java | 3 +-- .../osgi/NetconfCapabilityMonitoringService.java | 2 +- .../impl/osgi/NetconfMonitoringServiceImpl.java | 2 +- .../impl/osgi/NetconfOperationRouterImpl.java | 5 ++--- .../osgi/NetconfSessionMonitoringService.java | 4 ++-- .../impl/util/DeserializerExceptionHandler.java | 6 +++--- .../api/NetconfOperationChainedExecution.java | 2 +- .../org/opendaylight/netconf/monitoring/Get.java | 3 +-- .../AbstractNetconfSessionNegotiator.java | 2 +- .../handler/NetconfXMLToHelloMessageDecoder.java | 6 ++---- .../handler/ssh/client/AsyncSshHandler.java | 13 +++++-------- .../netconf/notifications/impl/ops/Get.java | 5 ++--- .../notifications/impl/osgi/Activator.java | 4 ++-- .../netconf/ssh/NetconfSSHProvider.java | 5 ++--- .../netconf/ssh/RemoteNetconfCommand.java | 9 ++++----- .../netconf/ssh/SshProxyClientHandler.java | 2 +- .../netconf/tcp/NetconfNorthboundTcpServer.java | 2 +- .../netconf/tcp/NetconfTCPProvider.java | 3 +-- .../netconf/tcp/netty/ProxyServer.java | 2 +- .../netconf/tcp/netty/ProxyServerHandler.java | 2 +- .../singleton/impl/NetconfTopologyContext.java | 4 ++-- .../impl/ProxyYangTextSourceProvider.java | 2 +- .../singleton/impl/actors/NetconfNodeActor.java | 2 +- .../singleton/impl/actors/ReadAdapter.java | 2 +- .../impl/actors/ReadTransactionActor.java | 2 +- .../impl/actors/ReadWriteTransactionActor.java | 2 +- .../impl/actors/WriteTransactionActor.java | 2 +- .../singleton/impl/utils/NetconfConnectorDTO.java | 2 +- .../singleton/messages/NormalizedNodeMessage.java | 5 ++--- .../singleton/impl/NetconfNodeManagerTest.java | 2 +- .../topology/impl/NetconfTopologyImpl.java | 2 +- .../netconf/util/messages/NetconfMessageUtil.java | 3 +-- .../util/messages/SendErrorExceptionUtil.java | 2 +- .../sal/connect/netconf/NetconfDevice.java | 2 +- .../netconf/sal/NetconfDeviceSalProvider.java | 4 ++-- .../NetconfRemoteSchemaYangSourceProvider.java | 3 +-- .../opendaylight/netconf/test/tool/Execution.java | 4 ++-- .../netconf/test/tool/NetconfDeviceSimulator.java | 4 ++-- .../opendaylight/netconf/test/tool/ScaleUtil.java | 4 ++-- .../client/http/perf/AsyncExecutionStrategy.java | 2 +- .../tool/client/http/perf/PerfClientCallable.java | 2 +- .../tool/client/http/perf/RestPerfClient.java | 2 +- .../tool/client/stress/StressClientCallable.java | 2 +- .../netconf/test/tool/customrpc/SettableRpc.java | 2 +- .../netconf/test/tool/rpc/SimulatedCommit.java | 4 +--- .../tool/rpc/SimulatedCreateSubscription.java | 4 +--- .../test/tool/rpc/SimulatedDiscardChanges.java | 4 +--- .../netconf/test/tool/rpc/SimulatedGet.java | 4 +--- .../netconf/test/tool/rpc/SimulatedGetConfig.java | 4 +--- .../netconf/test/tool/rpc/SimulatedLock.java | 4 +--- .../netconf/test/tool/rpc/SimulatedUnLock.java | 4 +--- .../netconf/test/tool/rpchandler/SettableRpc.java | 2 +- .../test/tool/schemacache/SchemaSourceCache.java | 3 +-- .../framework/ProtocolSessionPromise.java | 2 +- .../protocol/framework/ReconnectPromise.java | 2 +- .../schema/SchemaExportContentYinBodyWriter.java | 5 ++--- .../rest/impl/JsonNormalizedNodeBodyReader.java | 4 ++-- .../sal/rest/impl/JsonToPatchBodyReader.java | 2 +- .../netconf/sal/rest/impl/PatchXmlBodyWriter.java | 7 +++---- .../rest/impl/XmlNormalizedNodeBodyReader.java | 4 ++-- .../sal/rest/impl/XmlToPatchBodyReader.java | 2 +- .../listeners/AbstractCommonSubscriber.java | 2 +- .../websockets/WebSocketServerHandler.java | 9 ++++----- .../websockets/WebSocketServerInitializer.java | 2 +- .../impl/json/to/nn/test/JsonToNnTest.java | 3 +-- .../providers/JsonNormalizedNodeBodyReader.java | 6 ++---- .../providers/XmlNormalizedNodeBodyReader.java | 2 +- .../providers/patch/JsonToPatchBodyReader.java | 2 +- .../providers/patch/PatchXmlBodyWriter.java | 7 +++---- .../providers/patch/XmlToPatchBodyReader.java | 2 +- .../schema/SchemaExportContentYinBodyWriter.java | 5 ++--- .../spi/AbstractIdentifierAwareJaxRsProvider.java | 2 +- .../impl/JSONRestconfServiceRfc8040Impl.java | 7 +------ .../websockets/WebSocketServerHandler.java | 9 ++++----- .../websockets/WebSocketServerInitializer.java | 2 +- 92 files changed, 141 insertions(+), 209 deletions(-) diff --git a/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java b/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java index 02b9d3d0da..e18facf652 100644 --- a/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java +++ b/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java @@ -55,8 +55,7 @@ class MinaSshNettyChannel extends AbstractServerChannel { private ChannelOutboundHandlerAdapter createChannelAdapter() { return new ChannelOutboundHandlerAdapter() { @Override - public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise) - throws Exception { + public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise) { sshWriteAsyncHandler.write(ctx, msg, promise); } }; @@ -107,7 +106,7 @@ class MinaSshNettyChannel extends AbstractServerChannel { } @Override - protected void doBind(final SocketAddress localAddress) throws Exception { + protected void doBind(final SocketAddress localAddress) { throw new UnsupportedOperationException("Bind not supported."); } @@ -128,14 +127,14 @@ class MinaSshNettyChannel extends AbstractServerChannel { } @Override - protected void doDisconnect() throws Exception { + protected void doDisconnect() { LOG.info("Disconnect invoked"); doNettyDisconnect(); doMinaDisconnect(false); } @Override - protected void doClose() throws Exception { + protected void doClose() { context.removeSelf(); if (notClosing(session)) { session.close(true); @@ -144,12 +143,12 @@ class MinaSshNettyChannel extends AbstractServerChannel { } @Override - protected void doBeginRead() throws Exception { + protected void doBeginRead() { // Intentional NOOP - read is started by AsyncSshHandlerReader } @Override - protected void doWrite(final ChannelOutboundBuffer in) throws Exception { + protected void doWrite(final ChannelOutboundBuffer in) { throw new IllegalStateException("Outbound writes to SSH should be done by SSH Write handler"); } @@ -166,7 +165,7 @@ class MinaSshNettyChannel extends AbstractServerChannel { * Invoked when SSH session dropped during read using {@link AsyncSshHandlerReader}. */ @Override - public void close() throws Exception { + public void close() { doNettyDisconnect(); } } diff --git a/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java b/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java index 6b88df3987..a3e2db5054 100644 --- a/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java +++ b/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java @@ -184,7 +184,7 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier { } @Override - public void close() throws Exception { + public void close() { acceptor.close(true); } } diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallHomeAuthProviderImpl.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallHomeAuthProviderImpl.java index 15445eb746..c00bcec83b 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallHomeAuthProviderImpl.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallHomeAuthProviderImpl.java @@ -112,7 +112,7 @@ public class CallHomeAuthProviderImpl implements CallHomeAuthorizationProvider, } @Override - public void close() throws Exception { + public void close() { configReg.close(); deviceReg.close(); deviceOpReg.close(); diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java index db43d0d393..8a4979502b 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java @@ -314,7 +314,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener, StatusReco } @Override - public void close() throws Exception { + public void close() { reg.close(); } } diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java index 2d752489a1..30a10cd5fa 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java @@ -121,7 +121,7 @@ public class IetfZeroTouchCallHomeServerProvider implements AutoCloseable, DataT } @Override - public void close() throws Exception { + public void close() { authProvider.close(); statusReporter.close(); diff --git a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java index 165f6310c7..2c5adb41b3 100644 --- a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java +++ b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java @@ -51,7 +51,7 @@ public class CurrentSchemaContext implements SchemaContextListener, AutoCloseabl } @Override - public void close() throws Exception { + public void close() { listeners1.clear(); schemaContextListenerListenerRegistration.close(); currentContext.set(null); diff --git a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/TransactionProvider.java b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/TransactionProvider.java index 768c7f2c23..5baf6d7d31 100644 --- a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/TransactionProvider.java +++ b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/TransactionProvider.java @@ -48,7 +48,7 @@ public class TransactionProvider implements AutoCloseable { } @Override - public synchronized void close() throws Exception { + public synchronized void close() { for (final DOMDataReadWriteTransaction rwt : allOpenReadWriteTransactions) { rwt.cancel(); } diff --git a/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java b/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java index 69296ffe1c..5fe60f91ff 100644 --- a/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java +++ b/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java @@ -58,7 +58,7 @@ public class SchemaServiceToMdsalWriter implements SchemaContextListener, AutoCl } @Override - public void close() throws Exception { + public void close() { // TODO Delete modules-state from operational data store } diff --git a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/StreamNotificationTopicRegistration.java b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/StreamNotificationTopicRegistration.java index a77dbdc2e1..01966c2072 100644 --- a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/StreamNotificationTopicRegistration.java +++ b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/StreamNotificationTopicRegistration.java @@ -160,7 +160,7 @@ class StreamNotificationTopicRegistration extends NotificationTopicRegistration } @Override - public void close() throws Exception { + public void close() { closeStream(); } diff --git a/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/messages/NetconfHelloMessage.java b/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/messages/NetconfHelloMessage.java index 52ec7e1078..349a57a64d 100644 --- a/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/messages/NetconfHelloMessage.java +++ b/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/messages/NetconfHelloMessage.java @@ -11,7 +11,6 @@ package org.opendaylight.netconf.api.messages; import com.google.common.base.Optional; import com.google.common.collect.Sets; import java.util.Set; -import org.opendaylight.netconf.api.NetconfDocumentedException; import org.opendaylight.netconf.api.NetconfMessage; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; @@ -31,14 +30,13 @@ public final class NetconfHelloMessage extends NetconfMessage { private final NetconfHelloMessageAdditionalHeader additionalHeader; - public NetconfHelloMessage(final Document doc, final NetconfHelloMessageAdditionalHeader additionalHeader) - throws NetconfDocumentedException { + public NetconfHelloMessage(final Document doc, final NetconfHelloMessageAdditionalHeader additionalHeader) { super(doc); checkHelloMessage(doc); this.additionalHeader = additionalHeader; } - public NetconfHelloMessage(final Document doc) throws NetconfDocumentedException { + public NetconfHelloMessage(final Document doc) { this(doc, null); } @@ -55,8 +53,7 @@ public final class NetconfHelloMessage extends NetconfMessage { } public static NetconfHelloMessage createClientHello(final Iterable capabilities, - final Optional additionalHeaderOptional) - throws NetconfDocumentedException { + final Optional additionalHeaderOptional) { return new NetconfHelloMessage(createHelloMessageDoc(capabilities), additionalHeaderOptional.orNull()); } @@ -80,8 +77,7 @@ public final class NetconfHelloMessage extends NetconfMessage { return doc; } - public static NetconfHelloMessage createServerHello(final Set capabilities, final long sessionId) - throws NetconfDocumentedException { + public static NetconfHelloMessage createServerHello(final Set capabilities, final long sessionId) { Document doc = createHelloMessageDoc(capabilities); Element sessionIdElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.SESSION_ID); diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java index 69dc1059b5..1816fee0e0 100644 --- a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java +++ b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java @@ -154,7 +154,7 @@ public class NetconfClientSessionNegotiator extends @Override protected NetconfClientSession getSession(final NetconfClientSessionListener sessionListener, final Channel channel, - final NetconfHelloMessage message) throws NetconfDocumentedException { + final NetconfHelloMessage message) { final long sessionId = extractSessionId(message.getDocument()); // Copy here is important: it disconnects the strings from the document diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java index 8123e5999e..d5e722d3e2 100644 --- a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java +++ b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java @@ -19,7 +19,6 @@ import io.netty.util.Timer; import io.netty.util.concurrent.Promise; import java.util.Set; import org.opendaylight.netconf.api.NetconfClientSessionPreferences; -import org.opendaylight.netconf.api.NetconfDocumentedException; import org.opendaylight.netconf.api.NetconfMessage; import org.opendaylight.netconf.api.messages.NetconfHelloMessage; import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader; @@ -111,14 +110,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF final Channel channel, final Promise promise) { NetconfMessage startExiMessage = NetconfStartExiMessage.create(options, START_EXI_MESSAGE_ID); - NetconfHelloMessage helloMessage = null; - try { - helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader); - } catch (NetconfDocumentedException e) { - LOG.error("Unable to create client hello message with capabilities {} and additional handler {}", - clientCapabilities, additionalHeader); - throw new IllegalStateException(e); - } + NetconfHelloMessage helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader); NetconfClientSessionPreferences proposal = new NetconfClientSessionPreferences(helloMessage, startExiMessage); return new NetconfClientSessionNegotiator(proposal, promise, channel, timer, diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java index 9adf79cef1..37211c9a79 100644 --- a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java +++ b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.client; import io.netty.channel.Channel; import io.netty.util.concurrent.Promise; -import java.io.IOException; import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer; import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler; import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler; @@ -30,13 +29,9 @@ final class SshClientChannelInitializer extends AbstractChannelInitializer promise) { - try { - // ssh handler has to be the first handler in pipeline - ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler, promise)); - super.initialize(ch, promise); - } catch (final IOException e) { - throw new RuntimeException(e); - } + // ssh handler has to be the first handler in pipeline + ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler, promise)); + super.initialize(ch, promise); } @Override diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TcpClientChannelInitializer.java b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TcpClientChannelInitializer.java index 5f25800b4b..c241e17656 100644 --- a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TcpClientChannelInitializer.java +++ b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TcpClientChannelInitializer.java @@ -43,7 +43,7 @@ class TcpClientChannelInitializer extends AbstractChannelInitializer promise) { final long sessionId = idProvider.getNextSessionId(); - NetconfServerSessionPreferences proposal; - try { - proposal = new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId); - } catch (final NetconfDocumentedException e) { - LOG.error("Unable to create hello message for session {} with {}", sessionId, monitoringService); - throw new IllegalStateException(e); - } + NetconfServerSessionPreferences proposal = + new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId); return new NetconfServerSessionNegotiator(proposal, promise, channel, timer, getListener(Long.toString(sessionId), channel.parent().localAddress()), connectionTimeoutMillis); @@ -130,7 +124,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF } private NetconfHelloMessage createHelloMessage( - final long sessionId, final NetconfMonitoringService capabilityProvider) throws NetconfDocumentedException { + final long sessionId, final NetconfMonitoringService capabilityProvider) { return NetconfHelloMessage.createServerHello(Sets.union(transformCapabilities(capabilityProvider .getCapabilities()), baseCapabilities), sessionId); } diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStartExi.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStartExi.java index f1f57c204a..3b4a560464 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStartExi.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStartExi.java @@ -52,7 +52,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement @Override protected Element handleWithNoSubsequentOperations(final Document document, - final XmlElement operationElement) throws DocumentedException { + final XmlElement operationElement) { final Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK); LOG.trace("{} operation successful", START_EXI); diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStopExi.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStopExi.java index a60ffb756a..cd2d0f1e93 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStopExi.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStopExi.java @@ -7,7 +7,6 @@ */ package org.opendaylight.netconf.impl.mapping.operations; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -32,7 +31,7 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements @Override protected Element handleWithNoSubsequentOperations(Document document, - XmlElement operationElement) throws DocumentedException { + XmlElement operationElement) { LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement)); netconfSession.stopExiCommunication(); diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java index 5739488ff5..fd520a363e 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java @@ -205,7 +205,7 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos } @Override - public synchronized void close() throws Exception { + public synchronized void close() { listeners.clear(); capabilities.clear(); } diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java index 5c4c508f31..ff0bc5ce39 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java @@ -80,7 +80,7 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, A } @Override - public void close() throws Exception { + public void close() { capabilityMonitoring.close(); sessionMonitoring.close(); } diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java index ee712b78c3..449b0db530 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java @@ -90,12 +90,11 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { } @Override - public void close() throws Exception { + public void close() { netconfOperationServiceSnapshot.close(); } - private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) throws - DocumentedException { + private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) { LOG.error("{}", message, exception); return new DocumentedException("Unexpected error", DocumentedException.ErrorType.APPLICATION, diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringService.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringService.java index 72697ffebf..da9a96b6d1 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringService.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringService.java @@ -101,14 +101,14 @@ class NetconfSessionMonitoringService implements SessionListener, AutoCloseable } return new AutoCloseable() { @Override - public void close() throws Exception { + public void close() { listeners.remove(listener); } }; } @Override - public synchronized void close() throws Exception { + public synchronized void close() { stopUpdateSessionStats(); listeners.clear(); sessions.clear(); diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/util/DeserializerExceptionHandler.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/util/DeserializerExceptionHandler.java index 18b490ab13..effccf3701 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/util/DeserializerExceptionHandler.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/util/DeserializerExceptionHandler.java @@ -22,17 +22,17 @@ public final class DeserializerExceptionHandler implements ChannelHandler { private static final Logger LOG = LoggerFactory.getLogger(DeserializerExceptionHandler.class); @Override - public void handlerAdded(final ChannelHandlerContext ctx) throws Exception { + public void handlerAdded(final ChannelHandlerContext ctx) { // NOOP } @Override - public void handlerRemoved(final ChannelHandlerContext ctx) throws Exception { + public void handlerRemoved(final ChannelHandlerContext ctx) { // NOOP } @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { LOG.warn("An exception occurred during message handling", cause); handleDeserializerException(ctx, cause); } diff --git a/netconf/netconf-mapping-api/src/main/java/org/opendaylight/netconf/mapping/api/NetconfOperationChainedExecution.java b/netconf/netconf-mapping-api/src/main/java/org/opendaylight/netconf/mapping/api/NetconfOperationChainedExecution.java index b7fae22c00..8d0385948a 100644 --- a/netconf/netconf-mapping-api/src/main/java/org/opendaylight/netconf/mapping/api/NetconfOperationChainedExecution.java +++ b/netconf/netconf-mapping-api/src/main/java/org/opendaylight/netconf/mapping/api/NetconfOperationChainedExecution.java @@ -37,7 +37,7 @@ public interface NetconfOperationChainedExecution { } @Override - public Document execute(Document requestMessage) throws DocumentedException { + public Document execute(Document requestMessage) { throw new IllegalStateException("This execution represents the termination point in operation execution " + "and cannot be executed itself"); } diff --git a/netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/Get.java b/netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/Get.java index 7aa2c2a4d7..4eaf60496c 100644 --- a/netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/Get.java +++ b/netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/Get.java @@ -85,8 +85,7 @@ public class Get extends AbstractNetconfOperation { @Override protected Element handle(final Document document, final XmlElement message, - final NetconfOperationChainedExecution subsequentOperation) - throws DocumentedException { + final NetconfOperationChainedExecution subsequentOperation) { throw new UnsupportedOperationException("Never gets called"); } } diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index b6a26804fd..065a5bc9c4 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -141,7 +141,7 @@ public abstract class AbstractNetconfSessionNegotiator

() { @Override - public void operationComplete(final ChannelFuture future) throws Exception { + public void operationComplete(final ChannelFuture future) { if (future.isSuccess()) { LOG.debug("Channel {} closed: success", future.channel()); } else { diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java index 82f707572c..6e02a3fa97 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java @@ -21,7 +21,6 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; -import org.opendaylight.netconf.api.NetconfDocumentedException; import org.opendaylight.netconf.api.NetconfMessage; import org.opendaylight.netconf.api.messages.NetconfHelloMessage; import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader; @@ -60,7 +59,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder @Override @VisibleForTesting public void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List out) - throws IOException, SAXException, NetconfDocumentedException { + throws IOException, SAXException { if (in.readableBytes() == 0) { LOG.debug("No more content in incoming buffer."); return; @@ -108,8 +107,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder } } - private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc) - throws NetconfDocumentedException { + private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc) { NetconfMessage msg = new NetconfMessage(doc); if (NetconfHelloMessage.isHelloMessage(msg)) { if (additionalHeader != null) { diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java index 2d080ef3fc..fa59b344b8 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java @@ -63,7 +63,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { private GenericFutureListener negotiationFutureListener; public AsyncSshHandler(final AuthenticationHandler authenticationHandler, final SshClient sshClient, - final Future negotiationFuture) throws IOException { + final Future negotiationFuture) { this(authenticationHandler, sshClient); this.negotiationFuture = negotiationFuture; } @@ -73,16 +73,14 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { * * @param authenticationHandler authentication handler * @param sshClient started SshClient - * @throws IOException if the I/O operation fails */ public AsyncSshHandler(final AuthenticationHandler authenticationHandler, - final SshClient sshClient) throws IOException { + final SshClient sshClient) { this.authenticationHandler = Preconditions.checkNotNull(authenticationHandler); this.sshClient = Preconditions.checkNotNull(sshClient); } - public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler) - throws IOException { + public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler) { return new AsyncSshHandler(authenticationHandler, DEFAULT_CLIENT); } @@ -93,10 +91,9 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { * @param authenticationHandler authentication handler * @param negotiationFuture negotiation future * @return {@code AsyncSshHandler} - * @throws IOException if the I/O operation fails */ public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler, - final Future negotiationFuture) throws IOException { + final Future negotiationFuture) { return new AsyncSshHandler(authenticationHandler, DEFAULT_CLIENT, negotiationFuture); } @@ -212,7 +209,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { } @Override - public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception { + public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) { disconnect(ctx, promise); } diff --git a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/Get.java b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/Get.java index bd7c9d17f9..e55f852a89 100644 --- a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/Get.java +++ b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/Get.java @@ -54,8 +54,7 @@ public class Get extends AbstractNetconfOperation implements AutoCloseable { @Override protected Element handle(final Document document, final XmlElement message, - final NetconfOperationChainedExecution subsequentOperation) - throws DocumentedException { + final NetconfOperationChainedExecution subsequentOperation) { throw new UnsupportedOperationException("Never gets called"); } @@ -103,7 +102,7 @@ public class Get extends AbstractNetconfOperation implements AutoCloseable { } @Override - public void close() throws Exception { + public void close() { } } diff --git a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java index 6724d10f14..cc4c57c07b 100644 --- a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java +++ b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java @@ -41,7 +41,7 @@ public class Activator implements BundleActivator { private NetconfNotificationManager netconfNotificationManager; @Override - public void start(final BundleContext context) throws Exception { + public void start(final BundleContext context) { netconfNotificationManager = new NetconfNotificationManager(); // Add properties to autowire with netconf-impl instance for cfg subsystem final Dictionary props = new Hashtable<>(); @@ -94,7 +94,7 @@ public class Activator implements BundleActivator { } @Override - public void stop(final BundleContext context) throws Exception { + public void stop(final BundleContext context) { if (netconfNotificationCollectorServiceRegistration != null) { netconfNotificationCollectorServiceRegistration.unregister(); netconfNotificationCollectorServiceRegistration = null; diff --git a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfSSHProvider.java b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfSSHProvider.java index 971e50631e..dd2d089700 100644 --- a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfSSHProvider.java +++ b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfSSHProvider.java @@ -20,7 +20,6 @@ import org.apache.sshd.common.util.threads.ThreadUtils; import org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider; import org.opendaylight.netconf.auth.AuthProvider; import org.opendaylight.netconf.util.NetconfConfiguration; -import org.osgi.framework.InvalidSyntaxException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +49,7 @@ public class NetconfSSHProvider { // Called via blueprint @SuppressWarnings("unused") - public void init() throws IOException, InvalidSyntaxException { + public void init() throws IOException { minaTimerExecutor = Executors.newScheduledThreadPool(POOL_SIZE, runnable -> new Thread(runnable, "netconf-ssh-server-mina-timers")); clientGroup = new NioEventLoopGroup(); @@ -79,7 +78,7 @@ public class NetconfSSHProvider { } private SshProxyServer startSSHServer() - throws IOException, InvalidSyntaxException { + throws IOException { final InetSocketAddress sshSocketAddress = netconfConfiguration.getSshServerAddress(); LOG.info("Starting netconf SSH server at {}", sshSocketAddress); diff --git a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java index 3d91f3aeb4..c016dc3959 100644 --- a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java +++ b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java @@ -17,7 +17,6 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.local.LocalAddress; import io.netty.channel.local.LocalChannel; import io.netty.util.concurrent.GenericFutureListener; -import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetSocketAddress; @@ -105,7 +104,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware { } @Override - public void start(final Environment env) throws IOException { + public void start(final Environment env) { LOG.trace("Establishing internal connection to netconf server for client: {}", getClientAddress()); final Bootstrap clientBootstrap = new Bootstrap(); @@ -113,7 +112,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware { clientBootstrap.handler(new ChannelInitializer() { @Override - public void initChannel(final LocalChannel ch) throws Exception { + public void initChannel(final LocalChannel ch) { ch.pipeline() .addLast(new SshProxyClientHandler(in, out, netconfHelloMessageAdditionalHeader, callback)); } @@ -122,7 +121,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware { clientChannelFuture.addListener(new GenericFutureListener() { @Override - public void operationComplete(final ChannelFuture future) throws Exception { + public void operationComplete(final ChannelFuture future) { if (future.isSuccess()) { clientChannel = clientChannelFuture.channel(); } else { @@ -146,7 +145,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware { clientChannel.close().addListener(new GenericFutureListener() { @Override - public void operationComplete(final ChannelFuture future) throws Exception { + public void operationComplete(final ChannelFuture future) { if (!future.isSuccess()) { LOG.warn("Unable to release internal connection to netconf server on channel: {}", clientChannel); diff --git a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java index e8ec506026..edd63653f1 100644 --- a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java +++ b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java @@ -79,7 +79,7 @@ final class SshProxyClientHandler extends ChannelInboundHandlerAdapter { } @Override - public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception { + public void channelRead(final ChannelHandlerContext ctx, final Object msg) { asyncSshHandlerWriter.write(ctx, msg, ctx.newPromise()); } diff --git a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfNorthboundTcpServer.java b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfNorthboundTcpServer.java index 8b9caef47b..69090c283f 100644 --- a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfNorthboundTcpServer.java +++ b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfNorthboundTcpServer.java @@ -48,7 +48,7 @@ public class NetconfNorthboundTcpServer implements AutoCloseable { } @Override - public void close() throws Exception { + public void close() { if (tcpServer.isDone()) { tcpServer.channel().close(); } else { diff --git a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfTCPProvider.java b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfTCPProvider.java index d53cf40916..54fb94e162 100644 --- a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfTCPProvider.java +++ b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfTCPProvider.java @@ -11,7 +11,6 @@ package org.opendaylight.netconf.tcp; import java.net.InetSocketAddress; import org.opendaylight.netconf.tcp.netty.ProxyServer; import org.opendaylight.netconf.util.NetconfConfiguration; -import org.osgi.framework.InvalidSyntaxException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,7 +29,7 @@ public class NetconfTCPProvider { // Called via blueprint @SuppressWarnings("unused") - public void init() throws InvalidSyntaxException { + public void init() { final InetSocketAddress address = netconfConfiguration.getTcpServerAddress(); if (address.getAddress().isAnyLocalAddress()) { diff --git a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java index 58d5a30458..feabd71cf0 100644 --- a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java +++ b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java @@ -38,7 +38,7 @@ public class ProxyServer implements AutoCloseable { .handler(new LoggingHandler(LogLevel.DEBUG)) .childHandler(new ChannelInitializer() { @Override - public void initChannel(SocketChannel ch) throws Exception { + public void initChannel(SocketChannel ch) { ch.pipeline().addLast(new ProxyServerHandler(clientBootstrap, localAddress)); } }); diff --git a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServerHandler.java b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServerHandler.java index 4731b0fed9..5843f41066 100644 --- a/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServerHandler.java +++ b/netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServerHandler.java @@ -36,7 +36,7 @@ public class ProxyServerHandler extends ChannelInboundHandlerAdapter { final ProxyClientHandler clientHandler = new ProxyClientHandler(remoteCtx); clientBootstrap.handler(new ChannelInitializer() { @Override - public void initChannel(LocalChannel ch) throws Exception { + public void initChannel(LocalChannel ch) { ch.pipeline().addLast(clientHandler); } }); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java index 7275be18e6..99b541b846 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java @@ -120,7 +120,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable { } @Override - public void close() throws Exception { + public void close() { if (!closed.compareAndSet(false, true)) { return; } @@ -155,7 +155,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable { future.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final Object success) throws Throwable { + public void onComplete(final Throwable failure, final Object success) { if (failure != null) { LOG.error("Failed to refresh master actor data: {}", failure); return; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyYangTextSourceProvider.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyYangTextSourceProvider.java index e9ee161437..29423dddb1 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyYangTextSourceProvider.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyYangTextSourceProvider.java @@ -54,7 +54,7 @@ public class ProxyYangTextSourceProvider implements RemoteYangTextSourceProvider scalaFuture.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final Object success) throws Throwable { + public void onComplete(final Throwable failure, final Object success) { if (failure != null) { promise.failure(failure); return; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java index f81c7541f1..a00bbb7f16 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java @@ -111,7 +111,7 @@ public class NetconfNodeActor extends AbstractUntypedActor { @SuppressWarnings("checkstyle:IllegalCatch") @Override - public void handleReceive(final Object message) throws Exception { + public void handleReceive(final Object message) { LOG.debug("{}: received message {}", id, message); if (message instanceof CreateInitialMasterActorData) { // master diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java index c7a7d232c0..abce08922b 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java @@ -32,7 +32,7 @@ class ReadAdapter { } @SuppressWarnings("checkstyle:IllegalThrows") - public void handle(final Object message, final ActorRef sender, final ActorRef self) throws Throwable { + public void handle(final Object message, final ActorRef sender, final ActorRef self) { if (message instanceof ReadRequest) { final ReadRequest readRequest = (ReadRequest) message; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActor.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActor.java index 0a2685965d..f96e76bf0b 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActor.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActor.java @@ -35,7 +35,7 @@ public final class ReadTransactionActor extends UntypedAbstractActor { } @Override - public void onReceive(final Object message) throws Throwable { + public void onReceive(final Object message) { if (message instanceof ReadActorMessage) { readAdapter.handle(message, sender(), self()); } else { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActor.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActor.java index eddb34bc5a..0220b62642 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActor.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActor.java @@ -49,7 +49,7 @@ public final class ReadWriteTransactionActor extends UntypedAbstractActor { } @Override - public void onReceive(final Object message) throws Throwable { + public void onReceive(final Object message) { if (message instanceof ReadActorMessage) { readAdapter.handle(message, sender(), self()); } else if (message instanceof WriteActorMessage) { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActor.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActor.java index c8ab4237a7..2a5c7ada48 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActor.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActor.java @@ -50,7 +50,7 @@ public final class WriteTransactionActor extends UntypedAbstractActor { } @Override - public void onReceive(final Object message) throws Throwable { + public void onReceive(final Object message) { if (message instanceof WriteActorMessage) { writeAdapter.handle(message, sender(), context(), self()); } else if (message instanceof ReceiveTimeout) { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfConnectorDTO.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfConnectorDTO.java index 06578783be..53d7e6b7e5 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfConnectorDTO.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfConnectorDTO.java @@ -37,7 +37,7 @@ public class NetconfConnectorDTO implements AutoCloseable { } @Override - public void close() throws Exception { + public void close() { if (communicator != null) { communicator.close(); } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java index c9ed78508f..62690ea625 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.topology.singleton.messages; import java.io.Externalizable; -import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils; @@ -43,12 +42,12 @@ public class NormalizedNodeMessage implements Externalizable { } @Override - public void writeExternal(final ObjectOutput out) throws IOException { + public void writeExternal(final ObjectOutput out) { SerializationUtils.serializePathAndNode(getIdentifier(), node, out); } @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(final ObjectInput in) { SerializationUtils.deserializePathAndNode(in, this, APPLIER); } diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java index 33c0b70525..721817e809 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java @@ -398,7 +398,7 @@ public class NetconfNodeManagerTest { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public void handleReceive(Object message) throws Exception { + public void handleReceive(Object message) { CompletableFuture dropFuture = messagesToDrop.remove(message.getClass()); if (dropFuture != null) { dropFuture.complete(message); diff --git a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java index 86f08cd532..98c45544e2 100644 --- a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java +++ b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java @@ -62,7 +62,7 @@ public class NetconfTopologyImpl extends AbstractNetconfTopology } @Override - public void close() throws Exception { + public void close() { // close all existing connectors, delete whole topology in datastore? for (final NetconfConnectorDTO connectorDTO : activeConnectors.values()) { connectorDTO.close(); diff --git a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java index a3f37d6c92..6e16741be2 100644 --- a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java +++ b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java @@ -66,8 +66,7 @@ public final class NetconfMessageUtil { } } - public static Collection extractCapabilitiesFromHello(final Document doc) - throws NetconfDocumentedException { + public static Collection extractCapabilitiesFromHello(final Document doc) { XmlElement responseElement = XmlElement.fromDomDocument(doc); // Extract child element from with or without(fallback) the same namespace Optional capabilitiesElement = responseElement diff --git a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java index 9c4df2b9b1..f89d2848ef 100644 --- a/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java +++ b/netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java @@ -100,7 +100,7 @@ public final class SendErrorExceptionUtil { } @Override - public void operationComplete(final ChannelFuture channelFuture) throws Exception { + public void operationComplete(final ChannelFuture channelFuture) { Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception %s", sendErrorException, channelFuture.cause()); } diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java index c9ccf93fcb..fc100b3db8 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java @@ -353,7 +353,7 @@ public class NetconfDevice } @Override - public DeviceSources call() throws Exception { + public DeviceSources call() { final NetconfDeviceSchemas availableSchemas = stateSchemasResolver.resolve(deviceRpc, remoteSessionCapabilities, id); LOG.debug("{}: Schemas exposed by ietf-netconf-monitoring: {}", id, diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java index f4b44d9bc4..b24eb89c99 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java @@ -91,7 +91,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable { } @Override - public void close() throws Exception { + public void close() { mountInstance.close(); if (topologyDatastoreAdapter != null) { topologyDatastoreAdapter.close(); @@ -154,7 +154,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable { } @Override - public synchronized void close() throws Exception { + public synchronized void close() { onTopologyDeviceDisconnected(); } diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java index 0ba6cead95..8cfc267ecd 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java @@ -19,7 +19,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import java.io.ByteArrayInputStream; -import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import javax.annotation.Nonnull; @@ -188,7 +187,7 @@ public final class NetconfRemoteSchemaYangSourceProvider implements SchemaSource } @Override - public InputStream openStream() throws IOException { + public InputStream openStream() { return new ByteArrayInputStream(schemaString.get().getBytes(StandardCharsets.UTF_8)); } } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java index d4e6683278..9544559d0d 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java @@ -137,7 +137,7 @@ public class Execution implements Callable { } @Override - public Response onCompleted(Response response) throws Exception { + public Response onCompleted(Response response) { semaphore.release(); return response; } @@ -155,7 +155,7 @@ public class Execution implements Callable { } @Override - public Void call() throws Exception { + public Void call() { if (invokeAsync) { this.invokeAsync(); } else { diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java index c19cc55745..dea8fa8199 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java @@ -268,7 +268,7 @@ public class NetconfDeviceSimulator implements Closeable { } private SshProxyServerConfiguration getSshConfiguration(final InetSocketAddress bindingAddress, - final LocalAddress tcpLocalAddress, final KeyPairProvider keyPairProvider) throws IOException { + final LocalAddress tcpLocalAddress, final KeyPairProvider keyPairProvider) { return new SshProxyServerConfigurationBuilder() .setBindingAddress(bindingAddress) .setLocalAddress(tcpLocalAddress) @@ -370,7 +370,7 @@ public class NetconfDeviceSimulator implements Closeable { } @Override - public InputStream openStream() throws IOException { + public InputStream openStream() { return getClass().getResourceAsStream(resource); } }), PotentialSchemaSource.create(sourceId, YangTextSchemaSource.class, diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java index 3f275681aa..f67c96e2f4 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java @@ -259,7 +259,7 @@ public final class ScaleUtil { private static class TimeoutGuard implements Callable { @Override - public Void call() throws Exception { + public Void call() { resultsLog.warn("Timeout for scale test reached after: {} ..aborting", STOPWATCH); root.warn("Timeout for scale test reached after: {} ..aborting", STOPWATCH); System.exit(0); @@ -286,7 +286,7 @@ public final class ScaleUtil { } @Override - public T call() throws Exception { + public T call() { try { return theCallable.call(); } catch (Exception e) { diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/AsyncExecutionStrategy.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/AsyncExecutionStrategy.java index 98d38dd475..ecbb6de768 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/AsyncExecutionStrategy.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/AsyncExecutionStrategy.java @@ -58,7 +58,7 @@ public class AsyncExecutionStrategy implements ExecutionStrategy { } @Override - public Response onCompleted(Response response) throws Exception { + public Response onCompleted(Response response) { semaphore.release(); return response; } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/PerfClientCallable.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/PerfClientCallable.java index 787aa7f4ba..59ff9260c9 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/PerfClientCallable.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/PerfClientCallable.java @@ -63,7 +63,7 @@ public class PerfClientCallable implements Callable { } @Override - public Void call() throws Exception { + public Void call() { executionStrategy.invoke(); asyncHttpClient.closeAsynchronously(); return null; diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java index 94eff3d25d..55580f6bed 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java @@ -69,7 +69,7 @@ public final class RestPerfClient { } - public static void main(String[] args) throws IOException { + public static void main(String[] args) { Parameters parameters = parseArgs(args, Parameters.getParser()); parameters.validate(); diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java index c2868795c9..9a29a1ec9d 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java @@ -59,7 +59,7 @@ public class StressClientCallable implements Callable { } @Override - public Boolean call() throws Exception { + public Boolean call() { executionStrategy.invoke(); netconfClientSession.close(); return Boolean.TRUE; diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/customrpc/SettableRpc.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/customrpc/SettableRpc.java index d806f768df..ed43703e3e 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/customrpc/SettableRpc.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/customrpc/SettableRpc.java @@ -33,7 +33,7 @@ class SettableRpc implements NetconfOperation { } @Override - public HandlingPriority canHandle(final Document message) throws DocumentedException { + public HandlingPriority canHandle(final Document message) { return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000); } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java index ad647f667f..c985f45f9f 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc; import com.google.common.base.Optional; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -24,8 +23,7 @@ public class SimulatedCommit extends AbstractLastNetconfOperation { } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java index eab9f2c820..8a42baa7a2 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java @@ -25,7 +25,6 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.XmlRootElement; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.NetconfMessage; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; @@ -90,8 +89,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { long delayAggregator = 0; for (final Map.Entry notification : notifications.entrySet()) { diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java index ef5d06beb2..fe54d84f9f 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc; import com.google.common.base.Optional; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -24,8 +23,7 @@ public class SimulatedDiscardChanges extends AbstractLastNetconfOperation { } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java index 83897d0c98..e5b197d3c3 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc; import com.google.common.base.Optional; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -27,8 +26,7 @@ public class SimulatedGet extends AbstractLastNetconfOperation { } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent()); for (final XmlElement e : storage.getConfigList()) { diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java index 572fd961b7..4c2a8592a9 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java @@ -12,7 +12,6 @@ import com.google.common.base.Optional; import java.io.File; import java.io.IOException; import java.util.List; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -60,8 +59,7 @@ public class SimulatedGetConfig extends AbstractLastNetconfOperation { } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent()); for (final XmlElement e : storage.getConfigList()) { diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java index c7d4e0c13a..1dfbd1f428 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc; import com.google.common.base.Optional; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -24,8 +23,7 @@ public class SimulatedLock extends AbstractLastNetconfOperation { } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java index 6002bea60a..bfd0026c37 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.test.tool.rpc; import com.google.common.base.Optional; -import org.opendaylight.netconf.api.DocumentedException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.netconf.api.xml.XmlUtil; @@ -24,8 +23,7 @@ public class SimulatedUnLock extends AbstractLastNetconfOperation { } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) - throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) { return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpchandler/SettableRpc.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpchandler/SettableRpc.java index a3e449f05a..a6e0f07773 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpchandler/SettableRpc.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpchandler/SettableRpc.java @@ -32,7 +32,7 @@ class SettableRpc implements NetconfOperation { } @Override - public HandlingPriority canHandle(final Document message) throws DocumentedException { + public HandlingPriority canHandle(final Document message) { return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000); } diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java index 51f80848bd..9ac7b647c0 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java @@ -11,7 +11,6 @@ import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; @@ -102,7 +101,7 @@ public final class SchemaSourceCache } @Override - public InputStream openStream() throws IOException { + public InputStream openStream() { return TestToolUtils.getDataAsStream(cachedSource); } }; diff --git a/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java b/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java index 494ccf8ec4..2ee8419f8f 100644 --- a/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java +++ b/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java @@ -89,7 +89,7 @@ final class ProtocolSessionPromise> extends Default } @Override - public void operationComplete(final ChannelFuture cf) throws Exception { + public void operationComplete(final ChannelFuture cf) { synchronized (lock) { LOG.debug("Promise {} connection resolved", lock); diff --git a/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java b/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java index 87313f4e4c..a0728514ed 100644 --- a/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java +++ b/protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java @@ -91,7 +91,7 @@ final class ReconnectPromise, L extends SessionList } @Override - public void channelInactive(final ChannelHandlerContext ctx) throws Exception { + public void channelInactive(final ChannelHandlerContext ctx) { // This is the ultimate channel inactive handler, not forwarding if (promise.isCancelled()) { return; diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java index e45ed6e793..707e397a4c 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java @@ -7,7 +7,6 @@ */ package org.opendaylight.netconf.md.sal.rest.schema; -import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; @@ -40,8 +39,8 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, - final MultivaluedMap httpHeaders, final OutputStream entityStream) throws IOException, - WebApplicationException { + final MultivaluedMap httpHeaders, final OutputStream entityStream) throws + WebApplicationException { try { YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream); } catch (final XMLStreamException e) { diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java index f90997354b..8507871483 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java @@ -75,8 +75,8 @@ public class JsonNormalizedNodeBodyReader @Override public NormalizedNodeContext readFrom(final Class type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, - final MultivaluedMap httpHeaders, final InputStream entityStream) throws IOException, - WebApplicationException { + final MultivaluedMap httpHeaders, final InputStream entityStream) throws + WebApplicationException { try { return readFrom(getInstanceIdentifierContext(), entityStream, isPost()); } catch (final Exception e) { diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPatchBodyReader.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPatchBodyReader.java index 53cc16f8d3..852e303349 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPatchBodyReader.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPatchBodyReader.java @@ -83,7 +83,7 @@ public class JsonToPatchBodyReader extends AbstractIdentifierAwareJaxRsProvider public PatchContext readFrom(final Class type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap httpHeaders, final InputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { return readFrom(getInstanceIdentifierContext(), entityStream); } catch (final Exception e) { diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java index c1ca200d13..13ceb2e63c 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java @@ -8,7 +8,6 @@ package org.opendaylight.netconf.sal.rest.impl; -import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; @@ -57,7 +56,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter public void writeTo(final PatchStatusContext patchStatusContext, final Class type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap httpHeaders, final OutputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { final XMLStreamWriter xmlWriter = @@ -71,7 +70,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter } private static void writeDocument(final XMLStreamWriter writer, final PatchStatusContext context) - throws XMLStreamException, IOException { + throws XMLStreamException { writer.writeStartElement("", "yang-patch-status", "urn:ietf:params:xml:ns:yang:ietf-yang-patch"); writer.writeStartElement("patch-id"); writer.writeCharacters(context.getPatchId()); @@ -107,7 +106,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter } private static void reportErrors(final List errors, final XMLStreamWriter writer) - throws IOException, XMLStreamException { + throws XMLStreamException { writer.writeStartElement("errors"); for (final RestconfError restconfError : errors) { diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java index 510a6cf344..59b7a0f482 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java @@ -86,8 +86,8 @@ public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPro @Override public NormalizedNodeContext readFrom(final Class type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, - final MultivaluedMap httpHeaders, final InputStream entityStream) throws IOException, - WebApplicationException { + final MultivaluedMap httpHeaders, final InputStream entityStream) throws + WebApplicationException { try { return readFrom(entityStream); } catch (final RestconfDocumentedException e) { diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPatchBodyReader.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPatchBodyReader.java index 071f8bda59..4f88e14d5c 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPatchBodyReader.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPatchBodyReader.java @@ -95,7 +95,7 @@ public class XmlToPatchBodyReader extends AbstractIdentifierAwareJaxRsProvider i public PatchContext readFrom(final Class type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap httpHeaders, final InputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { final InstanceIdentifierContext path = getInstanceIdentifierContext(); diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java index 55ea16db73..877deda59f 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java @@ -50,7 +50,7 @@ abstract class AbstractCommonSubscriber extends AbstractQueryParams implements B } @Override - public final void close() throws Exception { + public final void close() { this.registration.close(); this.registration = null; unregister(); diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerHandler.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerHandler.java index a11d7bf803..aa56910523 100755 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerHandler.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerHandler.java @@ -34,7 +34,6 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame; import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker; import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory; import io.netty.util.CharsetUtil; -import java.io.IOException; import java.util.List; import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl; import org.opendaylight.netconf.sal.streams.listeners.ListenerAdapter; @@ -54,7 +53,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler private WebSocketServerHandshaker handshaker; @Override - protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception { + protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) { if (msg instanceof FullHttpRequest) { handleHttpRequest(ctx, (FullHttpRequest) msg); } else if (msg instanceof WebSocketFrame) { @@ -70,7 +69,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler * @param req * FullHttpRequest */ - private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception { + private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) { // Handle a bad request. if (!req.getDecoderResult().isSuccess()) { sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST)); @@ -154,7 +153,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler * @param frame * {@link WebSocketFrame} */ - private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) throws IOException { + private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) { if (frame instanceof CloseWebSocketFrame) { this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain()); final String streamName = Notificator.createStreamNameFromUri(((CloseWebSocketFrame) frame).reasonText()); @@ -182,7 +181,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler } @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { ctx.close(); } diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerInitializer.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerInitializer.java index c13535bf19..365e982c49 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerInitializer.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerInitializer.java @@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpServerCodec; public class WebSocketServerInitializer extends ChannelInitializer { @Override - protected void initChannel(final SocketChannel ch) throws Exception { + protected void initChannel(final SocketChannel ch) { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast("codec-http", new HttpServerCodec()); pipeline.addLast("aggregator", new HttpObjectAggregator(65536)); diff --git a/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java b/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java index b6289b4009..8c02127364 100644 --- a/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java +++ b/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java @@ -15,7 +15,6 @@ import static org.junit.Assert.fail; import java.io.File; import java.io.FileNotFoundException; -import java.io.IOException; import java.io.InputStream; import java.util.Collection; import javax.ws.rs.WebApplicationException; @@ -280,7 +279,7 @@ public class JsonToNnTest extends AbstractBodyReaderTest { try { normalizedNodeContext = this.jsonBodyReader.readFrom(null, null, null, this.mediaType, null, inputStream); - } catch (WebApplicationException | IOException e) { + } catch (WebApplicationException e) { // TODO Auto-generated catch block } diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonNormalizedNodeBodyReader.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonNormalizedNodeBodyReader.java index 37a39b62d9..a8c79f3560 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonNormalizedNodeBodyReader.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonNormalizedNodeBodyReader.java @@ -9,7 +9,6 @@ package org.opendaylight.restconf.nb.rfc8040.jersey.providers; import com.google.common.collect.Iterables; import com.google.gson.stream.JsonReader; -import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; @@ -62,7 +61,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyRead @SuppressWarnings("checkstyle:IllegalCatch") @Override protected NormalizedNodeContext readBody(final InstanceIdentifierContext path, final InputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { return readFrom(path, entityStream, isPost()); } catch (final Exception e) { @@ -72,8 +71,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyRead } public static NormalizedNodeContext readFrom( - final InstanceIdentifierContext path, final InputStream entityStream, final boolean isPost) - throws IOException { + final InstanceIdentifierContext path, final InputStream entityStream, final boolean isPost) { final NormalizedNodeResult resultHolder = new NormalizedNodeResult(); final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder); diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyReader.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyReader.java index 62fd33a51f..debebb9d31 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyReader.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyReader.java @@ -73,7 +73,7 @@ public class XmlNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyReade @SuppressWarnings("checkstyle:IllegalCatch") @Override protected NormalizedNodeContext readBody(final InstanceIdentifierContext path, final InputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { final Document doc = UntrustedXML.newDocumentBuilder().parse(entityStream); return parse(path,doc); diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonToPatchBodyReader.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonToPatchBodyReader.java index 232a9a7c03..2b39c8a0d5 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonToPatchBodyReader.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonToPatchBodyReader.java @@ -66,7 +66,7 @@ public class JsonToPatchBodyReader extends AbstractToPatchBodyReader { @SuppressWarnings("checkstyle:IllegalCatch") @Override protected PatchContext readBody(final InstanceIdentifierContext path, final InputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { return readFrom(path, entityStream); } catch (final Exception e) { diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java index e80dd14a16..d7d264fdab 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java @@ -8,7 +8,6 @@ package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch; -import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; @@ -57,7 +56,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter public void writeTo(final PatchStatusContext patchStatusContext, final Class type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap httpHeaders, final OutputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { final XMLStreamWriter xmlWriter = @@ -71,7 +70,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter } private static void writeDocument(final XMLStreamWriter writer, final PatchStatusContext context) - throws XMLStreamException, IOException { + throws XMLStreamException { writer.writeStartElement("", "yang-patch-status", "urn:ietf:params:xml:ns:yang:ietf-yang-patch"); writer.writeStartElement("patch-id"); writer.writeCharacters(context.getPatchId()); @@ -107,7 +106,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter } private static void reportErrors(final List errors, final XMLStreamWriter writer) - throws IOException, XMLStreamException { + throws XMLStreamException { writer.writeStartElement("errors"); for (final RestconfError restconfError : errors) { diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlToPatchBodyReader.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlToPatchBodyReader.java index 8364572de4..bf452ec49f 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlToPatchBodyReader.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlToPatchBodyReader.java @@ -76,7 +76,7 @@ public class XmlToPatchBodyReader extends AbstractToPatchBodyReader { @SuppressWarnings("checkstyle:IllegalCatch") @Override protected PatchContext readBody(final InstanceIdentifierContext path, final InputStream entityStream) - throws IOException, WebApplicationException { + throws WebApplicationException { try { final Document doc = UntrustedXML.newDocumentBuilder().parse(entityStream); return parse(path, doc); diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYinBodyWriter.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYinBodyWriter.java index 0cd7e327b0..baae974370 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYinBodyWriter.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYinBodyWriter.java @@ -7,7 +7,6 @@ */ package org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema; -import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; @@ -42,8 +41,8 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, - final MultivaluedMap httpHeaders, final OutputStream entityStream) throws IOException, - WebApplicationException { + final MultivaluedMap httpHeaders, final OutputStream entityStream) throws + WebApplicationException { try { YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream); } catch (final XMLStreamException e) { diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java index f516e5f1d4..c77fa97ae2 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java @@ -81,7 +81,7 @@ public abstract class AbstractIdentifierAwareJaxRsProvider implements Message protected abstract T emptyBody(InstanceIdentifierContext path); protected abstract T readBody(InstanceIdentifierContext path, InputStream entityStream) - throws IOException, WebApplicationException; + throws WebApplicationException; private String getIdentifier() { diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java index 5efca62de7..3e31ea6d5f 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java @@ -225,12 +225,7 @@ public class JSONRestconfServiceRfc8040Impl implements JSONRestconfService, Auto } final InputStream entityStream = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8)); - try { - return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost); - } catch (final IOException e) { - propagateExceptionAs(uriPath, e, "GET"); - return null; - } + return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost); } private String toJson(final PatchStatusContext patchStatusContext) throws IOException { diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerHandler.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerHandler.java index fce83008d5..55aacdaee8 100755 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerHandler.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerHandler.java @@ -34,7 +34,6 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame; import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker; import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory; import io.netty.util.CharsetUtil; -import java.io.IOException; import java.util.List; import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenerAdapter; import org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationListenerAdapter; @@ -54,7 +53,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler private WebSocketServerHandshaker handshaker; @Override - protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception { + protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) { if (msg instanceof FullHttpRequest) { handleHttpRequest(ctx, (FullHttpRequest) msg); } else if (msg instanceof WebSocketFrame) { @@ -70,7 +69,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler * @param req * FullHttpRequest */ - private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception { + private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) { // Handle a bad request. if (!req.getDecoderResult().isSuccess()) { sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST)); @@ -154,7 +153,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler * @param frame * {@link WebSocketFrame} */ - private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) throws IOException { + private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) { if (frame instanceof CloseWebSocketFrame) { this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain()); final String streamName = Notificator.createStreamNameFromUri(((CloseWebSocketFrame) frame).reasonText()); @@ -181,7 +180,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler } @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { ctx.close(); } diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerInitializer.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerInitializer.java index 2c768d83a5..5ab8639b21 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerInitializer.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerInitializer.java @@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpServerCodec; public class WebSocketServerInitializer extends ChannelInitializer { @Override - protected void initChannel(final SocketChannel ch) throws Exception { + protected void initChannel(final SocketChannel ch) { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast("codec-http", new HttpServerCodec()); pipeline.addLast("aggregator", new HttpObjectAggregator(65536)); -- 2.36.6