From 253ac5197db3f0fdd158454414a7a78138bb362f Mon Sep 17 00:00:00 2001 From: Isaac Manuel Raj Date: Fri, 9 Aug 2019 17:15:13 +0530 Subject: Usecaseui server sonar critical issue fix. 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 Change-Id: I4631e5403c6bcc4bf7bb23ad18a011b856d89556 --- .../server/service/impl/PerformanceInformationServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/onap/usecaseui/server/service/impl/PerformanceInformationServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/impl/PerformanceInformationServiceImpl.java index 64ab23f4..e2bc3d43 100755 --- a/server/src/main/java/org/onap/usecaseui/server/service/impl/PerformanceInformationServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/impl/PerformanceInformationServiceImpl.java @@ -25,6 +25,7 @@ import java.util.Map; import javax.transaction.Transactional; +import com.google.common.base.Throwables; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; @@ -99,7 +100,7 @@ public class PerformanceInformationServiceImpl implements PerformanceInformation list = query.setParameterList("alist", id).list(); return list; } catch (Exception e) { - e.printStackTrace(); + logger.error("exception occurred while performing PerformanceInformationServiceImpl queryId. Details:" + Throwables.getStackTraceAsString(e)); logger.error("exception occurred while performing PerformanceInformationServiceImpl queryId. Details:" + e.getMessage()); return null; } @@ -206,7 +207,7 @@ public class PerformanceInformationServiceImpl implements PerformanceInformation String num=(String) query.uniqueResult(); return UuiCommonUtil.isNotNullOrEmpty(num)?num:0+""; } catch (Exception e) { - e.printStackTrace(); + logger.error("exception occurred while performing PerformanceInformationServiceImpl queryMaxValueByBetweenDate. Details:" + Throwables.getStackTraceAsString(e)); logger.error("exception occurred while performing PerformanceInformationServiceImpl queryMaxValueByBetweenDate. Details:" + e.getMessage()); return 0+""; } -- cgit