From 3a8451977cc2092b0b998573dc0b27243fdcc137 Mon Sep 17 00:00:00 2001 From: ajay priyadarshi Date: Tue, 20 Mar 2018 10:36:16 +0530 Subject: [PATCH] sonar fix:Exception handling in emsdriver collector/TaskThread.java file name: MessageUtil.java Change-Id: I6f5700f731f62ef34fb33f9107564293a0e91d54 Issue-ID: VFC-829 Signed-off-by: ajay priyadarshi --- .../main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java | 6 +++--- .../org/onap/vfc/nfvo/emsdriver/collector/alarm/MessageUtil.java | 4 ++-- 2 files changed, 5 insertions(+), 5 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 da48829..94d9c56 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 @@ -43,7 +43,7 @@ import java.util.regex.Pattern; public class TaskThread implements Runnable { private static final Log log = LogFactory.getLog(TaskThread.class); - private MessageChannel pmResultChannel; //This should also be private. Need to change in TastThreadTest + private MessageChannel pmResultChannel; private MessageChannel cmResultChannel; private CollectMsg data; @@ -929,7 +929,7 @@ public class TaskThread implements Runnable { return pmResultChannel; } - public void setPmResultChannel(MessageChannel pmResultChannel) { - this.pmResultChannel = pmResultChannel; + public void setPmResultChannel(MessageChannel pmResChannel) { + this.pmResultChannel = pmResChannel; } } diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/MessageUtil.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/MessageUtil.java index eede19b..d7a4dd8 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/MessageUtil.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/MessageUtil.java @@ -77,7 +77,7 @@ public class MessageUtil { dis.readFully(inputB); short startSign = ois.readShort(); if (startSign != Msg.StartSign) { - throw new Exception("start sign is [" + Msg.StartSign + throw new IOException("start sign is [" + Msg.StartSign + "],not is [" + startSign + "]"); } int msgType = ois.readByte(); @@ -86,7 +86,7 @@ public class MessageUtil { msg.setTimeStamp(timeStamp); int bodylength = ois.readShort(); msg.setLenOfBody(bodylength); - byte b[] = new byte[bodylength]; + byte[] b = new byte[bodylength]; dis.readFully(b); msg.newBodyfromBytes(b); } catch (Exception e) { -- 2.16.6