JDK-5077773 : Change in behaviour w.r.t jdk1.4.2 when loading resourcebundles
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_9
  • CPU: generic
  • Submitted: 2004-07-23
  • Updated: 2017-05-16
  • Resolved: 2004-08-03
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
5.0 b62Fixed
Related Reports
Relates :  
Description
Change in behaviour w.r.t jdk1.4.2 when loading resourcebundles . test case is attached.
Classpath is given precedence over endorsed.

java -Djava.endorsed.dirs=<..>/test_prop.jar -classpath test_prop_with_ch.jar t
###@###.### 2004-07-23
###@###.### 2004-07-23

use following command
gzip -d <attached_fileName>.
jar xvf bug.jar.
This contains the testcase.
>/test_prop.jar and test_prop_with_ch.jar contain properties file which the testcase tries to load. The key from the property file the testcase tries to load is present in test_prop.jar .


To reproduce the problem try
java -Djava.endorsed.dirs=<PATH_to directory where test_prop.jar is present > -classpath test_prop_with_ch.jar t
###@###.### 2004-07-23

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b62 tiger-rc
20-09-2004

EVALUATION I have tried running the attached files. It is not clear how to do that. Please provide complete command-line for unpacking attached file and running the example. ###@###.### 2004-07-23 The following is the behavior change mentioned in Description. $ java -showversion -Djava.endorsed.dirs=. -classpath test_prop_with_ch.jar:. t java version "1.4.2" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28) Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode) PROP:java.util.PropertyResourceBundle@15ff48b:: null RES STRING src-attribute_group: Attribute group ''{0}'' does not conform to the schema for schemas. Element ''{1}'' is invalid or misplaced. $ java -showversion -Djava.endorsed.dirs=. -classpath test_prop_with_ch.jar:. t java version "1.5.0-beta3" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b59) Java HotSpot(TM) Server VM (build 1.5.0-beta3-b59, mixed mode) PROP:java.util.PropertyResourceBundle@19f953d:: null Exception in thread "main" java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key src-attribute_group at java.util.ResourceBundle.getObject(ResourceBundle.java:326) at java.util.ResourceBundle.getString(ResourceBundle.java:286) at t.main(t.java:15) ###@###.### 2004-07-24 Both 1.4.2_04 and 1.4.2_05 seem to work Okay. $ java -showversion -Djava.endorsed.dirs=. -classpath test_prop_with_ch.jar:. t java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) PROP:java.util.PropertyResourceBundle@15ff48b:: null RES STRING src-attribute_group: Attribute group ''{0}'' does not conform to the schema for schemas. Element ''{1}'' is invalid or misplaced. $ java -showversion -Djava.endorsed.dirs=. -classpath test_prop_with_ch.jar:. t java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04) Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode) PROP:java.util.PropertyResourceBundle@15ff48b:: null RES STRING src-attribute_group: Attribute group ''{0}'' does not conform to the schema for schemas. Element ''{1}'' is invalid or misplaced. Since ResourceBundle.getBundle just invokes ClassLoader.getResourceAsStream to load property files. I'm transferring this bug report to classes_lang for further evaluation. ###@###.### 2004-07-27 This problem was introduced in b28 by the fix for this bug: 4912903: The jar file gets downloaded for every ImageIcon(URL) constructor It appears that the fix changed the implemenation of ClassLoader.getResourceAsStream and added an override method URLClassLoader.getResourceAsStream. I have verified that this bug is not reproducible in a b60 workspace if the implementation of ClassLoader.getResourceAsStream is reverted and the new method in URLClassLoader is commented out. Routing to the group which fixed bug 4912903. -- iag@sfbay 2004-07-27 Backing out fix for 4912903 ###@###.### 2004-08-02
27-07-2004