gnodet commented on code in PR #1043: URL: https://github.com/apache/maven/pull/1043#discussion_r1128725418
########## maven-xml-impl/src/main/java/org/codehaus/plexus/util/xml/Xpp3DomBuilder.java: ########## @@ -62,8 +64,10 @@ public static Xpp3Dom build(Reader reader, boolean trim) throws XmlPullParserExc */ public static Xpp3Dom build(Reader reader, boolean trim, InputLocationBuilder locationBuilder) throws XmlPullParserException, IOException { - return new Xpp3Dom( - XmlNodeBuilder.build(reader, trim, locationBuilder != null ? locationBuilder::toInputLocation : null)); + try (Reader closeMe = reader) { + return new Xpp3Dom(XmlNodeBuilder.build( + reader, trim, locationBuilder != null ? locationBuilder::toInputLocation : null)); + } } Review Comment: The `XmlNodeBuilder` is new in maven 4, so we can change it the way we want. The `Xpp3DomBuilder` comes from `plexus-utils` but now delegates to the the new `XmlNodeBuilder`. In order to preserve compatibility, I'd rather keep the previous behaviour for this class. Fwiw, my plan is to release 4.0.0-alpha-5, and work on the plexus-xml / plexus-utils 4.0 split, which can then later be used in maven 4.0.0-alpha-6 to get rid of the redefined plexus classes in maven. Does that make more sense ? -- 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