Usecaseui server sonar critical issue fix. 99/93199/1
authorIsaac Manuel Raj <isaac.manuelraj@huawei.com>
Fri, 9 Aug 2019 11:45:13 +0000 (17:15 +0530)
committerIsaac Manuel Raj <isaac.manuelraj@huawei.com>
Fri, 9 Aug 2019 11:45:13 +0000 (17:15 +0530)
Usecase ui code was not having logger to capture the exception trace. The same is fixed.

Issue-ID: USECASEUI-304

Signed-off-by: Isaac Manuel Raj <isaac.manuelraj@huawei.com>
Change-Id: I4631e5403c6bcc4bf7bb23ad18a011b856d89556

server/src/main/java/org/onap/usecaseui/server/service/impl/PerformanceInformationServiceImpl.java

index 64ab23f..e2bc3d4 100755 (executable)
@@ -25,6 +25,7 @@ import java.util.Map;
 \r
 import javax.transaction.Transactional;\r
 \r
+import com.google.common.base.Throwables;\r
 import org.hibernate.Query;\r
 import org.hibernate.Session;\r
 import org.hibernate.SessionFactory;\r
@@ -99,7 +100,7 @@ public class PerformanceInformationServiceImpl implements PerformanceInformation
                        list = query.setParameterList("alist", id).list();\r
                        return list;\r
                } catch (Exception e) {\r
-                       e.printStackTrace();\r
+                       logger.error("exception occurred while performing PerformanceInformationServiceImpl queryId. Details:" + Throwables.getStackTraceAsString(e));\r
                        logger.error("exception occurred while performing PerformanceInformationServiceImpl queryId. Details:" + e.getMessage());\r
                        return null;\r
                }\r
@@ -206,7 +207,7 @@ public class PerformanceInformationServiceImpl implements PerformanceInformation
             String num=(String) query.uniqueResult();\r
             return UuiCommonUtil.isNotNullOrEmpty(num)?num:0+"";\r
         } catch (Exception e) {\r
-            e.printStackTrace();\r
+                       logger.error("exception occurred while performing PerformanceInformationServiceImpl queryMaxValueByBetweenDate. Details:" + Throwables.getStackTraceAsString(e));\r
             logger.error("exception occurred while performing PerformanceInformationServiceImpl queryMaxValueByBetweenDate. Details:" + e.getMessage());\r
             return 0+"";\r
         }\r