On 11/27/18 2:43 PM, naoto.s...@oracle.com wrote:
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.
The javadoc is not specifically mention for the no-arg constructor
case, but specifies to throw the Error/Exception wrt the instantiation
failure:
"If a resource bundle can't be instantiated due to an unexpected
error, the error must be reported by throwing an Error or Exception
rather than simply returning null."
The current behavior is inconsistent with the releases prior to JDK9,
as it silently ignores NoSuchMethodException and returns null, while
JDK8 throws IAE.
There are two cases:
1. PrivateConstructorRB has a private no-arg constructor
This is the bug this issue reports.
2. PrivateConstructorRB does not have any no-arg constructor (you have
to create a new test case for it)
I believe the behavior is not changed in JDK 9. It throws
NoSuchMethodException (not ignored).
Mandy