aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-09-15 13:42:48 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-15 13:42:48 +0000
commit8a1b7611bfb9c866c46ccb1d9797eebbc285c8a6 (patch)
tree6b708a7e02f4ba06daafb82266cc9d78fb3f3102
parentd3913648518ce15fe7a74275394b86d0ecfb32a4 (diff)
parentb5eb016eb6b64a39ded0290412aef895d527ef0a (diff)
Merge "Fix Blocker/Critical sonar issues"
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java
index 5270143a..26d45ce9 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java
@@ -21,17 +21,6 @@
package org.onap.ccsdk.sli.core.sli;
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.LinkedList;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
@@ -41,6 +30,16 @@ import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.LinkedList;
+
/**
* @author dt5972
*
@@ -336,7 +335,7 @@ public class SvcLogicParser {
Schema schema = null;
String validateSchema = System.getProperty(SLI_VALIDATING_PARSER, "true");
- if (validateSchema != null || validateSchema.equalsIgnoreCase("true")) {
+ if ("true".equalsIgnoreCase(validateSchema)) {
xsdUrl = getClass().getResource(SVCLOGIC_XSD);
}
@@ -362,7 +361,7 @@ public class SvcLogicParser {
SAXParser saxParser = factory.newSAXParser();
if (saxParser.isValidating()) {
- LOGGER.info("Validating against schema " + xsdUrl.getPath());
+ LOGGER.info("Parser not configured to validate XML {}", (xsdUrl != null ? xsdUrl.getPath() : null));
}
graphs = new LinkedList<>();