JDK-4184193 : (cl spec) ClassLoader.getSystemResource() and findSystemClass() refer to 1.1
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:class_loading
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-10-25
  • Updated: 2012-10-08
  • Resolved: 2003-01-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 b14Fixed
Description
The javadoc for public static URL getSystemResource(String name)  reads:
    * In JDK1.1, the search path used is that of the virtual machine's
     * built-in class loader.<p>
     *
     * Since JDK1.2, this method locates the resource through the system class
     * loader (see {@link #getSystemClassLoader()}).

The comment in JDK1.1 is either not clear or wrong. In 1.1, does the VM's built in class loader see the application classpath too? If so, then there is no diff
between 1.1 and 1.2. If not, then this contradicts the actual behavior.
Here's a test program that calls this method. If you have a index.html
file in the application's classpath (set using CLASSPATH env var),
then getResource() will see it (albeit giving it some weird URL).Here's the
sample output:

alto# set path = (/usr/local/java/jdk1.1.7/solaris/bin $path)
alto# java Main
systemresource:/FILE0/+/index.html
alto<# mv index.html /tmp
alto# setenv CLASSPATH /tmp\:.
alto# java Main
systemresource:/FILE0/+/index.html
alto# unsetenv CLASSPATH
alto# java Main
null
alto# cat Main.java
public class Main {
    public static void main(String[] args) {
	System.out.println(
	ClassLoader.getSystemResource("index.html"));
    }
}

Other related methods in ClassLoader use similar wording and should
be fix if these comments are changed.



Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis-beta FIXED IN: mantis-beta INTEGRATED IN: mantis-b14 mantis-beta
14-06-2004

EVALUATION Any reference to behaviour in 1.1 (or any other release which is not the current release) should be removed from the specification. This should be addressed in the next available release. -- iag@sfbay 2002-05-21
21-05-2002