Browse Source

Few extra checks and small improvements to the delayed tasks

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273621 13f79535-47bb-0310-9956-ffa450edef68
master
Costin Manolache 22 years ago
parent
commit
b59acbe7ba
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      src/main/org/apache/tools/ant/Project.java

+ 12
- 1
src/main/org/apache/tools/ant/Project.java View File

@@ -2090,6 +2090,7 @@ public class Project {
protected void initAll( ) { protected void initAll( ) {
if( initAllDone ) return; if( initAllDone ) return;
project.log("InitAll", Project.MSG_DEBUG); project.log("InitAll", Project.MSG_DEBUG);
if( props==null ) return;
Enumeration enum = props.propertyNames(); Enumeration enum = props.propertyNames();
while (enum.hasMoreElements()) { while (enum.hasMoreElements()) {
String key = (String) enum.nextElement(); String key = (String) enum.nextElement();
@@ -2106,6 +2107,7 @@ public class Project {
} }


protected Class getTask(String key) { protected Class getTask(String key) {
if( props==null ) return null; // for tasks loaded before init()
String value=props.getProperty(key); String value=props.getProperty(key);
if( value==null) { if( value==null) {
project.log( "No class name for " + key, Project.MSG_VERBOSE ); project.log( "No class name for " + key, Project.MSG_VERBOSE );
@@ -2128,8 +2130,17 @@ public class Project {
public Object get( Object key ) { public Object get( Object key ) {
Object orig=super.get( key ); Object orig=super.get( key );
if( orig!= null ) return orig; if( orig!= null ) return orig;
if( ! (key instanceof String) ) return null;
project.log("Get task " + key, Project.MSG_DEBUG ); project.log("Get task " + key, Project.MSG_DEBUG );
return getTask( (String) key);
Object taskClass=getTask( (String) key);
if( taskClass != null)
super.put( key, taskClass );
return taskClass;
} }

public boolean contains( Object key ) {
return get( key ) != null;
}

} }
} }

Loading…
Cancel
Save