diff --git a/src/main/org/apache/tools/ant/Path.java b/src/main/org/apache/tools/ant/Path.java index 519194ad8..869d3484b 100644 --- a/src/main/org/apache/tools/ant/Path.java +++ b/src/main/org/apache/tools/ant/Path.java @@ -107,11 +107,26 @@ public class Path { */ public void setLocation(String location) { if (location != null && location.length() > 0) { - definition.addElement(translateFile(location)); + String element = translateFile(location); + if (definition.indexOf(element) == -1) { + definition.addElement(element); + } } } + /** + * Append the contents of the other Path instance to this. + */ + public void append(Path other) { + String[] l = other.list(); + for (int i=0; i