JDK-4175293 : (rb) RFE: ResourceBundles shouldn't have to be public.
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 6
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 1998-09-22
  • Updated: 2005-05-23
  • Resolved: 2005-05-23
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.
JDK 6
6 b38Fixed
Related Reports
Relates :  
Description
allan.jacobs@Eng 1998-09-21

Classes that extend ResourceBundle do not work unless they grant
public access.  This makes it impossible to do information hiding
on internationalization classes.  And, it means that the various
internationalizations have to be in separate files.

Source code is attached.


algol% Z.ksh
java full version "JDK-1.2fcs-J"
SunOS algol 5.6 Generic sun4u sparc SUNW,Ultra-2
en_US
jvs.ch21.KrB@4895d5a3
jvs.ch21.KrB_en_GB@4fbdd5a3
jvs.ch21.KrB_fr@4391d5a3
        1
        Default
        Extra
        Exit
        2
        _C_
en_UK
        UK
        The Exit
        1
        _C_
        2
        Extra
fr
        France
        Le Exit
        2
        _C_
        3
        Extra
Exception in thread "main" java.util.MissingResourceException: can't find resource for jvs.ch21.JrB_en_US
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:411)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:341)
        at jvs.ch21.Y.test(Y.java:14)
        at jvs.ch21.Y.main(Y.java:7)

Comments
EVALUATION The problem is that ResourceBundle's getBundle and findBundle methods must load and call methods from outside (non-package) classes. The current security mechanism prevents a class from accessing non public classes methods in other packages. It may be possible to work around this limitation by subclassing ResourceBundle in the package that also contains the actual ListResourceBundles. I'll look into this. john.oconner@Eng 1999-08-31 Introduced new nested class ResourceBundle.Control that allows you to customize the bundle loading process. ResourceBundle.Control.newBundle could be overridden to load package private classes. Please refer to its API doc for detail. ###@###.### 2005-05-17 03:19:17 GMT
17-05-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
06-08-2004