You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/01/12 11:29:01 UTC

cvs commit: ant/src/main/org/apache/tools/ant/launch Locator.java

bodewig     2004/01/12 02:29:01

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/launch Locator.java
  Log:
  Class.getClassLoader may return null for the system classloader
  
  Revision  Changes    Path
  1.521     +7 -4      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.520
  retrieving revision 1.521
  diff -u -r1.520 -r1.521
  --- WHATSNEW	12 Jan 2004 10:19:45 -0000	1.520
  +++ WHATSNEW	12 Jan 2004 10:29:01 -0000	1.521
  @@ -1,5 +1,5 @@
  -Changes from Ant 1.6 to current cvs version
  -===========================================
  +Changes from Ant 1.6.0 to current cvs version
  +=============================================
   
   Changes that could break older environments:
   --------------------------------------------
  @@ -18,6 +18,9 @@
   
   * <whichresource> failed to load classes correctly.
   
  +* Ant could fail to start with a NullPointerException if
  +  ANT_HOME/lib/ant-launcher.jar was part of the system CLASSPATH.
  +
   Other changes:
   --------------
   * Translate task logs a debug message specifying the number of files
  @@ -33,8 +36,8 @@
   
   * <fixcrlf> has a new attribute - fixlast. Bugzilla Report 23262.
   
  -Changes from Ant 1.5.4 to Ant 1.6
  -=================================
  +Changes from Ant 1.5.4 to Ant 1.6.0
  +===================================
   
   Changes that could break older environments:
   --------------------------------------------
  
  
  
  1.7       +7 -2      ant/src/main/org/apache/tools/ant/launch/Locator.java
  
  Index: Locator.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/launch/Locator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Locator.java	12 Sep 2003 20:56:46 -0000	1.6
  +++ Locator.java	12 Jan 2004 10:29:01 -0000	1.7
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -105,7 +105,12 @@
               c = Locator.class.getClassLoader();
           }
   
  -        URL url = c.getResource(resource);
  +        URL url = null;
  +        if (c == null) {
  +            url = ClassLoader.getSystemResource(resource);
  +        } else {
  +            url = c.getResource(resource);
  +        }
           if (url != null) {
               String u = url.toString();
               if (u.startsWith("jar:file:")) {
  
  
  

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