SONAR suggestion - generic exceptions
Replace uses of generic RuntimeException
with more appropriate unchecked exceptions
Change-Id: If283743c2cf7252b8d280bdb788708ebbe57da9d
diff --git a/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasClientController.java b/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasClientController.java
index fccda3e..7c1e01f 100644
--- a/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasClientController.java
+++ b/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasClientController.java
@@ -82,18 +82,13 @@
* Bootstrap netty socket.
*
* @return bootstrap
- * @throws Exception exception
*/
- private Bootstrap createBootstrap() throws Exception {
- try {
- workerGroup = new NioEventLoopGroup();
- return new Bootstrap()
- .group(workerGroup)
- .channel(NioSocketChannel.class)
- .option(ChannelOption.SO_KEEPALIVE, true);
- } catch (Exception e) {
- throw new Exception(e);
- }
+ private Bootstrap createBootstrap() {
+ workerGroup = new NioEventLoopGroup();
+ return new Bootstrap()
+ .group(workerGroup)
+ .channel(NioSocketChannel.class)
+ .option(ChannelOption.SO_KEEPALIVE, true);
}
/**
diff --git a/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasServerController.java b/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasServerController.java
index c27a134..33e30d0 100644
--- a/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasServerController.java
+++ b/apps/artemis/src/main/java/org/onosproject/artemis/impl/moas/MoasServerController.java
@@ -77,22 +77,17 @@
* Create netty server bootstrap.
*
* @return bootstrap
- * @throws Exception exception
*/
- private ServerBootstrap createServerBootStrap() throws Exception {
- try {
- bossGroup = new NioEventLoopGroup();
- workerGroup = new NioEventLoopGroup();
+ private ServerBootstrap createServerBootStrap() {
+ bossGroup = new NioEventLoopGroup();
+ workerGroup = new NioEventLoopGroup();
- return new ServerBootstrap()
- .group(bossGroup, workerGroup)
- .channel(NioServerSocketChannel.class)
- .option(ChannelOption.SO_REUSEADDR, true)
- .childOption(ChannelOption.SO_KEEPALIVE, true)
- .childOption(ChannelOption.TCP_NODELAY, true);
- } catch (Exception e) {
- throw new Exception(e);
- }
+ return new ServerBootstrap()
+ .group(bossGroup, workerGroup)
+ .channel(NioServerSocketChannel.class)
+ .option(ChannelOption.SO_REUSEADDR, true)
+ .childOption(ChannelOption.SO_KEEPALIVE, true)
+ .childOption(ChannelOption.TCP_NODELAY, true);
}
/**