[9] RFR: 8171139: Simplify ResourceBundle.CacheKey and ClassLoader may not be needed
Mandy Chung
mandy.chung at oracle.com
Thu Jan 12 02:55:59 UTC 2017
> On Jan 11, 2017, at 5:45 PM, Naoto Sato <naoto.sato at oracle.com> wrote:
>
> Decided to include the fix to 8171140 [1] as well, as they are closely related. Here is the updated webrev.
>
> http://cr.openjdk.java.net/~naoto/8171139.8171140/webrev.01/
>
> Additional changes to the version 00 are to mainly remove clearCache(Module) method, as clearCache() is chiefly used in combination with ResourceBundle.Control, which is not supported in named modules. Still named modules can issue clearCache() with no argument which will result in the same effect. Also, other clearCache() overloads have clearer method descriptions.
I think removing the clearCache(Module) method and have the clearCache() method removing the resource bundles loaded by the caller’s module is reasonable. For unnamed module loaded by the application class loader as the caller, the no-arg clearCache will remove the resource bundles loaded from the classpath. Comparing to JDK 8, it does not remove resource bundles from the JDK modules that used to be in tools.jar. IMO this behavioral difference is a good one.
2179 @CallerSensitive
2180 public static final void clearCache(ClassLoader loader) {
2181 Objects.requireNonNull(loader);
2182 Class<?> caller = Reflection.getCallerClass();
2183 clearCacheImpl(null, loader);
2184 }
The clearCache(ClassLoader) method no longer needs to be caller-sensitive. @CS should be removed, line 2179 and 2182 should be removed.
With this change, I think clearCacheImpl is not as useful. I suggest to do the removal in the clearCache method body.
It’s okay to push the changesets for two issues together. It’d be useful to generate a webrev against JDK-8171139 to contain the change in clearCache for JDK-8171140.
thanks
Mandy
More information about the core-libs-dev
mailing list