Browse Source

Another small improvement - if the 'coreLoader' is set, try

it before Class.forName().

AFAIK nobody sets it right now. The 'only' system property is
checked.

I'll wait for the gump runs to see if anything breaks and revert
the "lazy task creation" if it does.

PR:
Obtained from:
Submitted by:
Reviewed by:


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

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

@@ -2114,7 +2114,16 @@ public class Project {
return null; return null;
} }
try { try {
Class taskClass = Class.forName(value);
Class taskClass=null;
if( project.getCoreLoader() != null &&
!("only".equals(project.getProperty("build.sysclasspath")))) {
try {
taskClass=project.getCoreLoader().loadClass(value);
if( taskClass != null ) return taskClass;
} catch( Exception ex ) {
}
}
taskClass = Class.forName(value);
return taskClass; return taskClass;
} catch (NoClassDefFoundError ncdfe) { } catch (NoClassDefFoundError ncdfe) {
project.log("Could not load a dependent class (" project.log("Could not load a dependent class ("


Loading…
Cancel
Save