Sonar issue fix: generic exception 75/24375/1
authorIveta Halanova <iveta.halanova@pantheon.sk>
Wed, 22 Jul 2015 06:09:07 +0000 (08:09 +0200)
committerIveta Halanova <iveta.halanova@pantheon.sk>
Wed, 22 Jul 2015 06:09:07 +0000 (08:09 +0200)
Change-Id: I4a10483dce22fe1bc8817f849ef0a39223fd0307
Signed-off-by: Iveta Halanova <iveta.halanova@pantheon.sk>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java

index 01dd5673df3d892f10f36f561568c7c097888309..f9a525a246c3fdeddb6b9b40f220d896374d3da5 100644 (file)
@@ -412,25 +412,25 @@ public class BGPSessionImpl extends SimpleChannelInboundHandler<Notification> im
     }
 
     @Override
-    public final void channelInactive(ChannelHandlerContext ctx) {
+    public final void channelInactive(final ChannelHandlerContext ctx) {
         LOG.debug("Channel {} inactive.", ctx.channel());
         this.endOfInput();
 
         try {
             super.channelInactive(ctx);
-        } catch (Exception e) {
-            throw new RuntimeException("Failed to delegate channel inactive event on channel " + ctx.channel(), e);
+        } catch (final Exception e) {
+            throw new IllegalStateException("Failed to delegate channel inactive event on channel " + ctx.channel(), e);
         }
     }
 
     @Override
-    protected final void channelRead0(ChannelHandlerContext ctx, Notification msg) {
+    protected final void channelRead0(final ChannelHandlerContext ctx, final Notification msg) {
         LOG.debug("Message was received: {}", msg);
         this.handleMessage(msg);
     }
 
     @Override
-    public final void handlerAdded(ChannelHandlerContext ctx) {
+    public final void handlerAdded(final ChannelHandlerContext ctx) {
         this.sessionUp();
     }
 }
index f415d15a6bab0d50ae2b0559cef8c4aecdb375df..c68cbf316f40c138b1e35128d8fd2f58dd22779a 100644 (file)
@@ -394,8 +394,8 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
 
         try {
             super.channelInactive(ctx);
-        } catch (Exception e) {
-            throw new RuntimeException("Failed to delegate channel inactive event on channel " + ctx.channel(), e);
+        } catch (final Exception e) {
+            throw new IllegalStateException("Failed to delegate channel inactive event on channel " + ctx.channel(), e);
         }
     }