mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 20:30:42 +07:00
This patch encapsulates the logic that checks if a used feature is annotated with PreviewFeature in its own visitor. The visitor now checks both PreviewFeature annotations with old and new packages. GitOrigin-RevId: f3ddc2a840b8c3a8bb4e1a731e2c208002a29fd4
31 lines
1.5 KiB
Java
31 lines
1.5 KiB
Java
import jdk.internal.javac.PreviewFeature;
|
|
import jdk.internal.javac.PreviewFeature.Feature;
|
|
import <error descr="Patterns in 'instanceof' are not supported at language level '9'">org.myorg.jdk.internal.javac.preview.FromPreview</error>;
|
|
|
|
class Main {
|
|
static {
|
|
<error descr="Patterns in 'instanceof' are not supported at language level '9'">requirePatternMatching</error>();
|
|
<error descr="Text block literals are not supported at language level '9'">Main.requireTextBlocks</error>();
|
|
<error descr="Records are not supported at language level '9'">new Main().requireRecords</error>();
|
|
final <error descr="Text block literals are not supported at language level '9'">NotDirectlyAnnotatedMethod</error> a = new <error descr="Text block literals are not supported at language level '9'">NotDirectlyAnnotatedMethod</error>();
|
|
<error descr="Text block literals are not supported at language level '9'">a.f</error>();
|
|
<error descr="Text block literals are not supported at language level '9'">NotDirectlyAnnotatedMethod</error>.g();
|
|
}
|
|
|
|
@PreviewFeature(feature=Feature.PATTERN_MATCHING_IN_INSTANCEOF)
|
|
static void requirePatternMatching(){}
|
|
|
|
@PreviewFeature(feature=jdk.internal.javac.PreviewFeature.Feature.TEXT_BLOCKS)
|
|
static void requireTextBlocks(){}
|
|
|
|
@jdk.internal.javac.PreviewFeature(feature=jdk.internal.javac.PreviewFeature.Feature.RECORDS)
|
|
void requireRecords(){}
|
|
|
|
}
|
|
|
|
@PreviewFeature(feature=Feature.TEXT_BLOCKS)
|
|
class NotDirectlyAnnotatedMethod {
|
|
void f(){}
|
|
static void g(){}
|
|
}
|