ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Fri, 06 Dec 2002 23:29:20 GMT
costin      2002/12/06 15:29:19

  Modified:    src/main/org/apache/tools/ant Project.java
  Log:
  Few extra checks and small improvements to the delayed tasks
  
  Revision  Changes    Path
  1.118     +13 -2     jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- Project.java	6 Dec 2002 23:11:04 -0000	1.117
  +++ Project.java	6 Dec 2002 23:29:19 -0000	1.118
  @@ -2090,6 +2090,7 @@
           protected void initAll( ) {
               if( initAllDone ) return;
               project.log("InitAll", Project.MSG_DEBUG);
  +            if( props==null ) return;
               Enumeration enum = props.propertyNames();
               while (enum.hasMoreElements()) {
                   String key = (String) enum.nextElement();
  @@ -2106,6 +2107,7 @@
           }
   
           protected Class getTask(String key) {
  +            if( props==null ) return null; // for tasks loaded before init()
               String value=props.getProperty(key);
               if( value==null) {
                   project.log( "No class name for " + key, Project.MSG_VERBOSE );
  @@ -2128,8 +2130,17 @@
           public Object get( Object key ) {
               Object orig=super.get( key );
               if( orig!= null ) return orig;
  +            if( ! (key instanceof String) ) return null;
               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;
  +        }
  +
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message