Introduced local variable 92/78292/2
authorJegadeesh Babu <jegabab1@in.ibm.com>
Tue, 12 Feb 2019 13:21:08 +0000 (18:51 +0530)
committerJegadeesh Babu <jegabab1@in.ibm.com>
Tue, 12 Feb 2019 13:32:22 +0000 (13:32 +0000)
Introduced local variable instead of using method args

Issue-ID: MUSIC-323
Change-Id: I670c49e2b28ba280d3446868ac042dfdae2b6c16
Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java

index ff77bfd..045abd9 100644 (file)
@@ -254,6 +254,7 @@ public class MusicConditional {
         StringBuilder fieldsString = new StringBuilder("(vector_ts"+",");
         StringBuilder valueString = new StringBuilder("(" + "?" + ",");
         String vector = String.valueOf(Thread.currentThread().getId() + System.currentTimeMillis());
+        String localPrimaryKey;
         queryObject.addValue(vector);
         if(casscadeColumn!=null && casscadeColumnValues!=null) {
             fieldsString.append(casscadeColumn).append(" ,");
@@ -267,8 +268,8 @@ public class MusicConditional {
             fieldsString.append(entry.getKey());
             Object valueObj = entry.getValue();
             if (primaryKeyName.equals(entry.getKey())) {
-                primaryKey = entry.getValue() + "";
-                primaryKey = primaryKey.replace("'", "''");
+              localPrimaryKey = entry.getValue() + "";
+              localPrimaryKey = localPrimaryKey.replace("'", "''");
             }
             DataType colType = null;
             try {