removed some code smells 83/105483/4
authorRupinder <rupinsi1@in.ibm.com>
Wed, 8 Apr 2020 07:55:54 +0000 (13:25 +0530)
committerRupinderjeet Singh <rupinsi1@in.ibm.com>
Wed, 8 Apr 2020 08:09:26 +0000 (08:09 +0000)
Atmost 1 statement is allowed per line so moved the 2nd statement to
next line

Issue-ID: PORTAL-865
Change-Id: I7f6ba50c2e6b1d8af4f3c1fedc03e00eac16b775
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java

index 29cbca1..6003222 100644 (file)
@@ -995,7 +995,8 @@ public class ChartJSONHelper {
                                                } else if (filter == 1 && (dc.isCreateInNewChart()==null || !dc.isCreateInNewChart().booleanValue())) {
                                                        chartValueCols.add(dc);
                                                }
-                                               else if(filter == 0) chartValueCols.add(dc);
+                                               else if(filter == 0)
+                                                       chartValueCols.add(dc);
                                        } else chartValueCols.add(dc);
                                }
 //                             } else
@@ -1067,113 +1068,138 @@ public class ChartJSONHelper {
                                */
 
                                date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                   if(date!=null) formatFlag = SECFLAG;
+                   if(date!=null)
+                                       formatFlag = SECFLAG;
                    if(date==null) {
                        date = EEEMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYOFTHEWEEKFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYOFTHEWEEKFLAG;
                    }
                    if(date==null) {
                        date = MMDDYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    if(date==null) {
                        //MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
                        date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = HOURFLAG;
+                       if(date!=null)
+                                               formatFlag = HOURFLAG;
                    }            
                    if(date==null) {
                        date = MMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) {
                        date = YYYYMMDDFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) {
                        date = timestampFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    if(date==null) {
                        date = timestampHrFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = HOURFLAG;
+                       if(date!=null)
+                                               formatFlag = HOURFLAG;
                    }
                    if(date==null) {
                        date = timestampDayFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    
                    if(date==null) { 
                        date = MONYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MONTHFLAG;
+                       if(date!=null)
+                                               formatFlag = MONTHFLAG;
                    }
                    if(date==null) { 
                        date = MMYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MONTHFLAG;
+                       if(date!=null)
+                                               formatFlag = MONTHFLAG;
                    }
                    if(date==null) { 
                        date = MMMMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) { 
                        date = MONTHYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MONTHFLAG;
+                       if(date!=null)
+                                               formatFlag = MONTHFLAG;
                    }
                    
                    if(date==null) { 
                        date = YYYYMMDDHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) { 
                        date = YYYYMMDDHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) { 
                        date = DDMONYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) { 
                        date = DDMONYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) { 
                        date = DDMONYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    
                    if(date==null) { 
                        date = MMDDYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) { 
                        date = MMDDYYHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) { 
                        date = MMDDYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    
                    if(date==null) { 
                        date = timestampFormat1.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) {
                        date = MMDDYYYYHHMMZFormat.parse(dateStr, new ParsePosition(0));            
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) {
                        date = YYYYFormat.parse(dateStr, new ParsePosition(0));
                        /* Some random numbers should not satisfy this year format. */
-                       if(dateStr.length()>4) date = null;
-                       if(date!=null) formatFlag = YEARFLAG;
+                       if(dateStr.length()>4)
+                                               date = null;
+                       if(date!=null)
+                                               formatFlag = YEARFLAG;
                    }
                    if(date==null)
                        date = null;
@@ -1230,112 +1256,137 @@ public class ChartJSONHelper {
                                */
 
                                date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                   if(date!=null) formatFlag = SECFLAG;
+                   if(date!=null)
+                                       formatFlag = SECFLAG;
                    if(date==null) {
                        date = EEEMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYOFTHEWEEKFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYOFTHEWEEKFLAG;
                    }
                    if(date==null) {
                        date = MMDDYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    if(date==null) {
                        //MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
                        date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = HOURFLAG;
+                       if(date!=null)
+                                               formatFlag = HOURFLAG;
                    }            
                    if(date==null) {
                        date = MMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) {
                        date = YYYYMMDDFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) {
                        date = timestampFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    if(date==null) {
                        date = timestampHrFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = HOURFLAG;
+                       if(date!=null)
+                                               formatFlag = HOURFLAG;
                    }
                    if(date==null) {
                        date = timestampDayFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) { 
                        date = MONYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MONTHFLAG;
+                       if(date!=null)
+                                               formatFlag = MONTHFLAG;
                    }
                    if(date==null) { 
                        date = MMYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MONTHFLAG;
+                       if(date!=null)
+                                               formatFlag = MONTHFLAG;
                    }
                    if(date==null) { 
                        date = MMMMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    if(date==null) { 
                        date = MONTHYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MONTHFLAG;
+                       if(date!=null)
+                                               formatFlag = MONTHFLAG;
                    }
                    
                    if(date==null) { 
                        date = YYYYMMDDHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) { 
                        date = YYYYMMDDHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) { 
                        date = DDMONYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) { 
                        date = DDMONYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) { 
                        date = DDMONYYYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    
                    if(date==null) { 
                        date = MMDDYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) { 
                        date = MMDDYYHHMMFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) { 
                        date = MMDDYYFormat.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = DAYFLAG;
+                       if(date!=null)
+                                               formatFlag = DAYFLAG;
                    }
                    
                    if(date==null) { 
                        date = timestampFormat1.parse(dateStr, new ParsePosition(0));
-                       if(date!=null) formatFlag = SECFLAG;
+                       if(date!=null)
+                                               formatFlag = SECFLAG;
                    }
                    
                    if(date==null) {
                        date = MMDDYYYYHHMMZFormat.parse(dateStr, new ParsePosition(0));            
-                       if(date!=null) formatFlag = MINFLAG;
+                       if(date!=null)
+                                               formatFlag = MINFLAG;
                    }
                    
                    if(date==null) {
                        date = YYYYFormat.parse(dateStr, new ParsePosition(0));
                        /* Some random numbers should not satisfy this year format. */
-                       if(dateStr.length()>4) date = null;
-                       if(date!=null) formatFlag = YEARFLAG;
+                       if(dateStr.length()>4)
+                                               date = null;
+                       if(date!=null)
+                                               formatFlag = YEARFLAG;
                    }
                    if(date==null)
                        date = null;
@@ -1362,8 +1413,10 @@ public class ChartJSONHelper {
 
        public boolean getBooleanValue(String s, Boolean defaultValue) {
           s = nvl(s);
-          if(s.length()<=0 && defaultValue!=null) return defaultValue.booleanValue();
-          else if(s.length()<=0) return false;
+          if(s.length()<=0 && defaultValue!=null)
+                          return defaultValue.booleanValue();
+          else if(s.length()<=0)
+                          return false;
           else {
           if(s.toUpperCase().startsWith("Y") || s.toLowerCase().equals("true"))
               return true;
@@ -1468,7 +1521,8 @@ public class ChartJSONHelper {
                                                        value.append("(");
                                                }
                                                for(int j = 0 ; j < vals.length; j++) {
-                                                       if(isMultiValue) value.append("'");
+                                                       if(isMultiValue)
+                                                               value.append("'");
                                                        try {
                                                                if(vals[j] !=null && vals[j].length() > 0) {
                                                                        vals[j] = Utils.oracleSafe(vals[j]);
@@ -1483,7 +1537,8 @@ public class ChartJSONHelper {
                                                        }
                
                
-                                                       if(isMultiValue) value.append("'"); 
+                                                       if(isMultiValue)
+                                value.append("'"); 
                                                        
                                                        if(j != vals.length -1) {
                                                                value.append(",");
index 178410a..3af59e5 100644 (file)
@@ -70,7 +70,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.util.regex.Pattern; 
 
 import org.onap.portalsdk.analytics.error.RaptorRuntimeException;
 import org.onap.portalsdk.analytics.error.UserDefinedException;
@@ -80,7 +80,6 @@ import org.onap.portalsdk.analytics.model.base.IdNameSql;
 import org.onap.portalsdk.analytics.model.base.IdNameValue;
 import org.onap.portalsdk.analytics.system.AppUtils;
 import org.onap.portalsdk.analytics.system.ConnectionUtils;
-import org.onap.portalsdk.analytics.system.ExecuteQuery;
 import org.onap.portalsdk.analytics.system.Globals;
 import org.onap.portalsdk.analytics.util.DataSet;
 import org.onap.portalsdk.analytics.util.Utils;
index b0eb81a..0805b22 100644 (file)
@@ -274,7 +274,8 @@ public class FormatProcessor extends RaptorObject {
                        }
         }
 
-        if( anyFormatter == null ) anyFormatter = formatter; 
+        if( anyFormatter == null )
+                       anyFormatter = formatter; 
        // String sValue = convertValue(dv.getDisplayValue());
         //if (sValue.length() > 0) {
             for (Iterator iter = semaphore.getFormatList().getFormat().iterator(); iter
@@ -319,7 +320,8 @@ public class FormatProcessor extends RaptorObject {
                     //dr.setFormatId(fmt.getFormatId());
                     //break;
                 } else { // if
-                       if(!formatModified) formatter = anyFormatter;
+                       if(!formatModified)
+                                               formatter = anyFormatter;
                        //if(!((formatter!=null && formatter!=anyFormatter) || (defaultFormatter!=null && formatter!=defaultFormatter)))
                        //      formatter = anyFormatter;
                        //formatter.setFormatId(anyFormatter.getFormatId());