mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +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
28 lines
798 B
Java
28 lines
798 B
Java
import jdk.internal.javac.PreviewFeature;
|
|
import jdk.internal.javac.PreviewFeature.Feature;
|
|
|
|
class Main {
|
|
@PreviewFeature(feature=Feature.PATTERN_MATCHING_IN_INSTANCEOF)
|
|
static class InstanceOf{
|
|
static void f(){}
|
|
}
|
|
@PreviewFeature(feature=Feature.RECORDS)
|
|
static class Records{
|
|
static void f(){}
|
|
}
|
|
@PreviewFeature(feature=Feature.TEXT_BLOCKS)
|
|
static class TextBlocks{
|
|
static void f(){}
|
|
}
|
|
static class Empty{
|
|
static void f(){}
|
|
}
|
|
|
|
static {
|
|
<error descr="Patterns in 'instanceof' are not supported at language level '9'">InstanceOf</error>.f();
|
|
<error descr="Records are not supported at language level '9'">Records</error>.f();
|
|
<error descr="Text block literals are not supported at language level '9'">TextBlocks</error>.f();
|
|
Empty.f();
|
|
}
|
|
}
|