diff options
author | ajay priyadarshi <ajay.priyadarshi@ril.com> | 2018-03-12 14:07:08 +0530 |
---|---|---|
committer | ajay priyadarshi <ajay.priyadarshi@ril.com> | 2018-03-12 14:07:08 +0530 |
commit | 8c60fa280b2285ffe0f6bad31840214d8bdc73be (patch) | |
tree | 8bfdbef48aab18eb64b763810546e49fd4542eda | |
parent | cb7a423774b9906b5e63794606ba6bee1f20a588 (diff) |
sonar fix: Multiple duplicate issues
boco/src/main/java/org/onap/vfc/nfvo/emsdriver
file name: TaskThread.java,TaskThreadService.java ...
Change-Id: I2e0a0bca52874636f3a619c4cc78b08720e883fc
Issue-ID: VFC-798
Signed-off-by: ajay priyadarshi <ajay.priyadarshi@ril.com>
8 files changed, 14 insertions, 12 deletions
diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java index 19bf284..c4f7b1f 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java @@ -266,7 +266,7 @@ public class TaskThread implements Runnable { try { pmResultChannel.put(pmDatas); - } catch (InterruptedException e) { + } catch (Exception e) { pmResultChannel.clear(); log.error("collectResultChannel.put(resultMap) error ", e); } @@ -360,7 +360,7 @@ public class TaskThread implements Runnable { HashMap<String, String> resultMap = this.resultMap(columnNames, valuelist); try { pmResultChannel.put(resultMap); - } catch (InterruptedException e) { + } catch (Exception e) { pmResultChannel.clear(); log.error("collectResultChannel.put(resultMap) error ", e); } diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java index 848de63..1b8963f 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java @@ -75,7 +75,7 @@ public class TaskThreadService extends Thread { public CollectMsg receive() { try { return queue.poll(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { + } catch (Exception e) { log.error("queue.poll is error" + StringUtil.getStackTrace(e)); } return null; @@ -85,7 +85,7 @@ public class TaskThreadService extends Thread { public void add(CollectMsg data) { try { queue.put(data); - } catch (InterruptedException e) { + } catch (Exception e) { log.error("queue.put is error" + StringUtil.getStackTrace(e)); } } diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java index 2773613..0f5b2a3 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java @@ -40,7 +40,8 @@ public class AlarmManager extends DriverThread { try { Thread.sleep(1000); log.debug("The configuration properties from " + ConfigurationManager.CONFIG_PROPERTIES_LOCATION + " is not load"); - } catch (InterruptedException e) { + } catch (Exception e) { + log.error("Exception",e); } } } diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/Msg.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/Msg.java index 6ba9604..5cfd0cb 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/Msg.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/Msg.java @@ -29,7 +29,7 @@ public class Msg { public final static String syncAlarmMessageByalarmSeq = "reqSyncAlarmFile;reqID=%s;alarmSeq=%s;syncSource=1"; public final static String syncActiveAlarmFileMsg = "reqSyncAlarmFile;reqID=%s;startTime=%s;endTime=%s;syncSource=0"; public final static String syncAlarmFileMsg = "reqSyncAlarmFile;reqID=%s;startTime=%s;endTime=%s;syncSource=1"; - public static short StartSign = (short) 0xffff; + public final static short StartSign = (short) 0xffff; private MsgType msgType; private int timeStamp = 0; private int lenOfBody = 0; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java index 1b59022..d17bccb 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java @@ -65,8 +65,8 @@ public abstract class DriverThread implements Runnable { while (!isEnd()) { try { Thread.sleep(1); - } catch (InterruptedException e) { - log.error("InterruptedException :" + StringUtil.getStackTrace(e)); + } catch (Exception e) { + log.error("Exception :", e); } } return end; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java index feb6679..ca42866 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java @@ -124,7 +124,7 @@ public class NorthMessageMgr extends DriverThread { AgentMain.evel_post_event(header); log.info("HeatBeat send!"); try { - Thread.sleep(60 * 1000); + Thread.sleep(60000);//60 secs } catch (Exception e) { // e.printStackTrace(); log.error("Unable to sleep the HB thread ", e); diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectManager.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectManager.java index ee0368f..8515dc7 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectManager.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectManager.java @@ -39,8 +39,9 @@ public class CollectManager extends DriverThread { if (emsInfos.size() == 0) { try { Thread.sleep(1000); - } catch (InterruptedException e) { - } + } catch (Exception e) { + log.error("Sleep interrupted",e); + } } } diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java index 71ceb63..9a27750 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java @@ -44,7 +44,7 @@ public class CollectOderJob implements Job { try { collectChannel.put(collectMsg); - } catch (InterruptedException e) { + } catch (Exception e) { log.error("collectChannel.put is error ", e); } } else { |