diff --git a/proposal/sandbox/antlib/build.xml b/proposal/sandbox/antlib/build.xml index 465ee809c..10783034c 100644 --- a/proposal/sandbox/antlib/build.xml +++ b/proposal/sandbox/antlib/build.xml @@ -6,7 +6,6 @@ - @@ -20,8 +19,6 @@ - - diff --git a/proposal/sandbox/antlib/src/main/org/apache/tools/ant/opt-antlib.xml b/proposal/sandbox/antlib/src/main/org/apache/tools/ant/opt-antlib.xml new file mode 100644 index 000000000..238ae112d --- /dev/null +++ b/proposal/sandbox/antlib/src/main/org/apache/tools/ant/opt-antlib.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proposal/sandbox/antlib/src/main/org/apache/tools/ant/types/DataTypeAdapterTask.java b/proposal/sandbox/antlib/src/main/org/apache/tools/ant/types/DataTypeAdapterTask.java index 4669a0789..18dc7c542 100644 --- a/proposal/sandbox/antlib/src/main/org/apache/tools/ant/types/DataTypeAdapterTask.java +++ b/proposal/sandbox/antlib/src/main/org/apache/tools/ant/types/DataTypeAdapterTask.java @@ -66,7 +66,6 @@ import org.apache.tools.ant.*; public class DataTypeAdapterTask extends Task implements RoleAdapter { Object proxy; - String id = null; /** * Checks a class, whether it is suitable to be adapted. @@ -84,27 +83,14 @@ public class DataTypeAdapterTask extends Task implements RoleAdapter { * Do the execution. */ public void execute() throws BuildException { - if (id != null) { - // Need to re-register this reference - // The container has register the Adapter instead - project.addReference(id, proxy); - } - } - - /** - * Propagate configuration of Project - */ - public void setProject(Project p) { - super.setProject(p); - // Check to see if the DataType has a setProject method to set if (proxy instanceof ProjectComponent) { - ((ProjectComponent)proxy).setProject(p); + ((ProjectComponent)proxy).setProject(project); return; } // This may not be needed - // We are trying to set project even if is was not declared + // We are trying to set project even it is was not declared // just like TaskAdapter does for beans, this is not done // by the original code Method setProjectM = null; @@ -113,7 +99,7 @@ public class DataTypeAdapterTask extends Task implements RoleAdapter { setProjectM = c.getMethod( "setProject", new Class[] {Project.class}); if(setProjectM != null) { - setProjectM.invoke(proxy, new Object[] {p}); + setProjectM.invoke(proxy, new Object[] {project}); } } catch (NoSuchMethodException e) { // ignore this if the class being used as a task does not have @@ -136,8 +122,4 @@ public class DataTypeAdapterTask extends Task implements RoleAdapter { return this.proxy ; } - public void setId(String id) { - log("Setting adapter id to: " + id, Project.MSG_DEBUG); - this.id = id; - } }