mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 07:40:42 +07:00
[codeInsight] IDEA-238740 Support the jdk.internal.PreviewFeature annotation
This patch fixes the problems according to the code review, it includes: - inlining the trivial wrapper methods checkConstructorPreviewFeature, checkMethodCallPreviewFeatureAnnotation, checkTypePreviewFeatureAnnotation - applying ObjectUtils#tryCast in HighlightUtil#checkPackagePreviewFeatureAnnotation - simplifying HighlightVisitorImpl#visitImportStaticStatement by calling directly HighlightUtil#checkPreviewFeatureElement - generalizing HighlightVisitorImpl#visitReferenceExpression's check if the element is annotated with PreviewFeature Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: 954ad1bbb26352d7d98581b3ad95a360569b0636
This commit is contained in:
committed by
intellij-monorepo-bot
parent
547ebddae3
commit
5e222f56a9
+3
-3
@@ -3,9 +3,9 @@ import jdk.internal.PreviewFeature.Feature;
|
||||
|
||||
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>;
|
||||
<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>();
|
||||
}
|
||||
|
||||
@PreviewFeature(feature=Feature.PATTERN_MATCHING_IN_INSTANCEOF)
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
<error descr="Patterns in 'instanceof' are not supported at language level '9'">import org.myorg.preview.FromPreview;</error>
|
||||
<error descr="Patterns in 'instanceof' are not supported at language level '9'">import static org.myorg.preview.FromPreview.f;</error>
|
||||
<error descr="Patterns in 'instanceof' are not supported at language level '9'">import static org.myorg.preview.FromPreview.*;</error>
|
||||
|
||||
class Main {
|
||||
static {
|
||||
<error descr="Patterns in 'instanceof' are not supported at language level '9'">org.myorg.preview.FromPreview</error>.f();
|
||||
<error descr="Patterns in 'instanceof' are not supported at language level '9'">f()</error>;
|
||||
<error descr="Patterns in 'instanceof' are not supported at language level '9'">f</error>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user