ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Wed, 12 Jun 2002 08:45:31 GMT
bodewig     2002/06/12 01:45:30

  Modified:    src/main/org/apache/tools/ant Tag: ANT_15_BRANCH
                        Project.java
  Log:
  Degrade "Overwriting task definition" message to VERBOSE if the old
  and new task class are really the same but just have been loaded via
  different classloader instances that used the same classpath.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.108.2.7 +20 -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.108.2.6
  retrieving revision 1.108.2.7
  diff -u -r1.108.2.6 -r1.108.2.7
  --- Project.java	11 Jun 2002 08:14:15 -0000	1.108.2.6
  +++ Project.java	12 Jun 2002 08:45:30 -0000	1.108.2.7
  @@ -889,8 +889,26 @@
                       MSG_VERBOSE);
                   return;
               } else {
  +                int logLevel = MSG_WARN;
  +                if (old.getName().equals(taskClass.getName())) {
  +                    ClassLoader oldLoader = old.getClassLoader();
  +                    ClassLoader newLoader = taskClass.getClassLoader();
  +                    // system classloader on older JDKs can be null
  +                    if (oldLoader != null 
  +                        && newLoader != null
  +                        && oldLoader instanceof AntClassLoader
  +                        && newLoader instanceof AntClassLoader
  +                        && ((AntClassLoader) oldLoader).getClasspath()
  +                        .equals(((AntClassLoader) newLoader).getClasspath())
  +                        ) {
  +                        // same classname loaded from the same
  +                        // classpath components
  +                        logLevel = MSG_VERBOSE;
  +                    }
  +                }
  +                
                   log("Trying to override old definition of task " + taskName,
  -                    MSG_WARN);
  +                    logLevel);
                   invalidateCreatedTasks(taskName);
               }
           }
  
  
  

--
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