8267465: remove superfluous preview related annotations and test options
Reviewed-by: jlahoda
This commit is contained in:
parent
728a411a54
commit
4f9d6b7d68
@ -193,7 +193,6 @@ public class TreeScanner<R,P> implements TreeVisitor<R,P> {
|
|||||||
* @param p {@inheritDoc}
|
* @param p {@inheritDoc}
|
||||||
* @return the result of scanning
|
* @return the result of scanning
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("preview")
|
|
||||||
@Override
|
@Override
|
||||||
public R visitClass(ClassTree node, P p) {
|
public R visitClass(ClassTree node, P p) {
|
||||||
R r = scan(node.getModifiers(), p);
|
R r = scan(node.getModifiers(), p);
|
||||||
|
@ -415,7 +415,6 @@ public class Flags {
|
|||||||
LocalVarFlags = FINAL | PARAMETER,
|
LocalVarFlags = FINAL | PARAMETER,
|
||||||
ReceiverParamFlags = PARAMETER;
|
ReceiverParamFlags = PARAMETER;
|
||||||
|
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public static Set<Modifier> asModifierSet(long flags) {
|
public static Set<Modifier> asModifierSet(long flags) {
|
||||||
Set<Modifier> modifiers = modifierSets.get(flags);
|
Set<Modifier> modifiers = modifierSets.get(flags);
|
||||||
if (modifiers == null) {
|
if (modifiers == null) {
|
||||||
|
@ -1472,7 +1472,6 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
|
|
||||||
|
|
||||||
@DefinedBy(Api.LANGUAGE_MODEL)
|
@DefinedBy(Api.LANGUAGE_MODEL)
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public ElementKind getKind() {
|
public ElementKind getKind() {
|
||||||
apiComplete();
|
apiComplete();
|
||||||
long flags = flags();
|
long flags = flags();
|
||||||
@ -1521,7 +1520,6 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public List<? extends RecordComponent> getRecordComponents() {
|
public List<? extends RecordComponent> getRecordComponents() {
|
||||||
return recordComponents;
|
return recordComponents;
|
||||||
}
|
}
|
||||||
@ -1705,7 +1703,6 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
} else if (isResourceVariable()) {
|
} else if (isResourceVariable()) {
|
||||||
return ElementKind.RESOURCE_VARIABLE;
|
return ElementKind.RESOURCE_VARIABLE;
|
||||||
} else if ((flags & MATCH_BINDING) != 0) {
|
} else if ((flags & MATCH_BINDING) != 0) {
|
||||||
@SuppressWarnings("preview")
|
|
||||||
ElementKind kind = ElementKind.BINDING_VARIABLE;
|
ElementKind kind = ElementKind.BINDING_VARIABLE;
|
||||||
return kind;
|
return kind;
|
||||||
} else {
|
} else {
|
||||||
@ -1774,7 +1771,6 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public static class RecordComponent extends VarSymbol implements RecordComponentElement {
|
public static class RecordComponent extends VarSymbol implements RecordComponentElement {
|
||||||
public MethodSymbol accessor;
|
public MethodSymbol accessor;
|
||||||
public JCTree.JCMethodDecl accessorMeth;
|
public JCTree.JCMethodDecl accessorMeth;
|
||||||
@ -1817,7 +1813,6 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public ElementKind getKind() {
|
public ElementKind getKind() {
|
||||||
return ElementKind.RECORD_COMPONENT;
|
return ElementKind.RECORD_COMPONENT;
|
||||||
}
|
}
|
||||||
@ -1828,7 +1823,6 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
|
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
|
||||||
return v.visitRecordComponent(this, p);
|
return v.visitRecordComponent(this, p);
|
||||||
}
|
}
|
||||||
|
@ -3344,7 +3344,6 @@ public class Check {
|
|||||||
return targets.isEmpty() || targets.isPresent() && !targets.get().isEmpty();
|
return targets.isEmpty() || targets.isPresent() && !targets.get().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("preview")
|
|
||||||
Optional<Set<Name>> getApplicableTargets(JCAnnotation a, Symbol s) {
|
Optional<Set<Name>> getApplicableTargets(JCAnnotation a, Symbol s) {
|
||||||
Attribute.Array arr = getAttributeTargetAttribute(a.annotationType.type.tsym);
|
Attribute.Array arr = getAttributeTargetAttribute(a.annotationType.type.tsym);
|
||||||
Name[] targets;
|
Name[] targets;
|
||||||
|
@ -971,7 +971,6 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
|
|||||||
* Computes the set of annotations on the symbol in question.
|
* Computes the set of annotations on the symbol in question.
|
||||||
* Leave class public for external testing purposes.
|
* Leave class public for external testing purposes.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public static class ComputeAnnotationSet extends
|
public static class ComputeAnnotationSet extends
|
||||||
ElementScanner14<Set<TypeElement>, Set<TypeElement>> {
|
ElementScanner14<Set<TypeElement>, Set<TypeElement>> {
|
||||||
final Elements elements;
|
final Elements elements;
|
||||||
|
@ -123,7 +123,6 @@ public class JavacRoundEnvironment implements RoundEnvironment {
|
|||||||
throwIfNotAnnotation(a);
|
throwIfNotAnnotation(a);
|
||||||
|
|
||||||
Set<Element> result = Collections.emptySet();
|
Set<Element> result = Collections.emptySet();
|
||||||
@SuppressWarnings("preview")
|
|
||||||
var scanner = new AnnotationSetScanner(result);
|
var scanner = new AnnotationSetScanner(result);
|
||||||
|
|
||||||
for (Element element : rootElements)
|
for (Element element : rootElements)
|
||||||
@ -144,7 +143,6 @@ public class JavacRoundEnvironment implements RoundEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Set<Element> result = Collections.emptySet();
|
Set<Element> result = Collections.emptySet();
|
||||||
@SuppressWarnings("preview")
|
|
||||||
var scanner = new AnnotationSetMultiScanner(result);
|
var scanner = new AnnotationSetMultiScanner(result);
|
||||||
|
|
||||||
for (Element element : rootElements)
|
for (Element element : rootElements)
|
||||||
@ -154,7 +152,6 @@ public class JavacRoundEnvironment implements RoundEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Could be written as a local class inside getElementsAnnotatedWith
|
// Could be written as a local class inside getElementsAnnotatedWith
|
||||||
@SuppressWarnings("preview")
|
|
||||||
private class AnnotationSetScanner extends
|
private class AnnotationSetScanner extends
|
||||||
ElementScanner14<Set<Element>, TypeElement> {
|
ElementScanner14<Set<Element>, TypeElement> {
|
||||||
// Insertion-order preserving set
|
// Insertion-order preserving set
|
||||||
@ -190,7 +187,6 @@ public class JavacRoundEnvironment implements RoundEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Could be written as a local class inside getElementsAnnotatedWithAny
|
// Could be written as a local class inside getElementsAnnotatedWithAny
|
||||||
@SuppressWarnings("preview")
|
|
||||||
private class AnnotationSetMultiScanner extends
|
private class AnnotationSetMultiScanner extends
|
||||||
ElementScanner14<Set<Element>, Set<TypeElement>> {
|
ElementScanner14<Set<Element>, Set<TypeElement>> {
|
||||||
// Insertion-order preserving set
|
// Insertion-order preserving set
|
||||||
|
@ -88,7 +88,6 @@ public class PrintingProcessor extends AbstractProcessor {
|
|||||||
/**
|
/**
|
||||||
* Used for the -Xprint option and called by Elements.printElements
|
* Used for the -Xprint option and called by Elements.printElements
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public static class PrintingElementVisitor
|
public static class PrintingElementVisitor
|
||||||
extends SimpleElementVisitor14<PrintingElementVisitor, Boolean> {
|
extends SimpleElementVisitor14<PrintingElementVisitor, Boolean> {
|
||||||
int indentation; // Indentation level;
|
int indentation; // Indentation level;
|
||||||
|
@ -818,7 +818,6 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
|
|||||||
@Override
|
@Override
|
||||||
public void accept(Visitor v) { v.visitClassDef(this); }
|
public void accept(Visitor v) { v.visitClassDef(this); }
|
||||||
|
|
||||||
@SuppressWarnings("preview")
|
|
||||||
@DefinedBy(Api.COMPILER_TREE)
|
@DefinedBy(Api.COMPILER_TREE)
|
||||||
public Kind getKind() {
|
public Kind getKind() {
|
||||||
if ((mods.flags & Flags.ANNOTATION) != 0)
|
if ((mods.flags & Flags.ANNOTATION) != 0)
|
||||||
|
@ -52,7 +52,6 @@ import com.sun.tools.sjavac.pubapi.TypeDesc;
|
|||||||
* This code and its internal interfaces are subject to change or
|
* This code and its internal interfaces are subject to change or
|
||||||
* deletion without notice.</b>
|
* deletion without notice.</b>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("preview")
|
|
||||||
public class PubapiVisitor extends ElementScanner14<Void, Void> {
|
public class PubapiVisitor extends ElementScanner14<Void, Void> {
|
||||||
|
|
||||||
private PubApi collectedApi = new PubApi();
|
private PubApi collectedApi = new PubApi();
|
||||||
@ -124,7 +123,6 @@ public class PubapiVisitor extends ElementScanner14<Void, Void> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("preview")
|
|
||||||
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
||||||
public Void visitRecordComponent(RecordComponentElement e, Void p) {
|
public Void visitRecordComponent(RecordComponentElement e, Void p) {
|
||||||
PubVar v = new PubVar(e.getModifiers(),
|
PubVar v = new PubVar(e.getModifiers(),
|
||||||
|
@ -63,10 +63,4 @@ public class SealedClassesTest extends KullaTesting {
|
|||||||
assertEval("class I2 extends I {}");
|
assertEval("class I2 extends I {}");
|
||||||
assertEval("new I2()");
|
assertEval("new I2()");
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeMethod
|
|
||||||
public void setUp() {
|
|
||||||
setUp(b -> b.compilerOptions("--enable-preview", "-source", String.valueOf(SourceVersion.latest().ordinal()))
|
|
||||||
.remoteVMOptions("--enable-preview"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import java.lang.annotation.*;
|
|||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @bug 8006547
|
* @bug 8006547
|
||||||
* @compile --enable-preview -source ${jdk.version} NoTargetOnContainer.java
|
* @compile NoTargetOnContainer.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@interface FooContainer {
|
@interface FooContainer {
|
||||||
|
@ -26,7 +26,7 @@ import java.lang.annotation.*;
|
|||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @bug 8006547
|
* @bug 8006547
|
||||||
* @compile --enable-preview -source ${jdk.version} NoTargetOnContainer2.java
|
* @compile NoTargetOnContainer2.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@interface FooContainer {
|
@interface FooContainer {
|
||||||
|
@ -410,8 +410,6 @@ public class CombinationsTargetTest2 extends ClassfileTestHelper {
|
|||||||
" boolean dataIsString = ( data instanceof _As_ _Bs_ String str && str.isEmpty());\n" +
|
" boolean dataIsString = ( data instanceof _As_ _Bs_ String str && str.isEmpty());\n" +
|
||||||
"}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) +
|
"}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) +
|
||||||
"\n\n";
|
"\n\n";
|
||||||
extraOptions = List.of("--enable-preview",
|
|
||||||
"-source", JDK_VERSION);
|
|
||||||
hasInnerClass=false;
|
hasInnerClass=false;
|
||||||
break;
|
break;
|
||||||
case src8: // (repeating) type annotations in use of instanceof
|
case src8: // (repeating) type annotations in use of instanceof
|
||||||
@ -464,8 +462,6 @@ public class CombinationsTargetTest2 extends ClassfileTestHelper {
|
|||||||
" }\n" +
|
" }\n" +
|
||||||
"}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) +
|
"}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) +
|
||||||
"\n\n";
|
"\n\n";
|
||||||
extraOptions = List.of("--enable-preview",
|
|
||||||
"-source", JDK_VERSION);
|
|
||||||
hasInnerClass=false;
|
hasInnerClass=false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -28,8 +28,7 @@
|
|||||||
* @modules java.compiler
|
* @modules java.compiler
|
||||||
* jdk.jdeps/com.sun.tools.javap
|
* jdk.jdeps/com.sun.tools.javap
|
||||||
* @build toolbox.JavapTask
|
* @build toolbox.JavapTask
|
||||||
* @compile --enable-preview -source ${jdk.version} Patterns.java
|
* @run main Patterns
|
||||||
* @run main/othervm --enable-preview Patterns
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
@ -70,9 +70,7 @@ public class TestGetElementReference {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
|
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
|
||||||
List<String> options = List.of("-Xjcov",
|
List<String> options = List.of("-Xjcov");
|
||||||
"--enable-preview",
|
|
||||||
"-source", JDK_VERSION);
|
|
||||||
JavacTask ct = (JavacTask) ToolProvider.getSystemJavaCompiler().getTask(null, null, diagnostics, options, null, files);
|
JavacTask ct = (JavacTask) ToolProvider.getSystemJavaCompiler().getTask(null, null, diagnostics, options, null, files);
|
||||||
Trees trees = Trees.instance(ct);
|
Trees trees = Trees.instance(ct);
|
||||||
CompilationUnitTree cut = ct.parse().iterator().next();
|
CompilationUnitTree cut = ct.parse().iterator().next();
|
||||||
|
@ -704,9 +704,7 @@ public class TestGetScopeResult {
|
|||||||
}
|
}
|
||||||
Context ctx = new Context();
|
Context ctx = new Context();
|
||||||
TestAnalyzer.preRegister(ctx);
|
TestAnalyzer.preRegister(ctx);
|
||||||
List<String> options = List.of("--enable-preview",
|
JavacTask t = (JavacTask) c.getTask(null, fm, null, null, null,
|
||||||
"-source", System.getProperty("java.specification.version"));
|
|
||||||
JavacTask t = (JavacTask) c.getTask(null, fm, null, options, null,
|
|
||||||
List.of(new MyFileObject()), ctx);
|
List.of(new MyFileObject()), ctx);
|
||||||
CompilationUnitTree cut = t.parse().iterator().next();
|
CompilationUnitTree cut = t.parse().iterator().next();
|
||||||
t.analyze();
|
t.analyze();
|
||||||
|
@ -26,8 +26,7 @@
|
|||||||
* @bug 8240658 8266281
|
* @bug 8240658 8266281
|
||||||
* @summary Verify that broken method invocations with lambdas get type inference done
|
* @summary Verify that broken method invocations with lambdas get type inference done
|
||||||
* @modules jdk.compiler
|
* @modules jdk.compiler
|
||||||
* @compile --enable-preview -source ${jdk.version} TestGetTypeMirrorReference.java
|
* @run main TestGetTypeMirrorReference
|
||||||
* @run main/othervm --enable-preview TestGetTypeMirrorReference
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import com.sun.source.tree.CompilationUnitTree;
|
import com.sun.source.tree.CompilationUnitTree;
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
// key: compiler.err.illegal.start.of.stmt
|
// key: compiler.err.illegal.start.of.stmt
|
||||||
// key: compiler.err.expected4
|
// key: compiler.err.expected4
|
||||||
// options: --enable-preview -source ${jdk.version}
|
|
||||||
|
|
||||||
class IllegalStartOfStmt {
|
class IllegalStartOfStmt {
|
||||||
void m() {
|
void m() {
|
||||||
|
@ -94,8 +94,7 @@ public class DeduplicationTest {
|
|||||||
"-d",
|
"-d",
|
||||||
".",
|
".",
|
||||||
"-XDdebug.dumpLambdaToMethodDeduplication",
|
"-XDdebug.dumpLambdaToMethodDeduplication",
|
||||||
"-XDdebug.dumpLambdaToMethodStats",
|
"-XDdebug.dumpLambdaToMethodStats"),
|
||||||
"--enable-preview", "-source", sourceVersion),
|
|
||||||
null,
|
null,
|
||||||
fileManager.getJavaFileObjects(file));
|
fileManager.getJavaFileObjects(file));
|
||||||
Map<JCLambda, JCLambda> dedupedLambdas = new LinkedHashMap<>();
|
Map<JCLambda, JCLambda> dedupedLambdas = new LinkedHashMap<>();
|
||||||
|
@ -1497,8 +1497,7 @@ public class JavacParserTest extends TestCase {
|
|||||||
void testStartAndEndPositionForClassesInPermitsClause() throws IOException {
|
void testStartAndEndPositionForClassesInPermitsClause() throws IOException {
|
||||||
String code = "package t; sealed class Test permits Sub1, Sub2 {} final class Sub1 extends Test {} final class Sub2 extends Test {}";
|
String code = "package t; sealed class Test permits Sub1, Sub2 {} final class Sub1 extends Test {} final class Sub2 extends Test {}";
|
||||||
JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, fm, null,
|
JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, fm, null,
|
||||||
List.of("--enable-preview", "-source", Integer.toString(Runtime.version().feature())),
|
null, null, Arrays.asList(new MyFileObject(code)));
|
||||||
null, Arrays.asList(new MyFileObject(code)));
|
|
||||||
CompilationUnitTree cut = ct.parse().iterator().next();
|
CompilationUnitTree cut = ct.parse().iterator().next();
|
||||||
ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
|
ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
|
||||||
List<? extends Tree> permitsList = clazz.getPermitsClause();
|
List<? extends Tree> permitsList = clazz.getPermitsClause();
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
* jdk.compiler/com.sun.tools.javac.util
|
* jdk.compiler/com.sun.tools.javac.util
|
||||||
* @build toolbox.ToolBox toolbox.JavacTask
|
* @build toolbox.ToolBox toolbox.JavacTask
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile --enable-preview -source ${jdk.version} AnnoProcessorOnRecordsTest.java
|
* @run main/othervm AnnoProcessorOnRecordsTest
|
||||||
* @run main/othervm --enable-preview AnnoProcessorOnRecordsTest
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -149,10 +148,7 @@ public class AnnoProcessorOnRecordsTest extends TestRunner {
|
|||||||
|
|
||||||
for (Mode mode : new Mode[] {Mode.API}) {
|
for (Mode mode : new Mode[] {Mode.API}) {
|
||||||
new JavacTask(tb, mode)
|
new JavacTask(tb, mode)
|
||||||
.options("-nowarn",
|
.options("-nowarn", "-processor", Processor.class.getName())
|
||||||
"-processor", Processor.class.getName(),
|
|
||||||
"--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.files(findJavaFiles(src))
|
.files(findJavaFiles(src))
|
||||||
.outdir(classes)
|
.outdir(classes)
|
||||||
.run()
|
.run()
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
* jdk.compiler/com.sun.tools.javac.util
|
* jdk.compiler/com.sun.tools.javac.util
|
||||||
* @build toolbox.ToolBox toolbox.JavacTask
|
* @build toolbox.ToolBox toolbox.JavacTask
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile --enable-preview -source ${jdk.version} CheckingTypeAnnotationsOnRecords.java
|
* @run main/othervm CheckingTypeAnnotationsOnRecords
|
||||||
* @run main/othervm --enable-preview CheckingTypeAnnotationsOnRecords
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -144,10 +143,7 @@ public class CheckingTypeAnnotationsOnRecords extends TestRunner {
|
|||||||
|
|
||||||
for (Mode mode : new Mode[] {Mode.API}) {
|
for (Mode mode : new Mode[] {Mode.API}) {
|
||||||
new JavacTask(tb, mode)
|
new JavacTask(tb, mode)
|
||||||
.options("-nowarn",
|
.options("-nowarn", "-processor", Processor.class.getName())
|
||||||
"-processor", Processor.class.getName(),
|
|
||||||
"--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.files(findJavaFiles(src))
|
.files(findJavaFiles(src))
|
||||||
.outdir(classes)
|
.outdir(classes)
|
||||||
.run()
|
.run()
|
||||||
|
@ -33,8 +33,7 @@
|
|||||||
* jdk.compiler/com.sun.tools.javac.util
|
* jdk.compiler/com.sun.tools.javac.util
|
||||||
* @build toolbox.ToolBox toolbox.JavacTask
|
* @build toolbox.ToolBox toolbox.JavacTask
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile --enable-preview -source ${jdk.version} ErrorOnAnnoWithTargetMethod.java
|
* @run main/othervm ErrorOnAnnoWithTargetMethod
|
||||||
* @run main/othervm --enable-preview ErrorOnAnnoWithTargetMethod
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -157,10 +156,7 @@ public class ErrorOnAnnoWithTargetMethod extends TestRunner {
|
|||||||
String source = SOURCE.replaceFirst("#ANNO", anno);
|
String source = SOURCE.replaceFirst("#ANNO", anno);
|
||||||
tb.writeJavaFiles(r, source);
|
tb.writeJavaFiles(r, source);
|
||||||
new JavacTask(tb, Mode.API)
|
new JavacTask(tb, Mode.API)
|
||||||
.options("-nowarn",
|
.options("-nowarn", "-processor", Processor.class.getName())
|
||||||
"-processor", Processor.class.getName(),
|
|
||||||
"--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.files(findJavaFiles(src))
|
.files(findJavaFiles(src))
|
||||||
.outdir(classes)
|
.outdir(classes)
|
||||||
.run()
|
.run()
|
||||||
|
@ -24,10 +24,7 @@
|
|||||||
/*
|
/*
|
||||||
* @test 8242529
|
* @test 8242529
|
||||||
* @summary javac defines type annotations incorrectly for record members (constructor and property accessor)
|
* @summary javac defines type annotations incorrectly for record members (constructor and property accessor)
|
||||||
* @modules
|
* @modules jdk.compiler/com.sun.tools.javac.util
|
||||||
* jdk.compiler/com.sun.tools.javac.util
|
|
||||||
* @compile --enable-preview -source ${jdk.version} RecordNotPreservingNestedTypeAnnotationsTest.java
|
|
||||||
* @run main/othervm --enable-preview RecordNotPreservingNestedTypeAnnotationsTest
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
* @modules jdk.compiler
|
* @modules jdk.compiler
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile TestBindingVariable.java
|
* @compile TestBindingVariable.java
|
||||||
* @compile --enable-preview -source ${jdk.version} -processor TestBindingVariable -proc:only TestBindingVariableData.java
|
* @compile -processor TestBindingVariable -proc:only TestBindingVariableData.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import javax.annotation.processing.*;
|
import javax.annotation.processing.*;
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
* jdk.compiler/com.sun.tools.javac.util
|
* jdk.compiler/com.sun.tools.javac.util
|
||||||
* @build toolbox.ToolBox toolbox.JavacTask
|
* @build toolbox.ToolBox toolbox.JavacTask
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile --enable-preview -source ${jdk.version} TestRecord.java
|
* @run main/othervm TestRecord
|
||||||
* @run main/othervm --enable-preview TestRecord
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -143,10 +142,7 @@ public class TestRecord extends TestRunner {
|
|||||||
|
|
||||||
for (Mode mode : new Mode[] {Mode.API}) {
|
for (Mode mode : new Mode[] {Mode.API}) {
|
||||||
new JavacTask(tb, mode)
|
new JavacTask(tb, mode)
|
||||||
.options("-nowarn",
|
.options("-nowarn", "-processor", Processor.class.getName())
|
||||||
"-processor", Processor.class.getName(),
|
|
||||||
"--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.files(findJavaFiles(src))
|
.files(findJavaFiles(src))
|
||||||
.outdir(classes)
|
.outdir(classes)
|
||||||
.run()
|
.run()
|
||||||
|
@ -27,8 +27,7 @@
|
|||||||
* @library /tools/javac/lib
|
* @library /tools/javac/lib
|
||||||
* @modules jdk.compiler
|
* @modules jdk.compiler
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile --enable-preview -source ${jdk.version} TestRecordDesugar.java
|
* @run main TestRecordDesugar
|
||||||
* @run main/othervm --enable-preview TestRecordDesugar
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -50,8 +49,6 @@ public class TestRecordDesugar extends JavacTestingAbstractProcessor {
|
|||||||
String testSrc = System.getProperty("test.src");
|
String testSrc = System.getProperty("test.src");
|
||||||
String testClasspath = System.getProperty("test.class.path");
|
String testClasspath = System.getProperty("test.class.path");
|
||||||
List<String> options = List.of(
|
List<String> options = List.of(
|
||||||
"--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()),
|
|
||||||
"-classpath", testClasspath,
|
"-classpath", testClasspath,
|
||||||
"-processor", "TestRecordDesugar",
|
"-processor", "TestRecordDesugar",
|
||||||
"-proc:only",
|
"-proc:only",
|
||||||
|
@ -33,8 +33,7 @@
|
|||||||
* jdk.compiler/com.sun.tools.javac.util
|
* jdk.compiler/com.sun.tools.javac.util
|
||||||
* @build toolbox.ToolBox toolbox.JavacTask
|
* @build toolbox.ToolBox toolbox.JavacTask
|
||||||
* @build JavacTestingAbstractProcessor
|
* @build JavacTestingAbstractProcessor
|
||||||
* @compile --enable-preview -source ${jdk.version} RepeatingAnnotationsOnRecords.java
|
* @run main/othervm RepeatingAnnotationsOnRecords
|
||||||
* @run main/othervm --enable-preview RepeatingAnnotationsOnRecords
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -175,10 +174,7 @@ public class RepeatingAnnotationsOnRecords extends TestRunner {
|
|||||||
|
|
||||||
for (Mode mode : new Mode[] {Mode.API}) {
|
for (Mode mode : new Mode[] {Mode.API}) {
|
||||||
new JavacTask(tb, mode)
|
new JavacTask(tb, mode)
|
||||||
.options("-nowarn",
|
.options("-nowarn", "-processor", Processor.class.getName())
|
||||||
"-processor", Processor.class.getName(),
|
|
||||||
"--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.files(findJavaFiles(src))
|
.files(findJavaFiles(src))
|
||||||
.outdir(classes)
|
.outdir(classes)
|
||||||
.run()
|
.run()
|
||||||
|
@ -168,15 +168,12 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
Files.createDirectories(out);
|
Files.createDirectories(out);
|
||||||
|
|
||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.options("--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.files(findJavaFiles(pkg))
|
.files(findJavaFiles(pkg))
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
// let's execute to check that it's working
|
// let's execute to check that it's working
|
||||||
String output = new JavaTask(tb)
|
String output = new JavaTask(tb)
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run()
|
.run()
|
||||||
@ -192,8 +189,6 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
tb.writeJavaFiles(superClass, superClassCode2);
|
tb.writeJavaFiles(superClass, superClassCode2);
|
||||||
|
|
||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.options("--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.classpath(out)
|
.classpath(out)
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.files(findJavaFiles(superClass))
|
.files(findJavaFiles(superClass))
|
||||||
@ -202,7 +197,6 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
if (shouldFail) {
|
if (shouldFail) {
|
||||||
// let's now check that there is an IncompatibleClassChangeError
|
// let's now check that there is an IncompatibleClassChangeError
|
||||||
output = new JavaTask(tb)
|
output = new JavaTask(tb)
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run(Task.Expect.FAIL)
|
.run(Task.Expect.FAIL)
|
||||||
@ -213,7 +207,6 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
new JavaTask(tb)
|
new JavaTask(tb)
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run(Task.Expect.SUCCESS);
|
.run(Task.Expect.SUCCESS);
|
||||||
@ -414,15 +407,12 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
|
|
||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.options("--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.files(findJavaFiles(pkg))
|
.files(findJavaFiles(pkg))
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
// let's execute to check that it's working
|
// let's execute to check that it's working
|
||||||
String output = new JavaTask(tb)
|
String output = new JavaTask(tb)
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run()
|
.run()
|
||||||
.writeAll()
|
.writeAll()
|
||||||
@ -437,8 +427,6 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
tb.writeJavaFiles(sub, subClassCode2);
|
tb.writeJavaFiles(sub, subClassCode2);
|
||||||
|
|
||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.options("--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.classpath(out)
|
.classpath(out)
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.files(findJavaFiles(sub))
|
.files(findJavaFiles(sub))
|
||||||
@ -446,7 +434,6 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
|
|
||||||
// should execute without issues
|
// should execute without issues
|
||||||
output = new JavaTask(tb)
|
output = new JavaTask(tb)
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run()
|
.run()
|
||||||
@ -588,15 +575,12 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
Files.createDirectories(out);
|
Files.createDirectories(out);
|
||||||
|
|
||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.options("--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.files(findJavaFiles(pkg))
|
.files(findJavaFiles(pkg))
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
// let's execute to check that it's working
|
// let's execute to check that it's working
|
||||||
String output = new JavaTask(tb)
|
String output = new JavaTask(tb)
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run()
|
.run()
|
||||||
@ -614,15 +598,12 @@ public class BinaryCompatibilityTests extends TestRunner {
|
|||||||
tb.writeJavaFiles(sub2, subClass2Code);
|
tb.writeJavaFiles(sub2, subClass2Code);
|
||||||
|
|
||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.options("--enable-preview",
|
|
||||||
"-source", Integer.toString(Runtime.version().feature()))
|
|
||||||
.classpath(out)
|
.classpath(out)
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.files(findJavaFiles(superClass)[0], findJavaFiles(sub2)[0])
|
.files(findJavaFiles(superClass)[0], findJavaFiles(sub2)[0])
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
new JavaTask(tb)
|
new JavaTask(tb)
|
||||||
.vmOptions("--enable-preview")
|
|
||||||
.classpath(out.toString())
|
.classpath(out.toString())
|
||||||
.classArgs("pkg.Super")
|
.classArgs("pkg.Super")
|
||||||
.run(Task.Expect.SUCCESS);
|
.run(Task.Expect.SUCCESS);
|
||||||
|
@ -60,8 +60,7 @@ public class CheckSubtypesOfSealedTest extends TestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void run() throws Exception {
|
void run() throws Exception {
|
||||||
InMemoryFileManager fileManager = compile(List.of("--enable-preview", "-source",
|
InMemoryFileManager fileManager = compile(testSource);
|
||||||
Integer.toString(Runtime.version().feature())), testSource);
|
|
||||||
checkClassFile(readClassFile(fileManager.getClasses().get("SealedClasses$SAC2")), CheckFor.SEALED);
|
checkClassFile(readClassFile(fileManager.getClasses().get("SealedClasses$SAC2")), CheckFor.SEALED);
|
||||||
checkClassFile(readClassFile(fileManager.getClasses().get("SealedClasses$SAC3")), CheckFor.FINAL);
|
checkClassFile(readClassFile(fileManager.getClasses().get("SealedClasses$SAC3")), CheckFor.FINAL);
|
||||||
checkClassFile(readClassFile(fileManager.getClasses().get("SealedClasses$SAC4")), CheckFor.FINAL);
|
checkClassFile(readClassFile(fileManager.getClasses().get("SealedClasses$SAC4")), CheckFor.FINAL);
|
||||||
|
@ -648,7 +648,7 @@ public class SealedCompilationTests extends CompilationTestCase {
|
|||||||
|
|
||||||
List<String> output = new JavacTask(tb)
|
List<String> output = new JavacTask(tb)
|
||||||
.outdir(out)
|
.outdir(out)
|
||||||
.options("--enable-preview", "-source", Integer.toString(Runtime.version().feature()), "-Xprint")
|
.options("-Xprint")
|
||||||
.files(findJavaFiles(test))
|
.files(findJavaFiles(test))
|
||||||
.run()
|
.run()
|
||||||
.writeAll()
|
.writeAll()
|
||||||
|
@ -65,9 +65,7 @@ public class T8258662 extends TestRunner {
|
|||||||
new JavacTask(tb)
|
new JavacTask(tb)
|
||||||
.sources(code)
|
.sources(code)
|
||||||
.classpath(".")
|
.classpath(".")
|
||||||
.options("--enable-preview", "-source", Integer.toString(Runtime.version().feature()))
|
.run();
|
||||||
.run()
|
|
||||||
.writeAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,7 @@
|
|||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 8071961
|
* @bug 8071961
|
||||||
* @compile -Xlint:missing-explicit-ctor -Werror
|
* @compile -Xlint:missing-explicit-ctor -Werror NoWarningRecord.java
|
||||||
* --enable-preview -source ${jdk.version} NoWarningRecord.java
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public record NoWarningRecord(/* no components */) {
|
public record NoWarningRecord(/* no components */) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user