maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1715103 - /maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/stubs/DefaultMavenProjectStub.java
Date Thu, 19 Nov 2015 06:28:45 GMT
Author: krosenvold
Date: Thu Nov 19 06:28:45 2015
New Revision: 1715103

URL: http://svn.apache.org/viewvc?rev=1715103&view=rev
Log:
Fixed file handle leak in testcase

Modified:
    maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/stubs/DefaultMavenProjectStub.java

Modified: maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/stubs/DefaultMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/stubs/DefaultMavenProjectStub.java?rev=1715103&r1=1715102&r2=1715103&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/stubs/DefaultMavenProjectStub.java
(original)
+++ maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/stubs/DefaultMavenProjectStub.java
Thu Nov 19 06:28:45 2015
@@ -43,10 +43,15 @@ public class DefaultMavenProjectStub
 
         try
         {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir()
-                    + "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
) ) );
-            setModel( model );
+            final FileReader reader = new FileReader(new File(getBasedir()
+                    + "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"));
+            try {
+                model =
+                        pomReader.read(reader);
+            } finally {
+                reader.close();
+            }
+            setModel(model);
         }
         catch ( Exception e )
         {



Mime
View raw message