8265130: Make ConstantDesc class hierarchy sealed

Reviewed-by: mchung, jvernee, vromero
This commit is contained in:
Gavin Bierman 2021-06-02 00:49:49 +00:00 committed by Vicente Romero
parent 00c7aeee00
commit 379376f078
6 changed files with 25 additions and 38 deletions

View file

@ -46,14 +46,11 @@ import static java.lang.invoke.MethodHandleInfo.REF_putStatic;
* {@link MethodHandle}. A {@linkplain DirectMethodHandleDesc} corresponds to
* a {@code Constant_MethodHandle_info} entry in the constant pool of a classfile.
*
* @apiNote In the future, if the Java language permits, {@linkplain DirectMethodHandleDesc}
* may become a {@code sealed} interface, which would prohibit subclassing except
* by explicitly permitted types. Non-platform classes should not implement
* {@linkplain DirectMethodHandleDesc} directly.
*
* @since 12
*/
public interface DirectMethodHandleDesc extends MethodHandleDesc {
public sealed interface DirectMethodHandleDesc
extends MethodHandleDesc
permits DirectMethodHandleDescImpl {
/**
* Kinds of method handles that can be described with {@linkplain DirectMethodHandleDesc}.
*