RFR 8233272 : The Class.forName specification should be updated to match the long-standing implementation with respect to class linking
mandy.chung at oracle.com
Thu Nov 14 16:22:36 UTC 2019
On 11/13/19 10:37 AM, Brent Christian wrote:
> Recently, the 2-arg and 3-arg Class.forName() methods were updated
> to perform class linking, per the specification. However this change
> had to be reverted.
> Instead, let's clarify the Class.forName() spec not to guarantee
> linking (outside the case of also performing initialization, of
> course). This is the long-standing behavior.
> I also have a test of the non-linking behavior; it's based on the test
> case for JDK-8231924. It fails as of 14b14 (8212117) and passes as
> of 14b22 (8233091).
> Please review my webrev:
> If the wording looks good, I'll fill in the Specification for the
> CSR I've started.
The spec change looks fine.
As for the test, I expect that it simply calls Class.forName("Provider",
false, ucl) and then should succeed.
Then calling Class.forName("Provider", true, ucl) should fail with an
error (I think it's EIIE with NCDFE?). This way it verifies that
initialization/linking does cause NCDFE during verification while
Class.forName does not do linking if initialize=false.
More information about the hotspot-dev