-
Bug
-
Resolution: Fixed
-
P4
-
8u172
-
b01
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8214647 | 8u211 | Robert Mckenna | P4 | Resolved | Fixed | b01 |
JDK-8220993 | emb-8u211 | Robert Mckenna | P4 | Resolved | Fixed | master |
Inside the CacheKey object in the getBundleImpl method in the ResourceBundle class, we use a soft reference that can result in the ClassLoader object getting GC'd before we're done with it.
This can result in us getting the wrong result back, like if we asked for "Stuff" with the locale "fr, CA" and got back "Stuff_fr.class" instead of "Stuff_fr_CA.class".
-- Example Fix:
One fix proven to work is to create a static, volatile Object with global scope in ResourceBundle, and compare it ("==" style) to the loader right before it gets returned from getBundleImpl.
The result of the compare can be something direct like "throw new Error("Unexpected error.")", as this compare should never return true.
-- Only seen on...
This defect is only seen on JDK8, on ppcle and zLinux, and hasn't yet been seen using the Hotspot
VM (defect found using OpenJ9 VM).
Due to a redesign of this class in JDK9, this bug is fixed in JDK9 and up.
This can result in us getting the wrong result back, like if we asked for "Stuff" with the locale "fr, CA" and got back "Stuff_fr.class" instead of "Stuff_fr_CA.class".
-- Example Fix:
One fix proven to work is to create a static, volatile Object with global scope in ResourceBundle, and compare it ("==" style) to the loader right before it gets returned from getBundleImpl.
The result of the compare can be something direct like "throw new Error("Unexpected error.")", as this compare should never return true.
-- Only seen on...
This defect is only seen on JDK8, on ppcle and zLinux, and hasn't yet been seen using the Hotspot
VM (defect found using OpenJ9 VM).
Due to a redesign of this class in JDK9, this bug is fixed in JDK9 and up.
- backported by
-
JDK-8214647 JCK Test Failure due to ResourceBundle
- Resolved
-
JDK-8220993 JCK Test Failure due to ResourceBundle
- Resolved