diff options
author | Thomas Nelson <nelson24@att.com> | 2019-01-17 20:40:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-17 20:40:15 +0000 |
commit | 8ab76666562642a25dfab6d9b326976402b9197b (patch) | |
tree | cf60ee22ee0d85b6c9151aeac1c83209b8e8e546 | |
parent | 280b47e062b8d7ca3e381e0db67235376f34b8e9 (diff) | |
parent | 61ae7a6452c7ef1a0348f9fde43cc5391b52146c (diff) |
Merge "fixed sonar issue in RestMusicDataAPI"
-rwxr-xr-x | src/main/java/org/onap/music/rest/RestMusicDataAPI.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java index 592b744b..a8fd1fc2 100755 --- a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java +++ b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java @@ -397,10 +397,9 @@ public class RestMusicDataAPI { if (counter != (fields.size() - 1) ) { - //logger.info("cjc2 field="+entry.getValue()+"counter=" + counter+"fieldsize-1="+(fields.size() -1) + ","); counter = counter + 1; } else { - //logger.info("cjc3 field="+entry.getValue()+"counter=" + counter+"fieldsize="+fields.size() + ","); + if((primaryKey != null) && (partitionKey == null)) { primaryKey.trim(); int count1 = StringUtils.countMatches(primaryKey, ')'); @@ -454,7 +453,7 @@ public class RestMusicDataAPI { else if (clusterKey.isEmpty() ) primaryKey=" (" + partitionKey + ")"; else primaryKey=" (" + partitionKey + ")," + clusterKey; - //if (primaryKey != null) fieldsString.append("" + entry.getKey() + " (" + primaryKey + " )"); + if (primaryKey != null) fieldsString.append(", PRIMARY KEY (" + primaryKey + " )"); } // end of length > 0 @@ -473,7 +472,7 @@ public class RestMusicDataAPI { else if (clusterKey.isEmpty() ) primaryKey=" (" + partitionKey + ")"; else primaryKey=" (" + partitionKey + ")," + clusterKey; - //if (primaryKey != null) fieldsString.append("" + entry.getKey() + " (" + primaryKey + " )"); + if (primaryKey != null) fieldsString.append(", PRIMARY KEY (" + primaryKey + " )"); } fieldsString.append(")"); @@ -515,9 +514,7 @@ public class RestMusicDataAPI { String[] clusterS = arrayClusterOrder[i].trim().split("[ ]+"); if ( (clusterS.length ==2) && (clusterS[1].equalsIgnoreCase("ASC") || clusterS[1].equalsIgnoreCase("DESC"))) continue; else { - //logger.error("createTable/Clustering Order vlaue ERROR: valid clustering order is ASC or DESC or expecting colname order; please correct clusteringOrder:\"+ clusteringOrder+\".\"", " valid clustering order is ASC or DESC; please correct clusteringOrder:"+ clusteringOrder+"."); - // logger.error(EELFLoggerDelegate.errorLogger, "", AppMessages.MISSINGDATA, - // ErrorSeverity.CRITICAL, ErrorTypes.DATAERROR); + return response.status(Status.BAD_REQUEST) .entity(new JsonResponse(ResultType.FAILURE) .setError("createTable/Clustering Order vlaue ERROR: valid clustering order is ASC or DESC or expecting colname order; please correct clusteringOrder:"+ clusteringOrder+".") |