BUG-731: do not declare Exception 94/6194/1
authorRobert Varga <rovarga@cisco.com>
Tue, 15 Apr 2014 07:02:50 +0000 (09:02 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 15 Apr 2014 07:23:11 +0000 (09:23 +0200)
These exceptions are specified by the super method. We have no use for
them, so follow sonar and remove them.

Change-Id: I67ad3d5764e92eba337da5ca0ab58d4bb5dbd215
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPMessageToByteEncoder.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/AbstractPCEPSessionNegotiatorFactory.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPTopologyProvider.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/PCEPTunnelTopologyProvider.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImpl.java

index 330ad5f68103b2eb9711c303de22d9904bfcc7ce..bb2b5e563745e4eba38611daa13675b148b98206 100644 (file)
@@ -33,7 +33,7 @@ final class BGPMessageToByteEncoder extends MessageToByteEncoder<Notification> {
        }
 
        @Override
-       protected void encode(final ChannelHandlerContext ctx, final Notification msg, final ByteBuf out) throws Exception {
+       protected void encode(final ChannelHandlerContext ctx, final Notification msg, final ByteBuf out) {
                LOG.trace("Encoding message: {}", msg);
                final byte[] bytes = this.registry.serializeMessage(msg);
                LOG.trace("Encoded message: {}", ByteArray.bytesToHexString(bytes));
index afe3fd68af388cca515bf018f2e645653b5cba19..4dd5820f44f8e14e000d936ffdbd20bdd600e1af 100644 (file)
@@ -140,14 +140,14 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                        this.stateTimer.newTimeout(new TimerTask() {
 
                                @Override
-                               public void run(final Timeout timeout) throws Exception {
+                               public void run(final Timeout timeout) {
                                        handleHoldTimer();
                                }
                        }, this.holdTimerValue, TimeUnit.SECONDS);
 
                        this.stateTimer.newTimeout(new TimerTask() {
                                @Override
-                               public void run(final Timeout timeout) throws Exception {
+                               public void run(final Timeout timeout) {
                                        handleKeepaliveTimer();
                                }
                        }, this.keepAlive, TimeUnit.SECONDS);
@@ -167,7 +167,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
 
        /**
         * Handles incoming message based on their type.
-        * 
+        *
         * @param msg incoming message
         */
        @Override
@@ -225,7 +225,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
        /**
         * Closes PCEP session from the parent with given reason. A message needs to be sent, but parent doesn't have to be
         * modified, because he initiated the closing. (To prevent concurrent modification exception).
-        * 
+        *
         * @param closeObject
         */
        private void terminate(final BGPError error) {
@@ -255,7 +255,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                } else {
                        this.stateTimer.newTimeout(new TimerTask() {
                                @Override
-                               public void run(final Timeout timeout) throws Exception {
+                               public void run(final Timeout timeout) {
                                        handleHoldTimer();
                                }
                        }, nextHold - ct, TimeUnit.NANOSECONDS);
@@ -282,7 +282,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                }
                this.stateTimer.newTimeout(new TimerTask() {
                        @Override
-                       public void run(final Timeout timeout) throws Exception {
+                       public void run(final Timeout timeout) {
                                handleKeepaliveTimer();
                        }
                }, nextKeepalive - ct, TimeUnit.NANOSECONDS);
index a5236e6032d78334a4e7162d6e283b3d2153bc13..e616d3c2f6cc7c6d21d3da84a823462efe18a991 100644 (file)
@@ -106,7 +106,7 @@ public final class BGPSessionNegotiator extends AbstractSessionNegotiator<Notifi
                final Object lock = this;
                this.timer.newTimeout(new TimerTask() {
                        @Override
-                       public void run(final Timeout timeout) throws Exception {
+                       public void run(final Timeout timeout) {
                                synchronized (lock) {
                                        if (BGPSessionNegotiator.this.state != State.Finished) {
                                                BGPSessionNegotiator.this.sendMessage(buildErrorNotify(BGPError.HOLD_TIMER_EXPIRED));
index 3b4933299bdbcb472f6727c90f7130503e93785f..c5ba2cf0dd86ded1b271f82555198a2901bd6888 100644 (file)
@@ -75,7 +75,7 @@ SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> {
 
        /**
         * Create a new negotiator. This method needs to be implemented by subclasses to actually provide a negotiator.
-        * 
+        *
         * @param promise Session promise to be completed by the negotiator
         * @param channel Associated channel
         * @param sessionId Session ID assigned to the resulting session
@@ -145,7 +145,7 @@ SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> {
 
                                        this.channel.closeFuture().addListener(new ChannelFutureListener() {
                                                @Override
-                                               public void operationComplete(final ChannelFuture future) throws Exception {
+                                               public void operationComplete(final ChannelFuture future) {
                                                        synchronized (lock) {
                                                                AbstractPCEPSessionNegotiatorFactory.this.sessions.inverse().remove(this);
                                                        }
@@ -159,7 +159,7 @@ SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> {
                        }
 
                        @Override
-                       protected void handleMessage(final Message msg) throws Exception {
+                       protected void handleMessage(final Message msg) {
                                throw new IllegalStateException("Bootstrap negotiator should have been replaced");
                        }
                };
@@ -169,7 +169,7 @@ SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> {
        private Short nextSession(final byte[] clientAddress) throws ExecutionException {
                final PeerRecord peer = formerClients.get(clientAddress, new Callable<PeerRecord>() {
                        @Override
-                       public PeerRecord call() throws Exception {
+                       public PeerRecord call() {
                                return new PeerRecord(ID_CACHE_SECONDS, null);
                        }
                });
index 8bfa59c80018d3085e59b1c640c96cd042ddeeef..41fb5be47b7bdf484ccac8b98ae82f10b04587de 100644 (file)
@@ -117,7 +117,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
                if (getDeadTimerValue() != 0) {
                        this.stateTimer.newTimeout(new TimerTask() {
                                @Override
-                               public void run(final Timeout timeout) throws Exception {
+                               public void run(final Timeout timeout) {
                                        handleDeadTimer();
                                }
                        }, getDeadTimerValue(), TimeUnit.SECONDS);
@@ -126,7 +126,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
                if (getKeepAliveTimerValue() != 0) {
                        this.stateTimer.newTimeout(new TimerTask() {
                                @Override
-                               public void run(final Timeout timeout) throws Exception {
+                               public void run(final Timeout timeout) {
                                        handleKeepaliveTimer();
                                }
                        }, getKeepAliveTimerValue(), TimeUnit.SECONDS);
@@ -154,7 +154,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
                        } else {
                                this.stateTimer.newTimeout(new TimerTask() {
                                        @Override
-                                       public void run(final Timeout timeout) throws Exception {
+                                       public void run(final Timeout timeout) {
                                                handleDeadTimer();
                                        }
                                }, nextDead - ct, TimeUnit.NANOSECONDS);
@@ -181,7 +181,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
 
                        this.stateTimer.newTimeout(new TimerTask() {
                                @Override
-                               public void run(final Timeout timeout) throws Exception {
+                               public void run(final Timeout timeout) {
                                        handleKeepaliveTimer();
                                }
                        }, nextKeepalive - ct, TimeUnit.NANOSECONDS);
@@ -190,7 +190,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
 
        /**
         * Sends message to serialization.
-        * 
+        *
         * @param msg to be sent
         */
        @Override
@@ -272,7 +272,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
 
        /**
         * Sends PCEP Error Message with one PCEPError and Open Object.
-        * 
+        *
         * @param value
         * @param open
         */
@@ -285,7 +285,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
         * sent (CAPABILITY_NOT_SUPPORTED) and the method checks if the MAX_UNKNOWN_MSG per minute wasn't overstepped.
         * Second, any other error occurred that is specified by rfc. In this case, the an error message is generated and
         * sent.
-        * 
+        *
         * @param error documented error in RFC5440 or draft
         */
        @VisibleForTesting
@@ -306,7 +306,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
        /**
         * Handles incoming message. If the session is up, it notifies the user. The user is notified about every message
         * except KeepAlive.
-        * 
+        *
         * @param msg incoming message
         */
        @Override
index dcd60582d1d03f1473eb9f3ede1b1a059e76e752..6c063171d2547075b97da557de6b8e7d1f9f91de 100644 (file)
@@ -75,7 +75,7 @@ public final class PCEPTopologyProvider extends DefaultTopologyReference impleme
 
                channel.close().addListener(new ChannelFutureListener() {
                        @Override
-                       public void operationComplete(final ChannelFuture f) throws Exception {
+                       public void operationComplete(final ChannelFuture f) {
                                LOG.debug("Server channel {} closed", f.channel());
 
                                try {
index 6d1f590c109c1a82f82fa03adceef0f11729352f..416a43b93fb9049923a7f92452d9739ed9835ec9 100644 (file)
@@ -44,7 +44,7 @@ public final class PCEPTunnelTopologyProvider implements AutoCloseable {
        }
 
        @Override
-       public void close() throws Exception {
+       public void close() {
                reg.close();
        }
 
index 634534eb36594ba8dad167c1603cc9a982eefce9..eac80d7bf04f66f55558cc5e3847e23fcd7283b4 100644 (file)
@@ -7,15 +7,20 @@
  */
 package org.opendaylight.bgpcep.programming.impl;
 
-import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.SettableFuture;
 import io.netty.util.Timeout;
 import io.netty.util.Timer;
 import io.netty.util.TimerTask;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.TimeUnit;
+
 import org.opendaylight.bgpcep.programming.NanotimeUtil;
 import org.opendaylight.bgpcep.programming.spi.ExecutionResult;
 import org.opendaylight.bgpcep.programming.spi.Instruction;
@@ -53,15 +58,12 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.TimeUnit;
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.SettableFuture;
 
 public final class ProgrammingServiceImpl implements AutoCloseable, InstructionScheduler, ProgrammingService {
        private static final Logger LOG = LoggerFactory.getLogger(ProgrammingServiceImpl.class);
@@ -136,7 +138,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, InstructionS
        public ListenableFuture<RpcResult<CleanInstructionsOutput>> cleanInstructions(final CleanInstructionsInput input) {
                return this.executor.submit(new Callable<RpcResult<CleanInstructionsOutput>>() {
                        @Override
-                       public RpcResult<CleanInstructionsOutput> call() throws Exception {
+                       public RpcResult<CleanInstructionsOutput> call() {
                                return realCleanInstructions(input);
                        }
                });
@@ -261,7 +263,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, InstructionS
                // Schedule a timeout for the instruction
                final Timeout t = this.timer.newTimeout(new TimerTask() {
                        @Override
-                       public void run(final Timeout timeout) throws Exception {
+                       public void run(final Timeout timeout) {
                                timeoutInstruction(input.getId());
                        }
                }, left.longValue(), TimeUnit.NANOSECONDS);