bodewig 2002/09/23 04:28:44
Modified: src/main/org/apache/tools/ant/types AbstractFileSet.java
Log:
AbstractFileSet should check whether it is a reference in a couple of places
Triggered by PR: 12838
Revision Changes Path
1.12 +24 -0
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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AbstractFileSet.java 2 Sep 2002 15:08:27 -0000 1.11
+++ AbstractFileSet.java 23 Sep 2002 11:28:44 -0000 1.12
@@ -308,6 +308,9 @@
* sensitive, "false"|"off"|"no" when not.
*/
public void setCaseSensitive(boolean isCaseSensitive) {
+ if (isReference()) {
+ throw tooManyAttributes();
+ }
this.isCaseSensitive = isCaseSensitive;
}
@@ -317,6 +320,9 @@
* @param followSymlinks whether or not symbolic links should be followed
*/
public void setFollowSymlinks(boolean followSymlinks) {
+ if (isReference()) {
+ throw tooManyAttributes();
+ }
this.followSymlinks = followSymlinks;
}
@@ -375,6 +381,11 @@
}
public void setupDirectoryScanner(FileScanner ds, Project p) {
+ if (isReference()) {
+ getRef(p).setupDirectoryScanner(ds, p);
+ return;
+ }
+
if (ds == null) {
throw new IllegalArgumentException("ds cannot be null");
}
@@ -432,6 +443,9 @@
* @return whether any selectors are in this container
*/
public boolean hasSelectors() {
+ if (isReference() && getProject() != null) {
+ return getRef(getProject()).hasSelectors();
+ }
return !(selectors.isEmpty());
}
@@ -441,6 +455,10 @@
* @return whether any patterns are in this container
*/
public boolean hasPatterns() {
+ if (isReference() && getProject() != null) {
+ return getRef(getProject()).hasPatterns();
+ }
+
if (defaultPatterns.hasPatterns(getProject())) {
return true;
}
@@ -462,6 +480,9 @@
* @return the number of selectors in this container
*/
public int selectorCount() {
+ if (isReference() && getProject() != null) {
+ return getRef(getProject()).selectorCount();
+ }
return selectors.size();
}
@@ -486,6 +507,9 @@
* @return an enumerator that goes through each of the selectors
*/
public Enumeration selectorElements() {
+ if (isReference() && getProject() != null) {
+ return getRef(getProject()).selectorElements();
+ }
return selectors.elements();
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>