gnodet commented on code in PR #1043: URL: https://github.com/apache/maven/pull/1043#discussion_r1129178097
########## 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: The xml parser does not need to consume the whole stream. This is definitely the common use case, but we can think of continuously reading xml pieces from a socket or any other input stream. The `XmlNodeBuilder` / `MXParser` should support that when being called with `setInput(...)` multiple times : it should reset its internal state and be able to read again from the given stream. -- 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