You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2020/07/20 12:34:19 UTC

[maven-shared-utils] branch i848 created (now 1048c85)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch i848
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git.


      at 1048c85  remove call to deprecated method

This branch includes the following new commits:

     new 1048c85  remove call to deprecated method

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-shared-utils] 01/01: remove call to deprecated method

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch i848
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git

commit 1048c8541eded1ca3e7ec5fb799c2dbb657badbf
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Mon Jul 20 08:34:02 2020 -0400

    remove call to deprecated method
---
 pom.xml                                                          | 2 +-
 .../java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java   | 9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index c348c54..e20a78f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -81,7 +81,7 @@
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-core</artifactId>
+      <artifactId>hamcrest</artifactId>
       <version>2.2</version>
       <scope>test</scope>
     </dependency>
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
index bfa77f3..00f6f0b 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
@@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.xml;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.io.IOUtil;
 import org.apache.maven.shared.utils.xml.pull.XmlPullParserException;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -95,10 +94,10 @@ public class Xpp3DomBuilder
      * @return the built dom
      * @throws XmlPullParserException in case of an error
      */
-    public static Xpp3Dom build( @WillClose Reader reader, boolean trim )
+    public static Xpp3Dom build( @WillClose Reader in, boolean trim )
         throws XmlPullParserException
     {
-        try
+        try ( Reader reader = in )  
         {
             DocHandler docHandler = parseSax( new InputSource( reader ), trim );
             reader.close();
@@ -108,10 +107,6 @@ public class Xpp3DomBuilder
         {
             throw new XmlPullParserException( e );
         }
-        finally
-        {
-            IOUtil.close( reader );
-        }
     }
 
     private static DocHandler parseSax( @Nonnull InputSource inputSource, boolean trim )