jira-importer commented on issue #160:
URL: 
https://github.com/apache/maven-war-plugin/issues/160#issuecomment-2967846794

   **[Kris 
Nuttycombe](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kris.nuttyco...@noaa.gov)**
 commented
   
   I like the look of Brian's patch, but one thing I noticed when I attempted 
to use it is that there's a possible NullPointerException if the path to the 
filter file is incorrectly specified. Here's the diff to fix it:
   
   --- AbstractWarMojo.java.old    2006-02-24 09:39:23.000000000 -0700
   +++ AbstractWarMojo.java        2006-02-24 09:46:13.000000000 -0700
   @@ -409,10 +409,13 @@
   
       for ( Iterator i = filters.iterator(); i.hasNext(); )
       {
   
   - 
   
         String filtersfile = (String) i.next();
   
   + 
   
         String fname = (String) i.next();
   
   + 
   
         if (fname == null) throw new MojoExecutionException("Null filter file 
specified.");
   
   - 
   
         Properties properties = PropertyUtils.loadProperties(new 
File(filtersfile));
   
   + 
   
         File filtersFile = new File(fname);
   
   + 
   
         if (!filtersFile.exists()) throw new MojoExecutionException("Unable to 
find filters file " + fname);
   
   + 
   
             Properties properties = PropertyUtils.loadProperties(filtersFile);
             filterProperties.putAll(properties);
         }
   
     }
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to