mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8250768: javac should be adapted to changes in JEP 12
Reviewed-by: mcimadamore, erikj, jjg, ihse
This commit is contained in:
parent
18a37f9453
commit
235488215b
133 changed files with 3109 additions and 1080 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -4387,13 +4387,6 @@ public final class Class<T> implements java.io.Serializable,
|
|||
public native boolean isHidden();
|
||||
|
||||
/**
|
||||
* {@preview Associated with sealed classes, a preview feature of the Java language.
|
||||
*
|
||||
* This method is associated with <i>sealed classes</i>, a preview
|
||||
* feature of the Java language. Preview features
|
||||
* may be removed in a future release, or upgraded to permanent
|
||||
* features of the Java language.}
|
||||
*
|
||||
* Returns an array containing {@code Class} objects representing the
|
||||
* direct subinterfaces or subclasses permitted to extend or
|
||||
* implement this class or interface if it is sealed. The order of such elements
|
||||
|
@ -4429,7 +4422,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
* @jls 9.1 Interface Declarations
|
||||
* @since 15
|
||||
*/
|
||||
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SEALED_CLASSES, essentialAPI=false)
|
||||
@jdk.internal.javac.PreviewFeature(feature=jdk.internal.javac.PreviewFeature.Feature.SEALED_CLASSES, reflective=true)
|
||||
@CallerSensitive
|
||||
public Class<?>[] getPermittedSubclasses() {
|
||||
Class<?>[] subClasses;
|
||||
|
@ -4469,13 +4462,6 @@ public final class Class<T> implements java.io.Serializable,
|
|||
}
|
||||
|
||||
/**
|
||||
* {@preview Associated with sealed classes, a preview feature of the Java language.
|
||||
*
|
||||
* This method is associated with <i>sealed classes</i>, a preview
|
||||
* feature of the Java language. Preview features
|
||||
* may be removed in a future release, or upgraded to permanent
|
||||
* features of the Java language.}
|
||||
*
|
||||
* Returns {@code true} if and only if this {@code Class} object represents
|
||||
* a sealed class or interface. If this {@code Class} object represents a
|
||||
* primitive type, {@code void}, or an array type, this method returns
|
||||
|
@ -4489,7 +4475,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
* @jls 9.1 Interface Declarations
|
||||
* @since 15
|
||||
*/
|
||||
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SEALED_CLASSES, essentialAPI=false)
|
||||
@jdk.internal.javac.PreviewFeature(feature=jdk.internal.javac.PreviewFeature.Feature.SEALED_CLASSES, reflective=true)
|
||||
@SuppressWarnings("preview")
|
||||
public boolean isSealed() {
|
||||
if (isArray() || isPrimitive()) {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
package jdk.internal;
|
||||
package jdk.internal.javac;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public @interface PreviewFeature {
|
|||
*/
|
||||
public Feature feature();
|
||||
|
||||
public boolean essentialAPI() default false;
|
||||
public boolean reflective() default false;
|
||||
|
||||
public enum Feature {
|
||||
// 8242284:
|
||||
|
@ -68,6 +68,10 @@ public @interface PreviewFeature {
|
|||
// necessary for PreviewFeature in JDK 16 to declare the enum constant.
|
||||
RECORDS,
|
||||
SEALED_CLASSES,
|
||||
/**
|
||||
* A key for testing.
|
||||
*/
|
||||
TEST,
|
||||
;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -138,10 +138,9 @@ module java.base {
|
|||
jdk.incubator.foreign;
|
||||
exports com.sun.security.ntlm to
|
||||
java.security.sasl;
|
||||
exports jdk.internal to // for @HotSpotIntrinsicCandidate
|
||||
exports jdk.internal.javac to
|
||||
java.compiler,
|
||||
jdk.compiler,
|
||||
jdk.incubator.vector,
|
||||
jdk.jshell;
|
||||
exports jdk.internal.access to
|
||||
java.desktop,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue