diff options
author | surya-huawei <a.u.surya@huawei.com> | 2017-09-12 11:52:59 +0530 |
---|---|---|
committer | SURYA A U <a.u.surya@huawei.com> | 2017-09-13 09:52:09 +0000 |
commit | 2b433d67493ee2afcce619cc0cf2707ba3152491 (patch) | |
tree | 7b7350f2c06c83b8fa8498fd56e97475e6571832 /filters | |
parent | 98cc3655f6632b4140fd1a419819d3a72ba1add7 (diff) |
Fix Sonar Issues
few major issues in sli/core/filters module
Issue-Id- CCSDK-87
Change-Id: Idbf2b12b866d48161f089271a2403aaee6b8d04f
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
Diffstat (limited to 'filters')
-rw-r--r-- | filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java index 4b14b21df..abbb7c66e 100644 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java +++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java @@ -144,7 +144,7 @@ public class LogFilter implements Filter { String authzHeader = request.getHeader("Authorization"); String usernameAndPassword = new String(Base64.decodeBase64(authzHeader.substring(6).getBytes())); - int userNameIndex = usernameAndPassword.indexOf(":"); + int userNameIndex = usernameAndPassword.indexOf(':'); String username = usernameAndPassword.substring(0, userNameIndex); userName = username; @@ -171,7 +171,7 @@ public class LogFilter implements Filter { MDC.put(END_TIMESTAMP,asIso8601(System.currentTimeMillis())); //MDC.put(REQUEST_ID,"already done above"); MDC.put(SERVICE_NAME,request.getRequestURL().toString()); - int idx = request.getPathInfo().toString().lastIndexOf(":"); + int idx = request.getPathInfo().lastIndexOf(':'); String instance = ""; if ( idx != -1 ) { instance = request.getPathInfo().substring(idx+1); @@ -186,13 +186,13 @@ public class LogFilter implements Filter { MDC.put(STATUS_CODE,"COMPLETE"); } - MDC.put(RESP_CODE,"" + response.getStatus()); + MDC.put(RESP_CODE, Integer.toString(response.getStatus())); MDC.put(RESP_DESC,""); MDC.put(INSTANCE_UUID,""); MDC.put(CATEGORY,""); MDC.put(SEVERITY,""); //MDC.put(SERVER_IP,""); //by chef - MDC.put(ELAPSED_TIME,"" + (System.currentTimeMillis() - startTime)); + MDC.put(ELAPSED_TIME,Long.toString(System.currentTimeMillis() - startTime)); //MDC.put(SERVER_HOST,""); //by chef MDC.put(CLIENT_IP,request.getRemoteHost()); MDC.put(CLASS,""); |