RFR: JDK-8273194: Document the two possible cases when Lookup::ensureInitialized returns

Alan Bateman alanb at openjdk.java.net
Thu Sep 2 14:03:29 UTC 2021


On Wed, 1 Sep 2021 20:56:59 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> Improve the specification to document the cases when `Lookup::ensureInitialized` returns as specified JVMS 5.5 and matches the implementation.
> 
> Please also review CSR: https://bugs.openjdk.java.net/browse/JDK-8273253

src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 2787:

> 2785:          * This method returns when {@code targetClass} is fully initialized, or
> 2786:          * when {@code targetClass} is being initialized if this method is called
> 2787:          * by the initializing thread.

This looks okay but I wonder if it might be a bit clearer to say "when targetClass is being initialized on the current thread".

-------------

PR: https://git.openjdk.java.net/jdk/pull/5343


More information about the core-libs-dev mailing list