[9] RFR: 8171139: Simplify ResourceBundle.CacheKey and ClassLoader may not be needed

Mandy Chung mandy.chung at oracle.com
Fri Jan 13 21:25:06 UTC 2017


> On Jan 12, 2017, at 1:20 PM, Naoto Sato <naoto.sato at oracle.com> wrote:
> 
> Realized moduleRef & callerRef would never be null with this new version. Thus modified the patch as:
> 
> http://cr.openjdk.java.net/~naoto/8171139/webrev.03/

CacheKey
   Nit: line 576 can be moved after 581 to group the volatile fields together

 619             this(src.getName(), src.getLocale(), src.getModule(), src.getCallerModule());

Daniel asks whether there is any possibility that the target module or caller module would be GC’ed.

CacheKey is copied in two places, one in findBundle and the other is putBundleInCache which is actually passed with a newly cloned CacheKey.  IIUC, the cacheKey passed to findBundle ia always a new instance (as it subsequently sets to different locale during the lookup).  Its caller module is the caller on the stack and the target module is also a strong reference either caller’s module, unnamed module from a given class loader, or a given module.

Naoto will have to double check.

Otherwise look fine.
Mandy


More information about the core-libs-dev mailing list