maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/project DefaultMavenProjectBuilder.java
Date Tue, 22 Mar 2005 10:07:01 GMT
brett       2005/03/22 02:07:01

  Modified:    maven-core/src/main/java/org/apache/maven/project
                        DefaultMavenProjectBuilder.java
  Log:
  close file handle
  
  Revision  Changes    Path
  1.57      +10 -4     maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
  
  Index: DefaultMavenProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- DefaultMavenProjectBuilder.java	22 Mar 2005 07:23:16 -0000	1.56
  +++ DefaultMavenProjectBuilder.java	22 Mar 2005 10:07:01 -0000	1.57
  @@ -47,6 +47,7 @@
   import org.codehaus.plexus.logging.AbstractLogEnabled;
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
  +import org.codehaus.plexus.util.IOUtil;
   import org.codehaus.plexus.util.StringUtils;
   
   import java.io.File;
  @@ -199,9 +200,8 @@
           {
               try
               {
  -                project.setDistributionManagementArtifactRepository(
  -                    buildDistributionManagementRepository(
  -                        dm.getRepository() ) );
  +                project.setDistributionManagementArtifactRepository( buildDistributionManagementRepository(
  +                    dm.getRepository() ) );
               }
               catch ( Exception e )
               {
  @@ -413,9 +413,11 @@
       private Model readModel( File file )
           throws ProjectBuildingException
       {
  +        FileReader reader = null;
           try
           {
  -            return modelReader.read( new FileReader( file ) );
  +            reader = new FileReader( file );
  +            return modelReader.read( reader );
           }
           catch ( FileNotFoundException e )
           {
  @@ -426,6 +428,10 @@
               throw new ProjectBuildingException(
                   "Error while reading model from file '" + file.getAbsolutePath() + "'.",
e );
           }
  +        finally
  +        {
  +            IOUtil.close( reader );
  +        }
       }
   
       private Model readModel( URL url )
  
  
  

Mime
View raw message