Remove superfluous throws 68/104768/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 6 Mar 2023 10:13:32 +0000 (11:13 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 6 Mar 2023 10:14:19 +0000 (11:14 +0100)
We are only closing a Registration, really. Make sure we preserve that
contract to remove the need to throw Exceptions.

Change-Id: I1e106c857c3adab572d09ef925a3c74d50247be6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/peer-acceptor/src/main/java/org/opendaylight/protocol/bgp/peer/acceptor/BGPPeerAcceptorImpl.java

index 837fbefb05ca4c227b64e5c967f7d3201c3745c2..967e0ef0d83675a8c587accc8e8484475203f388 100644 (file)
@@ -28,6 +28,7 @@ import org.opendaylight.protocol.bgp.rib.impl.spi.PeerRegistryListener;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,7 +38,7 @@ public final class BGPPeerAcceptorImpl implements AutoCloseable {
     private final BGPDispatcher bgpDispatcher;
     private final InetSocketAddress address;
     private ChannelFuture futureChannel;
-    private AutoCloseable listenerRegistration;
+    private Registration listenerRegistration;
 
     public BGPPeerAcceptorImpl(final IpAddressNoZone bindingAddress, final PortNumber portNumber,
             final BGPDispatcher bgpDispatcher) {
@@ -78,11 +79,11 @@ public final class BGPPeerAcceptorImpl implements AutoCloseable {
     }
 
     /**
-     * This closes the acceptor and no new bgp connections will be accepted
-     * Connections already established will be preserved.
-     **/
+     * This closes the acceptor and no new bgp connections will be accepted. Connections already established will be
+     * preserved.
+     */
     @Override
-    public void close() throws Exception {
+    public void close() {
         futureChannel.cancel(true);
         futureChannel.channel().close();
         if (listenerRegistration != null) {