You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/05/24 16:24:17 UTC
cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types AbstractFileSet.java PatternSet.java
bodewig 02/05/24 07:24:16
Modified: src/main/org/apache/tools/ant/types Tag: ANT_15_BRANCH
AbstractFileSet.java PatternSet.java
Log:
Make PatternSet#hasPatterns work with references.
Revision Changes Path
No revision
No revision
1.5.2.4 +3 -3 jakarta-ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
Index: AbstractFileSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -u -r1.5.2.3 -r1.5.2.4
--- AbstractFileSet.java 14 May 2002 13:45:13 -0000 1.5.2.3
+++ AbstractFileSet.java 24 May 2002 14:24:16 -0000 1.5.2.4
@@ -112,7 +112,7 @@
* this element if you make it a reference.</p>
*/
public void setRefid(Reference r) throws BuildException {
- if (dir != null || defaultPatterns.hasPatterns()) {
+ if (dir != null || defaultPatterns.hasPatterns(getProject())) {
throw tooManyAttributes();
}
if (!additionalPatterns.isEmpty()) {
@@ -407,14 +407,14 @@
* @return whether any patterns are in this container
*/
public boolean hasPatterns() {
- if (defaultPatterns.hasPatterns()) {
+ if (defaultPatterns.hasPatterns(getProject())) {
return true;
}
Enumeration enum = additionalPatterns.elements();
while (enum.hasMoreElements()) {
PatternSet ps = (PatternSet) enum.nextElement();
- if (ps.hasPatterns()) {
+ if (ps.hasPatterns(getProject())) {
return true;
}
}
1.24.2.1 +7 -3 jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java
Index: PatternSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -u -r1.24 -r1.24.2.1
--- PatternSet.java 15 Apr 2002 13:36:21 -0000 1.24
+++ PatternSet.java 24 May 2002 14:24:16 -0000 1.24.2.1
@@ -382,9 +382,13 @@
/**
* helper for FileSet.
*/
- boolean hasPatterns() {
- return includesFileList.size() > 0 || excludesFileList.size() > 0
- || includeList.size() > 0 || excludeList.size() > 0;
+ boolean hasPatterns(Project p) {
+ if (isReference()) {
+ return getRef(p).hasPatterns(p);
+ } else {
+ return includesFileList.size() > 0 || excludesFileList.size() > 0
+ || includeList.size() > 0 || excludeList.size() > 0;
+ }
}
/**
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>