8386601: Rename LANGUAGE_MODEL preview feature to PREVIEW_SUPPORT

Reviewed-by: hannesw, vromero
This commit is contained in:
Chen Liang 2026-06-12 18:25:24 +00:00
parent a81ccf89d7
commit 3bd0923ca8
11 changed files with 24 additions and 12 deletions

View File

@ -57,6 +57,11 @@ public @interface PreviewFeature {
*/
public Feature feature();
/**
* A reflective preview API may be used without causing a compilation error
* when preview features are disabled (JLS {@jls 1.5.1}), but still causes
* a preview warning.
*/
public boolean reflective() default false;
/**
@ -71,7 +76,14 @@ public @interface PreviewFeature {
@JEP(number=538, title="PEM Encodings of Cryptographic Objects",
status="Third Preview")
PEM_API,
LANGUAGE_MODEL,
/**
* Indicates a preview API exists to allow access to the environment
* where all preview features of the current Java SE release are enabled.
* Such an API is usually {@link #reflective()} and never intended to
* become permanent. This "feature" does not have a JEP and its APIs
* are not displayed in the "Preview API" page in Javadoc output.
*/
PREVIEW_SUPPORT,
/**
* A key for testing.
*/

View File

@ -51,7 +51,7 @@ import javax.annotation.processing.ProcessingEnvironment;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public abstract class AbstractAnnotationValueVisitorPreview<R, P> extends AbstractAnnotationValueVisitor14<R, P> {
/**

View File

@ -54,7 +54,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public abstract class AbstractElementVisitorPreview<R, P> extends AbstractElementVisitor14<R, P> {
/**
* Constructor for concrete subclasses to call.

View File

@ -54,7 +54,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public abstract class AbstractTypeVisitorPreview<R, P> extends AbstractTypeVisitor14<R, P> {
/**
* Constructor for concrete subclasses to call.

View File

@ -68,7 +68,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public class ElementKindVisitorPreview<R, P> extends ElementKindVisitor14<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the

View File

@ -82,7 +82,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public class ElementScannerPreview<R, P> extends ElementScanner14<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the

View File

@ -59,7 +59,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public class SimpleAnnotationValueVisitorPreview<R, P> extends SimpleAnnotationValueVisitor14<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the

View File

@ -62,7 +62,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public class SimpleElementVisitorPreview<R, P> extends SimpleElementVisitor14<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the

View File

@ -63,7 +63,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public class SimpleTypeVisitorPreview<R, P> extends SimpleTypeVisitor14<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the

View File

@ -67,7 +67,7 @@ import static javax.lang.model.SourceVersion.*;
* @since 23
*/
@SupportedSourceVersion(RELEASE_28)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
@PreviewFeature(feature=PreviewFeature.Feature.PREVIEW_SUPPORT, reflective=true)
public class TypeKindVisitorPreview<R, P> extends TypeKindVisitor14<R, P> {
/**
* Constructor for concrete subclasses to call; uses {@code null}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2026, 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
@ -36,6 +36,6 @@ public class NoPreview {
public static class T {}
// Preview support feature without JEP should not be listed
@PreviewFeature(feature=Feature.LANGUAGE_MODEL)
@PreviewFeature(feature=Feature.PREVIEW_SUPPORT)
public void supportMethod() {}
}