summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajay priyadarshi <ajay.priyadarshi@ril.com>2018-02-23 15:13:18 +0530
committerajay priyadarshi <ajay.priyadarshi@ril.com>2018-03-08 12:36:47 +0530
commitd70c6ad9da81011b3c8fdc4a177f0094ff5967f8 (patch)
tree69939ef855098805f63f84cbebcac02fd8bf3c40
parenta113c7672ce0316c7bd19890a457a457fd50e4c8 (diff)
sonar fix: Exception handling in SfcDriverUtil
sfc/utils/SfcDriverUtil.java file name: SfcDriverUtil.java Change-Id: Ifacb86d014eca1bc5be56f88789814148e0e7a21 Issue-ID: VFC-776 Signed-off-by: ajay priyadarshi <ajay.priyadarshi@ril.com>
-rw-r--r--zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java b/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java
index 2b53a53..30cc766 100644
--- a/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java
+++ b/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java
@@ -28,9 +28,11 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class SfcDriverUtil {
-
+ public static Log log = LogFactory.getLog(SfcDriverUtil.class);
public static String generateUuid() {
return UUID.randomUUID().toString();
@@ -95,9 +97,10 @@ public class SfcDriverUtil {
{
try {
InetAddress addr = InetAddress.getLocalHost();
- return addr.getHostAddress().toString();
+ return addr.getHostAddress();
} catch (UnknownHostException e) {
- e.printStackTrace();
+ //e.printStackTrace();
+ log.error("getLocalIp StackTrace:", e);
}
return "";
}