Browse Source

use DataType's convenience method

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278336 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
ec980be734
1 changed files with 1 additions and 32 deletions
  1. +1
    -32
      src/main/org/apache/tools/ant/types/AbstractFileSet.java

+ 1
- 32
src/main/org/apache/tools/ant/types/AbstractFileSet.java View File

@@ -392,27 +392,6 @@ public abstract class AbstractFileSet extends DataType
? getRef(getProject()).isFollowSymlinks() : followSymlinks;
}

/**
* Gets as descriptive as possible a name used for this datatype instance.
* @return <code>String</code> name.
*/
protected String getDataTypeName() {
// look up the types in project and see if they match this class
Project p = getProject();
if (p != null) {
Hashtable typedefs = p.getDataTypeDefinitions();
for (Enumeration e = typedefs.keys(); e.hasMoreElements();) {
String typeName = (String) e.nextElement();
Class typeClass = (Class) typedefs.get(typeName);
if (typeClass == getClass()) {
return typeName;
}
}
}
String classname = getClass().getName();
return classname.substring(classname.lastIndexOf('.') + 1);
}

/**
* Returns the directory scanner needed to access the files to process.
* @return a <code>DirectoryScanner</code> instance.
@@ -504,17 +483,7 @@ public abstract class AbstractFileSet extends DataType
* @return the referenced FileSet
*/
protected AbstractFileSet getRef(Project p) {
if (!isChecked()) {
Stack stk = new Stack();
stk.push(this);
dieOnCircularReference(stk, p);
}
Object o = getRefid().getReferencedObject(p);
if (!getClass().isAssignableFrom(o.getClass())) {
throw new BuildException(getRefid().getRefId()
+ " doesn\'t denote a " + getDataTypeName());
}
return (AbstractFileSet) o;
return (AbstractFileSet) getCheckedRef(p);
}

// SelectorContainer methods


Loading…
Cancel
Save