RFR: 8212117 : Class.forName may return a reference to a loaded but not linked Class

Mandy Chung mandy.chung at oracle.com
Fri Sep 6 00:26:35 UTC 2019


On 9/4/19 2:12 PM, Brent Christian wrote:
>
>
> There is also a CSR[2] in need of review.

The javadoc for Lookup::findClass:

"In particular, the method first attempts to load the requested class"

I think this sentence is no longer needed together with your change.  
What about:

          /**
-         * Looks up a class by name from the lookup context defined by this {@code Lookup} object. The static
-         * initializer of the class is not run.
+         * Looks up a class by name from the lookup context defined by this {@code Lookup} object.
+         * This method attempts to locate, load, and link the class, and then determines whether
+         * the class is accessible to this {@code Lookup} object.
+         * The static initializer of the class is not run.
           * <p>
           * The lookup context here is determined by the {@linkplain #lookupClass() lookup class}, its class
-         * loader, and the {@linkplain #lookupModes() lookup modes}. In particular, the method first attempts to
-         * load the requested class, and then determines whether the class is accessible to this lookup object.
+         * loader, and the {@linkplain #lookupModes() lookup modes}.


The note you added in this method should also be added to 2-arg 
Class::forName for consistency.

We should add @jls as Joe suggests.

Mandy



More information about the hotspot-dev mailing list