Browse Source

Fixed NullPointerException in <copy> when <mapper> and overwrite have

been used at the same time.

Reported by:	Raphael PIERQUIN <pierquin@agisphere.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268329 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
3eebdfd1c8
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/main/org/apache/tools/ant/taskdefs/Copy.java

+ 8
- 1
src/main/org/apache/tools/ant/taskdefs/Copy.java View File

@@ -281,7 +281,14 @@ public class Copy extends Task {


String[] toCopy = null; String[] toCopy = null;
if (forceOverwrite) { 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 { } else {
SourceFileScanner ds = new SourceFileScanner(this); SourceFileScanner ds = new SourceFileScanner(this);
toCopy = ds.restrict(names, fromDir, toDir, mapper); toCopy = ds.restrict(names, fromDir, toDir, mapper);


Loading…
Cancel
Save