8308093: Disable language preview features use in JDK

Reviewed-by: liach, erikj, alanb, darcy
This commit is contained in:
Adam Sotona 2023-05-23 07:23:37 +00:00
parent 422128b70a
commit c4408278d1
12 changed files with 2 additions and 24 deletions

View File

@ -110,7 +110,6 @@ JAVA_WARNINGS_ARE_ERRORS ?= -Werror
JAVADOC_OPTIONS := -use -keywords -notimestamp \ JAVADOC_OPTIONS := -use -keywords -notimestamp \
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \ -encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
-splitIndex --system none -javafx --expand-requires transitive \ -splitIndex --system none -javafx --expand-requires transitive \
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION) \
--override-methods=summary \ --override-methods=summary \
--no-external-specs-page --no-external-specs-page
@ -118,7 +117,6 @@ JAVADOC_OPTIONS := -use -keywords -notimestamp \
# development cycle. # development cycle.
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \ REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \ -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION) \
-html5 -javafx --expand-requires transitive \ -html5 -javafx --expand-requires transitive \
--no-external-specs-page --no-external-specs-page

View File

@ -27,9 +27,7 @@ DISABLED_WARNINGS_java += this-escape
DOCLINT += -Xdoclint:all/protected \ DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*' '-Xdoclint/package:java.*,javax.*'
JAVAC_FLAGS += -XDstringConcat=inline \ JAVAC_FLAGS += -XDstringConcat=inline
--enable-preview
DISABLED_WARNINGS_java += preview
COPY += .icu .dat .spp .nrm content-types.properties \ COPY += .icu .dat .spp .nrm content-types.properties \
hijrah-config-Hijrah-umalqura_islamic-umalqura.properties hijrah-config-Hijrah-umalqura_islamic-umalqura.properties
CLEAN += intrinsic.properties CLEAN += intrinsic.properties

View File

@ -25,5 +25,3 @@
DISABLED_WARNINGS_java += missing-explicit-ctor DISABLED_WARNINGS_java += missing-explicit-ctor
JAVAC_FLAGS += -XDstringConcat=inline JAVAC_FLAGS += -XDstringConcat=inline
JAVAC_FLAGS += --enable-preview
DISABLED_WARNINGS_java += preview

View File

