]> source.dussan.org Git - archiva.git/commitdiff
MRM-1004 - RepositoryServlet tests fail intermittently on Windows.
authorJames William Dumay <jdumay@apache.org>
Mon, 17 Nov 2008 03:42:13 +0000 (03:42 +0000)
committerJames William Dumay <jdumay@apache.org>
Mon, 17 Nov 2008 03:42:13 +0000 (03:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@718167 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java

index 74f43e0ddb0373391ab2b15cc88553d2b6dd0032..d45e108a4620ca7a5fa8e4828badfb3e466c0a14 100644 (file)
@@ -589,8 +589,18 @@ public class ArchivaDavResourceFactory
         {
             // MavenXpp3Reader leaves the file open, so we need to close it ourselves.
             FileReader reader = new FileReader( pom );
-            Model model = new MavenXpp3Reader().read( reader );
-            reader.close();
+            Model model = null;
+            try
+            {
+                model = new MavenXpp3Reader().read( reader );
+            }
+            finally
+            {
+                if (reader != null)
+                {
+                    reader.close();
+                }
+            }
 
             DistributionManagement dist = model.getDistributionManagement();
             if ( dist != null )