From cf01d506e5a7d34b422da8fb50ad61e24ac51fb5 Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Sat, 23 May 2020 14:48:24 +0530 Subject: removed code smells from three components removed code smells from three components Issue-ID: PORTAL-813 Change-Id: I24671e06c40588b715a988694194f3d12719795f Signed-off-by: Indrijeet Kumar --- .../portalsdk/analytics/util/HtmlStripper.java | 29 +++------------------- .../onap/portalsdk/analytics/util/RemDbInfo.java | 2 +- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java index 63a4f5f0..544f65e2 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/HtmlStripper.java @@ -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(" ")!=-1) { pos = sbuf.indexOf(" "); @@ -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; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java index 56e117f3..9d78b39a 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/RemDbInfo.java @@ -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++) { -- cgit 1.2.3-korg