Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4184193
Votes 1
Synopsis (cl spec) ClassLoader.getSystemResource() and findSystemClass() refer to 1.1
Category java:classes_lang
Reported Against 1.2fcs
Release Fixed 1.4.2(mantis-b14)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 25-OCT-1998
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.

Work Around
N/A
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.

--  xxxxx@xxxxx  2002-05-21
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang