United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4184193 : (cl spec) ClassLoader.getSystemResource() and findSystemClass() refer to 1.1

Details
Type:
Bug
Submit Date:
1998-10-25
Status:
Resolved
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2003-01-22
Component:
core-libs
OS:
solaris_2.6
Sub-Component:
java.lang:class_loading
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.0
Fixed Versions:
1.4.2 (b14)

Related Reports

Sub Tasks

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


                                     
2004-06-14
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
                                     
2002-05-21



Hardware and Software, Engineered to Work Together