From 56a3b7191c51fbedcfe1ba830ea99ee7172d72cf Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Sat, 28 Dec 2002 22:58:52 +0000 Subject: [PATCH] Update to ProjectHelper git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273716 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/RuntimeConfigurable2.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/proposal/embed/src/java/org/apache/tools/ant/RuntimeConfigurable2.java b/proposal/embed/src/java/org/apache/tools/ant/RuntimeConfigurable2.java index 5cd66ed48..9e9856b3a 100644 --- a/proposal/embed/src/java/org/apache/tools/ant/RuntimeConfigurable2.java +++ b/proposal/embed/src/java/org/apache/tools/ant/RuntimeConfigurable2.java @@ -281,10 +281,31 @@ public class RuntimeConfigurable2 extends RuntimeConfigurable { if( proxyConfigured ) { return; } - PropertyHelper2 ph=PropertyHelper2.getPropertyHelper(p); + PropertyHelper ph=PropertyHelper.getPropertyHelper(p); + + Object target=(wrappedObject instanceof TaskAdapter) ? + ((TaskAdapter)wrappedObject).getProxy() : wrappedObject; if (attributes != null) { - ph.configure(wrappedObject, attributes, p); + IntrospectionHelper ih = + IntrospectionHelper.getHelper(p, target.getClass()); + + for (int i = 0; i < attributes.getLength(); i++) { + String name= attributes.getQName(i); + String value= attributes.getValue(i); + + // reflect these into the target + value = ph.replaceProperties(null, value, null); + try { + ih.setAttribute(p, target, + name.toLowerCase(Locale.US), value); + } catch (BuildException be) { + // id attribute must be set externally + if (!name.equals("id")) { + throw be; + } + } + } id = attributes.getValue("id"); // No way - this will be used on future calls ( if the task is used // multiple times: attributes = null;