Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2017-06-21 17:57:02 +0000
committerjmisinco2017-06-21 17:57:02 +0000
commitc618be325a737bbbf9eec46836ec62e33dc41414 (patch)
tree1694742c01a9f87b2277e64d0f8d11869c0926c8
parent4fb9ea85f786d747ba8344a84e5437f2b64872a5 (diff)
downloadorg.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
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/endpoint/OteEndpointSendRunnable.java27
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) {

Back to the top