From c041d462a680fa2cf58b00c0d85ab1e468f98269 Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Tue, 9 Jun 2020 09:50:32 +0530 Subject: lowered code smells in ReportLoader & ReportWrappe lowered code smells in ReportLoader & ReportWrapper Issue-ID: PORTAL-813 Change-Id: I0c1452bc1097e28943ad0497e493517b957b0059 Signed-off-by: Indrijeet Kumar --- .../org/onap/portalsdk/analytics/model/ReportLoader.java | 13 ------------- .../onap/portalsdk/analytics/model/base/ReportWrapper.java | 3 +-- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'ecomp-sdk/epsdk-analytics') diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java index a92d5244..ed90ce50 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java @@ -142,12 +142,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { } else throw new RaptorException("Report " + reportID + NOT_FOUND_IN_DB); } else { - /* - * oracle.sql.CLOB clob = null; if (rs.next()) clob = (oracle.sql.CLOB) rs.getObject(1); else throw - * new RaptorException("Report " + reportID + NOT_FOUND_IN_DB); int len = 0; char[] buffer = new - * char[512]; Reader in = clob.getCharacterStream(); while ((len = in.read(buffer)) != -1) - * sb.append(buffer, 0, len); in.close(); - */ throw new RaptorException("only maria db support for this "); } } @@ -207,13 +201,6 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { } } else { - /* - * oracle.sql.CLOB clob = null; if (rs.next()) clob = (oracle.sql.CLOB) rs.getObject(2); else throw - * new RaptorException("Report " + reportID + NOT_FOUND_IN_DB); - * - * if (clob.length() > reportXML.length()) clob.trim(reportXML.length()); out = - * clob.getCharacterOutputStream(); - */ throw new RaptorException("only maria db support for this "); } /* diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java index 8c95d71a..35509900 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportWrapper.java @@ -3929,7 +3929,7 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject { if (reportSQL.indexOf("FROM", pos) != -1) { pos = reportSQL.indexOf("FROM", pos); pos_dup_select = reportSQL.lastIndexOf("SELECT", pos); - pos_first_select = reportSQL.indexOf("SELECT");// ,pos); + pos_first_select = reportSQL.indexOf("SELECT"); logger.debug(EELFLoggerDelegate.debugLogger, ("pos_select " + pos_first_select + " " + pos_dup_select)); if (pos_dup_select > pos_first_select) { logger.debug(EELFLoggerDelegate.debugLogger, ("********pos_dup_select ********" + pos_dup_select)); @@ -4274,7 +4274,6 @@ public class ReportWrapper extends org.onap.portalsdk.analytics.RaptorObject { cr.setPublic(false); cr.setCreateId(createID); cr.setCreateDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar())); - // cr.setReportSQL(""); cr.setReportType(""); cr.setPageSize(50); -- cgit 1.2.3-korg