diff options
author | surya-huawei <a.u.surya@huawei.com> | 2017-09-19 11:40:07 +0530 |
---|---|---|
committer | surya-huawei <a.u.surya@huawei.com> | 2017-09-19 11:57:35 +0530 |
commit | 1bd57845776d0f5ffad0425718685019e1ec79c1 (patch) | |
tree | f07841becb648a629a9b8b8bf82f24aad22774ef /oom-app-common/src/main | |
parent | f7129016e4371a587d9ff01d43f83aec206184a2 (diff) |
Fix Sonar Issues
few major issues in dashboard module
In CustomLogginFilter.java
*move string literal to left side of equalsIgnoreCase method
In DashboardRestricedBaseController.java
*Use "Boolean.parseBoolean" for this string-to-boolean conversion
In ECDSingleSignOnController.java
*Replace the type specification in this constructor call with the diamond operator
*Add the "@Override" annotation above this method signature
*Remove unnecessary type casting
Issue-Id: CCSDK-87
Change-Id: I2d588c29c4c57394f7b4a8ffcb20567cbb515919
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
Diffstat (limited to 'oom-app-common/src/main')
3 files changed, 7 insertions, 5 deletions
diff --git a/oom-app-common/src/main/java/org/onap/fusionapp/util/CustomLoggingFilter.java b/oom-app-common/src/main/java/org/onap/fusionapp/util/CustomLoggingFilter.java index 5ae372f..1f08b88 100644 --- a/oom-app-common/src/main/java/org/onap/fusionapp/util/CustomLoggingFilter.java +++ b/oom-app-common/src/main/java/org/onap/fusionapp/util/CustomLoggingFilter.java @@ -44,7 +44,7 @@ public class CustomLoggingFilter extends Filter<ILoggingEvent> { public FilterReply decide(ILoggingEvent event) { try { if ((event.getLevel() != Level.ERROR || event.getLevel() != Level.WARN) - && (event.getThreadName().equalsIgnoreCase("UEBConsumerThread")) + && ("UEBConsumerThread".equalsIgnoreCase(event.getThreadName())) && (event.getLoggerName().contains("com.att.nsa") || event.getLoggerName().contains("org.apache.http"))) { return FilterReply.DENY; diff --git a/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/DashboardRestrictedBaseController.java b/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/DashboardRestrictedBaseController.java index cdf0f0e..622acea 100644 --- a/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/DashboardRestrictedBaseController.java +++ b/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/DashboardRestrictedBaseController.java @@ -182,7 +182,7 @@ public class DashboardRestrictedBaseController extends RestrictedBaseController DashboardProperties.CONTROLLER_SUBKEY_USERNAME); final String pass = appProperties.getControllerProperty(key, DashboardProperties.CONTROLLER_SUBKEY_PASSWORD); - final boolean encr = new Boolean( + final boolean encr = Boolean.parseBoolean ( appProperties.getControllerProperty(key, DashboardProperties.CONTROLLER_SUBKEY_ENCRYPTED)); logger.debug(EELFLoggerDelegate.debugLogger, "getConfiguredControllers: key {} yields url {}", key, url); controllers[i] = new ControllerEndpointCredentials(false, name, url, user, pass, encr); diff --git a/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/ECDSingleSignOnController.java b/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/ECDSingleSignOnController.java index 0e0f096..0c59b2e 100644 --- a/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/ECDSingleSignOnController.java +++ b/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/ECDSingleSignOnController.java @@ -98,8 +98,8 @@ public class ECDSingleSignOnController extends UnRestrictedBaseController { public ModelAndView singleSignOnLogin(HttpServletRequest request, HttpServletResponse response) throws DashboardControllerException, PortalAPIException, UnsupportedEncodingException { - Map<String, String> model = new HashMap<String, String>(); - HashMap<String, String> additionalParamsMap = new HashMap<String, String>(); + Map<String, String> model = new HashMap<>(); + HashMap<String, String> additionalParamsMap = new HashMap<>(); LoginBean commandBean = new LoginBean(); // SessionTimeoutInterceptor sets these parameters @@ -186,7 +186,7 @@ public class ECDSingleSignOnController extends UnRestrictedBaseController { * is the controller for the single_signon.htm page, so the replace should * always find the specified token. */ - returnToAppUrl = ((HttpServletRequest) request).getRequestURL().toString() + returnToAppUrl = request.getRequestURL().toString() .replace("single_signon.htm", forwardURL); logger.debug(EELFLoggerDelegate.debugLogger, "singleSignOnLogin: computed redirectURL {}", returnToAppUrl); @@ -260,10 +260,12 @@ public class ECDSingleSignOnController extends UnRestrictedBaseController { return request.getSession().getId(); } + @Override public String getViewName() { return viewName; } + @Override public void setViewName(String viewName) { this.viewName = viewName; } |