evenisse    2004/01/09 02:29:33

  Modified:    maven-mboot/src/main Bootstrapper.java
  Log:
  Fix NullPointerException if build.properties file doesn't exist in user.home
  
  Revision  Changes    Path
  1.2       +5 -7      maven-components/maven-mboot/src/main/Bootstrapper.java
  
  Index: Bootstrapper.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot/src/main/Bootstrapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Bootstrapper.java 3 Jan 2004 05:33:28 -0000       1.1
  +++ Bootstrapper.java 9 Jan 2004 10:29:33 -0000       1.2
  @@ -54,7 +54,7 @@
           String basedir = args[0];
   
           Properties properties = loadProperties( new File( System.getProperty( 
"user.home" ), "build.properties" ) );
  -
  +        
           baseUrl = properties.getProperty( "maven.repo.remote" );
   
           if ( baseUrl == null )
  @@ -268,21 +268,19 @@
               // ignore
           }
   
  -        return null;
  +        return new Properties();
       }
   
       private static Properties loadProperties( InputStream is )
       {
  +        Properties properties = new Properties();
  +        
           try
           {
  -            Properties properties = new Properties();
  -
               if ( is != null )
               {
                   properties.load( is );
               }
  -
  -            return properties;
           }
           catch ( IOException e )
           {
  @@ -303,7 +301,7 @@
               }
           }
   
  -        return null;
  +        return properties;
       }
   
       static class BootstrapPomParser
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to