bodewig     00/12/07 05:13:32

  Modified:    src/main/org/apache/tools/ant/taskdefs Copy.java
  Log:
  Fixed NullPointerException in <copy> when <mapper> and overwrite have
  been used at the same time.
  
  Reported by:  Raphael PIERQUIN <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.11      +8 -1      
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java
  
  Index: Copy.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Copy.java 2000/11/23 14:43:24     1.10
  +++ Copy.java 2000/12/07 13:13:32     1.11
  @@ -281,7 +281,14 @@
   
           String[] toCopy = null;
           if (forceOverwrite) {
  -            toCopy = names;
  +            Vector v = new Vector();
  +            for (int i=0; i<names.length; i++) {
  +                if (mapper.mapFileName(names[i]) != null) {
  +                    v.addElement(names[i]);
  +                }
  +            }
  +            toCopy = new String[v.size()];
  +            v.copyInto(toCopy);
           } else {
               SourceFileScanner ds = new SourceFileScanner(this);
               toCopy = ds.restrict(names, fromDir, toDir, mapper);
  
  
  

Reply via email to