From fd64c2db2aab2d68155e2bce59c1dec03c99f729 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Gonzalez Date: Thu, 30 Aug 2007 10:34:35 +0000 Subject: [PATCH] Close properly the readers git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@571106 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/embedder/MavenEmbedder.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java index e92efc4222..0a4a66ef35 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java @@ -80,6 +80,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException; import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.logging.LoggerManager; +import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.jdom.Document; @@ -235,7 +236,7 @@ public class MavenEmbedder } finally { - reader.close(); + IOUtil.close( reader ); } return model; @@ -323,7 +324,7 @@ public class MavenEmbedder } finally { - fileReader.close(); + IOUtil.close( fileReader ); } } @@ -752,17 +753,7 @@ public class MavenEmbedder } finally { - try - { - if ( fileReader != null ) - { - fileReader.close(); - } - } - catch ( IOException e ) - { - // nothing to do - } + IOUtil.close( fileReader ); } }