elharo commented on code in PR #1043:
URL: https://github.com/apache/maven/pull/1043#discussion_r1128780743
##########
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:
since this is a public method this is a potentially behavior breaking
change, and could affect code outside this repo.
I'm also not certain this is a good idea. An XML parser is going to process
the entire stream. They're won't be anything left to read from, and closing
twice isn't usually a problem whereas forgetting to close a file can be.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]