Browse Source

Class.getClassLoader may return null for the system classloader

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275899 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
dfb102a12e
2 changed files with 14 additions and 6 deletions
  1. +7
    -4
      WHATSNEW
  2. +7
    -2
      src/main/org/apache/tools/ant/launch/Locator.java

+ 7
- 4
WHATSNEW View File

@@ -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 @@ Fixed bugs:

* <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 @@ Other changes:

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


+ 7
- 2
src/main/org/apache/tools/ant/launch/Locator.java View File

@@ -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 @@ public final class Locator {
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:")) {


Loading…
Cancel
Save