Browse Source

Allow reflection on setX(Object x) to be an xml attribute

Normally x will be of String type, however with the new
PropertyHelper, x may be of other types. 
  x="${el:path.main}" for example.



git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@568096 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
f4ee8dcc26
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      src/main/org/apache/tools/ant/IntrospectionHelper.java

+ 11
- 0
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -943,6 +943,17 @@ public final class IntrospectionHelper {
final Class reflectedArg = PRIMITIVE_TYPE_MAP.containsKey(arg)
? (Class) PRIMITIVE_TYPE_MAP.get(arg) : arg;

// Object.class - it gets handled differently by AttributeSetter
if (java.lang.Object.class == reflectedArg) {
return new AttributeSetter(m, arg) {
public void set(Project p, Object parent, String value)
throws InvocationTargetException,
IllegalAccessException {
throw new BuildException(
"Internal ant problem - this should not get called");
}
};
}
// simplest case - setAttribute expects String
if (java.lang.String.class.equals(reflectedArg)) {
return new AttributeSetter(m, arg) {


Loading…
Cancel
Save