[12] RFR: 8214170: ResourceBundle.Control.newBundle should throw IllegalAccessException when constructor of the resource bundle is not public.

Mandy Chung mandy.chung at oracle.com
Tue Nov 27 20:23:37 UTC 2018

On 11/27/18 10:36 AM, naoto.sato at oracle.com wrote:
> Comment modified as suggested:
> http://cr.openjdk.java.net/~naoto/8214170/webrev.01/

What is the exception message?  I think it's 
"PrivateConstructorRB.<init>()" which would be confusing.

A better fix may be using getDeclaredConstructor and throw IAE if the 
constructor is not public in the place where it currently returns null.

I think you can simply drop the comment at line 3187.

If no-arg constructor does not exist, the javadoc does not specify its 
behavior (or I'm missing it?).   I believe the current behavior is 
consistent with JDK 8 behavior which throws NoSuchMethodException.  We 
should fix the spec to clarify no no-arg constructor case.


More information about the core-libs-dev mailing list