ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Available.java
Date Mon, 18 Sep 2000 07:50:45 GMT
bodewig     00/09/18 00:50:45

  Modified:    src/main/org/apache/tools/ant/taskdefs Available.java
  Log:
  Fixed situation where Class.getClassLoader returns null for the
  bootstrap class loader - JDK 1.1.7 on Linux for example.
  
  Revision  Changes    Path
  1.12      +8 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java
  
  Index: Available.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Available.java	2000/09/17 00:07:14	1.11
  +++ Available.java	2000/09/18 07:50:44	1.12
  @@ -143,7 +143,14 @@
               if (loader != null) {
                   loader.loadClass(classname);
               } else {
  -                this.getClass().getClassLoader().loadClass(classname);
  +                ClassLoader l = this.getClass().getClassLoader();
  +                // Can return null to represent the bootstrap class loader.
  +                // see API docs of Class.getClassLoader.
  +                if (l != null) {
  +                    l.loadClass(classname);
  +                } else {
  +                    Class.forName(classname);
  +                }
               }
               return true;
           } catch (ClassNotFoundException e) {
  
  
  

Mime
View raw message