From d70c6ad9da81011b3c8fdc4a177f0094ff5967f8 Mon Sep 17 00:00:00 2001 From: ajay priyadarshi Date: Fri, 23 Feb 2018 15:13:18 +0530 Subject: 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 --- .../src/main/java/org/onap/sfc/utils/SfcDriverUtil.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'zte') 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 ""; } -- cgit 1.2.3-korg