removed code smells from three components 68/108168/6
authorIndrijeet kumar <indriku1@in.ibm.com>
Sat, 23 May 2020 09:18:24 +0000 (14:48 +0530)
committerIndrijeet Kumar <indriku1@in.ibm.com>
Thu, 28 May 2020 04:51:14 +0000 (04:51 +0000)
removed code smells from three components

Issue-ID: PORTAL-813
Change-Id: I24671e06c40588b715a988694194f3d12719795f
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java

index 63a4f5f..544f65e 100644 (file)
@@ -33,7 +33,7 @@
  *
  * ============LICENSE_END============================================
  *
- * 
+ *
  */
 package org.onap.portalsdk.analytics.util;
 
@@ -55,7 +55,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p
         for (int i = 0; i < s.length(); i++) {
             // while c is not last character
             c = s.charAt(i);
-            //System.out.println("444 Character " + (char)c + " int " + c);
             if ((char) c == TXT_END_TAG) {
                 // if char == '>' text following
                 // it and not HTML tag
@@ -64,17 +63,9 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p
                 // if char == '<' tag is
                 // following not text
                 inText = false;
-            } /*else if ((char)c == '\n') {
-               System.out.println("new line " + (char)c + " int " + c);
-               inText = false;
-            }*/  /*else if ((char) c == '&') {
-                // if char == '&' chars following
-                // are not text
-                inText = false;
-            }*/ 
+            }
             else if (inText) {
                 // if text write char to "text.txt"
-               //System.out.println("444444  Adding " + (char)c + " int " + c);
                if (c >= 32 && c <= 122) {
                        if(c==32 || (c>32 && c<=47) || ( c>=58 && c<=64 )) {
                            if (c == 45) {
@@ -93,14 +84,10 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p
                }
             } 
         }
-        //System.out.println("\n\nFinished processing: " + s + "\n\n");
-        //System.out.println("\n\nThe processed String : " + sbuf.toString() + "\n\n");
         return sbuf.toString();
     }
     
     public String stripHtml(String s) {
-
-        //System.out.println("Starting to process: " + s + "\n\n"); // prints
        s = nvl(s);
         StringBuffer sbuf = new StringBuffer();
         int c;
@@ -116,14 +103,7 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p
                 // if char == '<' tag is
                 // following not text
                 inText = false;
-            } /*else if ((char)c == '\n') {
-               System.out.println("new line " + (char)c + " int " + c);
-               inText = false;
-            }*/  /*else if ((char) c == '&') {
-                // if char == '&' chars following
-                // are not text
-                inText = false;
-            }*/ 
+            } 
             else if (inText) {
                 // if text write char to "text.txt"
                if (c >= 32 && c <= 122) {
@@ -131,8 +111,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p
                }
             }
         }
-        //System.out.println("\n\nFinished processing: " + s + "\n\n");
-        //System.out.println("\n\nThe processed String : " + sbuf.toString() + "\n\n");
         int pos = 0 ;
         while(sbuf.indexOf("&nbsp;")!=-1) {
                pos = sbuf.indexOf("&nbsp;");
@@ -145,7 +123,6 @@ public class HtmlStripper extends RaptorObject// this function can be accessed p
     
     public String stripCSVHtml (String s) {
        String s1 =  stripHtml(s);
-       //s1 = Utils.replaceInString(s1, "\"", "\"\"");
        s1 = s1.replaceAll("\"", "\"\"");
        return s1;
     }
index 56e117f..9d78b39 100644 (file)
@@ -63,7 +63,7 @@ public class RemDbInfo {
                Globals.getDbUtils();
                ds = DbUtils.executeQuery(query);
 
-                       String dbId = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = "";
+               String dbId = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = "";
                
                if(ds.getRowCount() > 0) {
                        for (int i = 0; i < ds.getRowCount(); i++) {