diff options
author | shashikanth <shashikanth.vh@huawei.com> | 2017-09-11 18:21:17 +0530 |
---|---|---|
committer | Shashikanth VH <shashikanth.vh@huawei.com> | 2017-09-14 13:47:39 +0000 |
commit | b5eb016eb6b64a39ded0290412aef895d527ef0a (patch) | |
tree | fed26708944142ace9ef39d3d8207aeaa8807b51 | |
parent | 03332a17a549438d204d8f0068a995a7c8708ed3 (diff) |
Fix Blocker/Critical sonar issues
Fix Blocker/Critical sonar issues in vnfapi module
https://sonar.onap.org/component_issues?id=org.openecomp.sdnc.core%3Asdnc-core#resolved=false|severities=BLOCKER
Issue-Id: CCSDK-67
Change-Id: Ie2ace1bc30bbb50d2b6f25a56e716c7a952e7ea0
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
-rw-r--r-- | sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java | 25 |
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<>(); |