@ -150,7 +150,6 @@ module java.base {
java.compiler, java.compiler,
jdk.compiler, jdk.compiler,
jdk.incubator.vector, // participates in preview features jdk.incubator.vector, // participates in preview features
jdk.jartool, // participates in preview features
jdk.jshell; jdk.jshell;
exports jdk.internal.access to exports jdk.internal.access to
java.desktop, java.desktop,

View File

@ -106,8 +106,6 @@ public class ClassWriter extends ClassFile {
/** Type utilities. */ /** Type utilities. */
private Types types; private Types types;
private Symtab syms;
private Check check; private Check check;
/** /**
@ -174,7 +172,6 @@ public class ClassWriter extends ClassFile {
target = Target.instance(context); target = Target.instance(context);
source = Source.instance(context); source = Source.instance(context);
types = Types.instance(context); types = Types.instance(context);
syms = Symtab.instance(context);
check = Check.instance(context); check = Check.instance(context);
fileManager = context.get(JavaFileManager.class); fileManager = context.get(JavaFileManager.class);
poolWriter = Gen.instance(context).poolWriter; poolWriter = Gen.instance(context).poolWriter;
@ -1676,9 +1673,7 @@ public class ClassWriter extends ClassFile {
acount += writeExtraAttributes(c); acount += writeExtraAttributes(c);
poolbuf.appendInt(JAVA_MAGIC); poolbuf.appendInt(JAVA_MAGIC);
if (preview.isEnabled() && preview.usesPreview(c.sourcefile) if (preview.isEnabled() && preview.usesPreview(c.sourcefile)) {
// do not write PREVIEW_MINOR_VERSION for classes participating in preview
&& !preview.participatesInPreview(syms, c, syms.java_base.unnamedPackage)) {
poolbuf.appendChar(ClassFile.PREVIEW_MINOR_VERSION); poolbuf.appendChar(ClassFile.PREVIEW_MINOR_VERSION);
} else { } else {
poolbuf.appendChar(target.minorVersion); poolbuf.appendChar(target.minorVersion);

View File

@ -23,8 +23,6 @@
* questions. * questions.
*/ */
import jdk.internal.javac.ParticipatesInPreview;
/** /**
* Defines tools for manipulating Java Archive (JAR) files, * Defines tools for manipulating Java Archive (JAR) files,
* including the <em>{@index jar jar tool}</em> and * including the <em>{@index jar jar tool}</em> and
@ -49,7 +47,6 @@ import jdk.internal.javac.ParticipatesInPreview;
* @moduleGraph * @moduleGraph
* @since 9 * @since 9
*/ */
@ParticipatesInPreview
module jdk.jartool { module jdk.jartool {
requires jdk.internal.opt; requires jdk.internal.opt;

View File

@ -1,5 +1,4 @@
maxOutputSize = 2500000 maxOutputSize = 2500000
enablePreview = true
modules = \ modules = \
java.base/jdk.internal.classfile \ java.base/jdk.internal.classfile \
java.base/jdk.internal.classfile.attribute \ java.base/jdk.internal.classfile.attribute \
@ -8,6 +7,5 @@ modules = \
java.base/jdk.internal.classfile.impl \ java.base/jdk.internal.classfile.impl \
java.base/jdk.internal.classfile.impl.verifier \ java.base/jdk.internal.classfile.impl.verifier \
java.base/jdk.internal.classfile.components \ java.base/jdk.internal.classfile.components \
java.base/jdk.internal.classfile.util \
java.base/jdk.internal.org.objectweb.asm \ java.base/jdk.internal.org.objectweb.asm \
java.base/jdk.internal.org.objectweb.asm.tree java.base/jdk.internal.org.objectweb.asm.tree

View File

@ -46,7 +46,6 @@ import org.openjdk.jmh.annotations.Warmup;
@Warmup(iterations = 2) @Warmup(iterations = 2)
@Measurement(iterations = 4) @Measurement(iterations = 4)
@Fork(value = 1, jvmArgsAppend = { @Fork(value = 1, jvmArgsAppend = {
"--enable-preview",
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED",

View File

@ -56,7 +56,6 @@ import org.openjdk.jmh.annotations.Warmup;
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@State(Scope.Benchmark) @State(Scope.Benchmark)
@Fork(value = 1, jvmArgsAppend = { @Fork(value = 1, jvmArgsAppend = {
"--enable-preview",
"--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile.attribute=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile.attribute=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED",

View File

@ -40,7 +40,6 @@ import org.openjdk.jmh.annotations.*;
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@State(Scope.Benchmark) @State(Scope.Benchmark)
@Fork(value = 1, jvmArgsAppend = { @Fork(value = 1, jvmArgsAppend = {
"--enable-preview",
"--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile.instruction=ALL-UNNAMED"}) "--add-exports", "java.base/jdk.internal.classfile.instruction=ALL-UNNAMED"})

View File

@ -39,7 +39,6 @@ import org.openjdk.jmh.annotations.*;
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@State(Scope.Benchmark) @State(Scope.Benchmark)
@Fork(value = 1, jvmArgsAppend = { @Fork(value = 1, jvmArgsAppend = {
"--enable-preview",
"--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile.components=ALL-UNNAMED"}) "--add-exports", "java.base/jdk.internal.classfile.components=ALL-UNNAMED"})
@Warmup(iterations = 3) @Warmup(iterations = 3)

View File

@ -66,7 +66,6 @@ import static jdk.internal.org.objectweb.asm.Opcodes.V12;
@Warmup(iterations = 3) @Warmup(iterations = 3)
@Measurement(iterations = 5) @Measurement(iterations = 5)
@Fork(value = 1, jvmArgsAppend = { @Fork(value = 1, jvmArgsAppend = {
"--enable-preview",
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.classfile=ALL-UNNAMED",