fixed sonar issue in RestMusicDataAPI 88/75688/1
authorSandeep J <sandeejh@in.ibm.com>
Fri, 11 Jan 2019 17:16:16 +0000 (22:46 +0530)
committerSandeep J <sandeejh@in.ibm.com>
Fri, 11 Jan 2019 17:16:22 +0000 (22:46 +0530)
fixed sonar issue

Issue-ID: MUSIC-212
Change-Id: I130cf5e79a1f15fddd681d66c28eb4504e48fa5e
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
src/main/java/org/onap/music/rest/RestMusicDataAPI.java

index 592b744..a8fd1fc 100755 (executable)
@@ -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+".")