From 0ebe3fda88f69572f9a8c829a0d8e3b5a76b4238 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 8 Mar 2023 22:42:03 +0100 Subject: Remove unneeded declared exceptions --- src/main/java/com/lumaserv/bgp/BGPServer.java | 17 ++++++----------- src/main/java/com/lumaserv/bgp/BGPSession.java | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/lumaserv/bgp/BGPServer.java b/src/main/java/com/lumaserv/bgp/BGPServer.java index 78ceee8..53f8af7 100644 --- a/src/main/java/com/lumaserv/bgp/BGPServer.java +++ b/src/main/java/com/lumaserv/bgp/BGPServer.java @@ -143,11 +143,11 @@ public class BGPServer implements Runnable { } } - public boolean connect(BGPSessionConfiguration config, String host) throws IOException { + public boolean connect(BGPSessionConfiguration config, String host) { return connect(config, host, 179); } - public boolean connect(BGPSessionConfiguration config, String host, int port) throws IOException { + public boolean connect(BGPSessionConfiguration config, String host, int port) { for (BGPSession session : sessions) { if (session.getConfiguration().equals(config)) { // Already connected @@ -155,15 +155,10 @@ public class BGPServer implements Runnable { } } - try { - BGPSession session = new BGPSession(this, config, host, port); - sessions.add(session); - session.getFsm().getCurrentState().automaticStart(); - return true; - } catch (IOException ex) { - ex.printStackTrace(); - throw(ex); - } + BGPSession session = new BGPSession(this, config, host, port); + sessions.add(session); + session.getFsm().getCurrentState().automaticStart(); + return true; } public void shutdown() { diff --git a/src/main/java/com/lumaserv/bgp/BGPSession.java b/src/main/java/com/lumaserv/bgp/BGPSession.java index d51a83e..dd2b7ff 100644 --- a/src/main/java/com/lumaserv/bgp/BGPSession.java +++ b/src/main/java/com/lumaserv/bgp/BGPSession.java @@ -50,7 +50,7 @@ public class BGPSession implements Runnable { this.port = -1; } - public BGPSession(BGPServer server, BGPSessionConfiguration configuration, String host, int port) throws IOException { + public BGPSession(BGPServer server, BGPSessionConfiguration configuration, String host, int port) { this.server = server; this.configuration = configuration; this.fsm = new BGPFsm(this); -- cgit v1.2.3