Author: peterreilly
Date: Tue Aug 21 05:26:21 2007
New Revision: 568096
URL: http://svn.apache.org/viewvc?rev=568096&view=rev
Log:
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.
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java?rev=568096&r1=568095&r2=568096&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java Tue
Aug 21 05:26:21 2007
@@ -943,6 +943,17 @@
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) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]