You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2005/05/03 16:59:44 UTC

cvs commit: ant/src/main/org/apache/tools/ant DirectoryScanner.java

mbenson     2005/05/03 07:59:44

  Modified:    src/main/org/apache/tools/ant DirectoryScanner.java
  Log:
  Not 100% sure this fixes the entire bug, but it eliminates NPEs for me.
  PR: 34722
  
  Revision  Changes    Path
  1.99      +9 -0      ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- DirectoryScanner.java	17 Mar 2005 14:23:58 -0000	1.98
  +++ DirectoryScanner.java	3 May 2005 14:59:44 -0000	1.99
  @@ -956,6 +956,12 @@
           try {
               synchronized (this) {
   
  +                // set in/excludes to reasonable defaults if needed:
  +                boolean nullIncludes = (includes == null);
  +                includes = nullIncludes ? new String[] {"**"} : includes;
  +                boolean nullExcludes = (excludes == null);
  +                excludes = nullExcludes ? new String[0] : excludes;
  +
                   String[] excl = new String[dirsExcluded.size()];
                   dirsExcluded.copyInto(excl);
           
  @@ -974,6 +980,9 @@
                                   notIncl[i] + File.separator, false);
                       }
                   }
  +                clearCaches();
  +                includes = nullIncludes ? null : includes;
  +                excludes = nullExcludes ? null : excludes;
               }
           } finally {
               synchronized (slowScanLock) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org