diff options
author | jmisinco | 2017-06-21 17:57:02 +0000 |
---|---|---|
committer | jmisinco | 2017-06-21 17:57:02 +0000 |
commit | c618be325a737bbbf9eec46836ec62e33dc41414 (patch) | |
tree | 1694742c01a9f87b2277e64d0f8d11869c0926c8 | |
parent | 4fb9ea85f786d747ba8344a84e5437f2b64872a5 (diff) | |
download | org.eclipse.osee-OTE_07_10_2017.tar.gz org.eclipse.osee-OTE_07_10_2017.tar.xz org.eclipse.osee-OTE_07_10_2017.zip |
refinement[ats_ATS423639]: Remove silent exception catching in Udp EndpointsOTE_07_10_2017
Change-Id: I5398d3e84c5d1c8781fe6b0bd9d0935f890010f5
-rw-r--r-- | plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointSendRunnable.java | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointSendRunnable.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointSendRunnable.java index e3a9260c40c..65d9af4d16c 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointSendRunnable.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointSendRunnable.java @@ -11,6 +11,7 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.logging.Level; +import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.ote.collections.ObjectPool; @@ -74,18 +75,16 @@ final class OteEndpointSendRunnable implements Runnable { if(debug){ OseeLog.log(getClass(), Level.SEVERE, "Error trying to send data", ex); } - closeChannel(threadChannel); + Lib.close(threadChannel); threadChannel = openAndInitializeDatagramChannel(); } catch (ClosedChannelException ex){ if(debug){ OseeLog.log(getClass(), Level.SEVERE, "Error trying to send data", ex); } - closeChannel(threadChannel); + Lib.close(threadChannel); threadChannel = openAndInitializeDatagramChannel(); } catch (IOException ex){ - if(debug){ - OseeLog.log(getClass(), Level.SEVERE, "Error trying to send data", ex); - } + OseeLog.log(getClass(), Level.SEVERE, "Error trying to send data", ex); } finally { int size = dataToSend.size(); for (int i = 0; i < size; i++) { @@ -94,27 +93,13 @@ final class OteEndpointSendRunnable implements Runnable { } } } catch (IOException ex){ - if(debug){ - OseeLog.log(getClass(), Level.SEVERE, "Error opening DatagramChannel. Ending OteEndpointSendRunnable unexpectedly.", ex); - } + OseeLog.log(getClass(), Level.SEVERE, "Error opening DatagramChannel. Ending OteEndpointSendRunnable unexpectedly.", ex); } finally{ - closeChannel(threadChannel); + Lib.close(threadChannel); } } - private void closeChannel(DatagramChannel channel){ - try { - if (channel != null) { - channel.close(); - } - } catch (IOException e) { - if(debug){ - OseeLog.log(getClass(), Level.SEVERE, "Error trying to close channel", e); - } - } - } - private DatagramChannel openAndInitializeDatagramChannel() throws IOException { DatagramChannel channel = DatagramChannel.open(); if (channel.socket().getSendBufferSize() < SEND_BUFFER_SIZE) { |