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

@ -49,18 +49,15 @@ import static java.util.stream.Collectors.joining;
* {@linkplain ClassDesc} for the component type and then call the {@link #arrayType()}
* or {@link #arrayType(int)} methods.
*
* @apiNote In the future, if the Java language permits, {@linkplain ClassDesc}
* may become a {@code sealed} interface, which would prohibit subclassing except
* by explicitly permitted types. Non-platform classes should not implement
* {@linkplain ClassDesc} directly.
*
* @see ConstantDescs
*
* @since 12
*/
public interface ClassDesc
public sealed interface ClassDesc
extends ConstantDesc,
TypeDescriptor.OfField<ClassDesc> {
TypeDescriptor.OfField<ClassDesc>
permits PrimitiveClassDescImpl,
ReferenceClassDescImpl {
/**
* Returns a {@linkplain ClassDesc} for a class or interface type,