Do dot declare SAXException/URISyntaxException as thrown 22/107522/4
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 27 Aug 2023 09:41:00 +0000 (11:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 28 Aug 2023 11:18:11 +0000 (13:18 +0200)
We cannot throw this exception from the implementation, do not declare
it as thrown.

JIRA: YANGTOOLS-1535
Change-Id: I03e6bc96b66e3bba1739d8d26591dbaacad237ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
codec/yang-data-codec-xml/src/main/java/org/opendaylight/yangtools/yang/data/codec/xml/XmlParserStream.java

index 47fdfa2b1c74838984f45067ebfcfb25dc2075cc..a5b161f8058391ac665f8370d179e2c465a261fc 100644 (file)
@@ -18,7 +18,6 @@ import com.google.common.collect.ImmutableMap;
 import java.io.Closeable;
 import java.io.Flushable;
 import java.io.IOException;
-import java.net.URISyntaxException;
 import java.util.AbstractMap.SimpleImmutableEntry;
 import java.util.Deque;
 import java.util.HashMap;
@@ -86,7 +85,6 @@ import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
 
 /**
  * This class provides functionality for parsing an XML source containing YANG-modeled data. It disallows multiple
@@ -342,16 +340,11 @@ public final class XmlParserStream implements Closeable, Flushable {
      *              instance of XmlParserStream
      * @throws XMLStreamException
      *              if a well-formedness error or an unexpected processing condition occurs while parsing the XML
-     * @throws URISyntaxException
-     *              if the namespace URI of an XML element contains a syntax error
      * @throws IOException
      *              if an error occurs while parsing the value of an anyxml node
-     * @throws SAXException
-     *              if an error occurs while parsing the value of an anyxml node
      */
     @Beta
-    public XmlParserStream traverse(final DOMSource src) throws XMLStreamException, URISyntaxException, IOException,
-            SAXException {
+    public XmlParserStream traverse(final DOMSource src) throws XMLStreamException, IOException {
         return parse(new DOMSourceXMLStreamReader(src));
     }