umagesh 01/12/30 11:49:15
Modified: . WHATSNEW
src/main/org/apache/tools/ant IntrospectionHelper.java
Log:
Removed references to ValidatedFileAttribute and PreferredAttribute.
Reverted IntrospectionHelper to previous version.
Revision Changes Path
1.194 +0 -10 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -r1.193 -r1.194
--- WHATSNEW 28 Dec 2001 21:25:34 -0000 1.193
+++ WHATSNEW 30 Dec 2001 19:49:15 -0000 1.194
@@ -28,16 +28,6 @@
a check is made to see if there is another overloaded method that takes in
some other type of argument. If there is one such method, then the method
that takes in String as an argument is not selected by the Introspector.
-
- In addition, if there is an overloaded setter method that takes in a
- PreferredAttribute, it gains preference over other setters that do not
- take in a PreferredAttribute as argument. For example, if the methods
- setFoo(File) and setFoo(SrcFile) is present, setFoo(SrcFile) will be the
- one which gets invoked because SrcFile is a PreferredAttribute. If there
- are methods like setFoo(SrcFile) as well as setFoo(DestDir), where
- SrcFile and DestDir are PreferredAttributes, the setFoo method that
- gets selected first by the Java runtime will be the one that gets
- invoked.
Fixed bugs:
-----------
1.31 +4 -33
jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java
Index: IntrospectionHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- IntrospectionHelper.java 25 Dec 2001 19:30:26 -0000 1.30
+++ IntrospectionHelper.java 30 Dec 2001 19:49:15 -0000 1.31
@@ -56,8 +56,6 @@
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.EnumeratedAttribute;
-import org.apache.tools.ant.types.PreferredAttribute;
-import org.apache.tools.ant.types.ValidatedFileAttribute;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
@@ -73,7 +71,6 @@
* elements.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
*/
public class IntrospectionHelper implements BuildListener {
@@ -168,25 +165,17 @@
String propName = getPropertyName(name, "set");
if (attributeSetters.get(propName) != null) {
- if (java.lang.String.class.equals(args[0])
+ if (java.lang.String.class.equals(args[0])) {
/*
Ignore method m, as there is an overloaded
form of this method that takes in a
non-string argument, which gains higher
priority.
- */
- || PreferredAttribute.class.
-
isAssignableFrom((Class)attributeTypes.get(propName))
- /*
- Ignore method m because there is an overloaded
form of
- this method that takes in a PreferredAttribute
argument,
- which gains higher priority.
- */
- ) {
+ */
continue;
}
/*
- If the above conditions are not true, and if there
+ If the argument is not a String, and if there
is an overloaded form of this method already defined,
we just override that with the new one.
This mechanism does not guarantee any specific order
@@ -194,7 +183,7 @@
that depends on the order in which "set" methods have
been defined, is not guaranteed to be selected in any
particular order.
- */
+ */
}
AttributeSetter as = createAttributeSetter(m, args[0]);
if (as != null) {
@@ -594,24 +583,6 @@
org.apache.tools.ant.types.EnumeratedAttribute
ea = (org.apache.tools.ant.types.EnumeratedAttribute)arg.newInstance();
ea.setValue(value);
m.invoke(parent, new EnumeratedAttribute[] {ea});
- } catch (InstantiationException ie) {
- throw new BuildException(ie);
- }
- }
- };
-
- // ValidatedFileAttributes have their own helper class
- } else if (ValidatedFileAttribute.class.isAssignableFrom(arg)) {
- return new AttributeSetter() {
- public void set(Project p, Object parent, String value)
- throws InvocationTargetException,
IllegalAccessException, BuildException {
- try {
- ValidatedFileAttribute[] vfa = {
- (ValidatedFileAttribute) arg.newInstance()
- };
- File f = p.resolveFile(value);
- vfa[0].setFile(f);
- m.invoke(parent, vfa);
} catch (InstantiationException ie) {
throw new BuildException(ie);
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>