costin 2003/05/02 22:59:35
Modified: src/main/org/apache/tools/ant ComponentHelper.java
Log:
Update with the changes in Project.
This makes ComponentHelper the almost exact duplication of the task creation
code in Project.
Revision Changes Path
1.6 +12 -4 ant/src/main/org/apache/tools/ant/ComponentHelper.java
Index: ComponentHelper.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ComponentHelper.java 15 Apr 2003 17:23:15 -0000 1.5
+++ ComponentHelper.java 3 May 2003 05:59:35 -0000 1.6
@@ -423,6 +423,7 @@
}
task = taskA;
}
+ task.setProject( project );
task.setTaskType(taskType);
// set default value, can be changed by the user
@@ -631,7 +632,9 @@
project.log("Loading with the core loader " + value,
Project.MSG_DEBUG);
taskClass=project.getCoreLoader().loadClass(value);
- if( taskClass != null ) return taskClass;
+ if( taskClass != null ) {
+ return taskClass;
+ }
} catch( Exception ex ) {
}
}
@@ -650,12 +653,17 @@
// Hashtable implementation
public Object get( Object key ) {
Object orig=super.get( key );
- if( orig!= null ) return orig;
- if( ! (key instanceof String) ) return null;
+ if( orig!= null ) {
+ return orig;
+ }
+ if( ! (key instanceof String) ) {
+ return null;
+ }
project.log("Get task " + key, Project.MSG_DEBUG );
Object taskClass=getTask( (String) key);
- if( taskClass != null)
+ if( taskClass != null) {
super.put( key, taskClass );
+ }
return taskClass;
}