elharo commented on code in PR #1043:
URL: https://github.com/apache/maven/pull/1043#discussion_r1129389367


##########
maven-xml-impl/src/main/java/org/apache/maven/internal/xml/XmlNodeBuilder.java:
##########
@@ -84,14 +81,9 @@ public static XmlNodeImpl build(Reader reader, boolean trim) 
throws XmlPullParse
      */
     public static XmlNodeImpl build(Reader reader, boolean trim, 
InputLocationBuilder locationBuilder)
             throws XmlPullParserException, IOException {
-        try (Reader closeMe = reader) {
-            final XmlPullParser parser = new MXParser();
-            parser.setInput(reader);
-
-            final XmlNodeImpl node = build(parser, trim, locationBuilder);
-
-            return node;
-        }
+        XmlPullParser parser = new MXParser();

Review Comment:
   Unless very specially coded the XML parser will consume the entire stream. 
It does not stop at the end of the first document. 
   
   I'm not sure about calling setInput multiple times. It can perhaps read from 
different streams in sequence, but not from the same stream twice, which will 
be fully consumed by a single parse. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to