From 9265e9e8dda7e6374f420065201a828a4fdc8254 Mon Sep 17 00:00:00 2001 From: James William Dumay Date: Mon, 17 Nov 2008 03:42:13 +0000 Subject: [PATCH] MRM-1004 - RepositoryServlet tests fail intermittently on Windows. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@718167 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/webdav/ArchivaDavResourceFactory.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java index 74f43e0dd..d45e108a4 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -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 ) -- 2.39.5