summaryrefslogtreecommitdiffstats
path: root/jtosca/src
diff options
context:
space:
mode:
Diffstat (limited to 'jtosca/src')
-rw-r--r--jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java4
-rw-r--r--jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/common/ExceptionCollector.java29
2 files changed, 16 insertions, 17 deletions
diff --git a/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java b/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
index 8b7abce..942ca96 100644
--- a/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
+++ b/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
@@ -101,7 +101,7 @@ public class ToscaTemplate extends Object {
//long startTime = System.nanoTime();
- ExceptionCollector.start();
+ //ExceptionCollector.start();
isFile = aFile;
inputPath = null;
@@ -184,7 +184,7 @@ public class ToscaTemplate extends Object {
csarTempDir = null;
}
- ExceptionCollector.stop();
+ //ExceptionCollector.stop();
verifyTemplate();
}
diff --git a/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/common/ExceptionCollector.java b/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/common/ExceptionCollector.java
index 9bef6bc..07dabf8 100644
--- a/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/common/ExceptionCollector.java
+++ b/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/common/ExceptionCollector.java
@@ -1,45 +1,44 @@
package org.openecomp.sdc.toscaparser.api.common;
-import org.openecomp.sdc.toscaparser.api.elements.EntityType;
+import java.util.ArrayList;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-
// Perfectly good enough...
public class ExceptionCollector {
private static Logger log = LoggerFactory.getLogger(ExceptionCollector.class.getName());
- private static boolean isCollecting = false;
- private static ArrayList<String> exceptionStrings = null;
- private static ArrayList<String> traceStrings = null;
+ //private static boolean isCollecting = false;
+ private static ArrayList<String> exceptionStrings = new ArrayList<>();
+ private static ArrayList<String> traceStrings = new ArrayList<>();
private static boolean bWantTrace = true;
- public static void start() {
+ /*public static void start() {
if(exceptionStrings == null) {
exceptionStrings = new ArrayList<String>();
traceStrings = new ArrayList<String>();
}
isCollecting = true;
- }
+ }*/
- public static void stop() {
+ /*public static void stop() {
isCollecting = false;
- }
+ }*/
public static void clear() {
- exceptionStrings = null;
- traceStrings = null;
+ exceptionStrings = new ArrayList<>();
+ traceStrings = new ArrayList<>();
}
public static void appendException(String strExc) { // throws Exception {
- if(!isCollecting) {
+ /*if(!isCollecting) {
// throw new Exception("Can't append exception " + strExc);
log.error("ExceptionCollector - appendException - Can't append exception {}", strExc);
- }
+ }*/
if(!exceptionStrings.contains(strExc)) {
exceptionStrings.add(strExc);
@@ -66,7 +65,7 @@ public class ExceptionCollector {
}
return report;
}
- return null;
+ return new ArrayList<>();
}
public static int errorsCaught() {