aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorr.bogacki <r.bogacki@samsung.com>2019-02-12 08:44:03 +0100
committerr.bogacki <r.bogacki@samsung.com>2019-02-12 13:51:37 +0100
commit787a713e91001278a5258835aaf063cd36335d1b (patch)
tree5a69422ce84362e392ba821ddd80c7b9f2ca2369
parentdd899213724ceaab3bb141dfb5cbf4eb7b89404a (diff)
Removed sub-expressions from RestMusicDataAPI
Fixed critical Sonar issue related to identical sub-expressions on both sides of operator. Added more details to error logger. Change-Id: I421c4ac3894c08b6b174fdaeb6e68be50e024e63 Issue-ID: MUSIC-328 Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicDataAPI.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
index 507bcd40..0010ed1a 100755
--- a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright (c) 2017 AT&T Intellectual Property
* ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -404,9 +406,10 @@ public class RestMusicDataAPI {
@ApiParam(value = "Table Name",required = true) @PathParam("tablename") String tablename) throws Exception {
try {
ResponseBuilder response = MusicUtil.buildVersionResponse(VERSION, minorVersion, patchVersion);
- if((keyspace == null || keyspace == null) || (tablename.isEmpty() || tablename.isEmpty())){
+ if(keyspace == null || keyspace.isEmpty() || tablename == null || tablename.isEmpty()){
return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
- .setError("one or more path parameters are not set, please check and try again")
+ .setError("One or more path parameters are not set, please check and try again."
+ + "Parameter values: keyspace='" + keyspace + "' tablename='" + tablename + "'")
.toMap()).build();
}
EELFLoggerDelegate.mdcPut("keyspace", "( "+keyspace+" ) ");