mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java 9: reject private modifiers in annotation types (IDEA-171088)
This commit is contained in:
+1
-1
@@ -967,7 +967,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
|
||||
if (PsiModifier.PRIVATE.equals(modifier)) {
|
||||
isAllowed &= modifierOwnerParent instanceof PsiClass &&
|
||||
(!((PsiClass)modifierOwnerParent).isInterface() || PsiUtil.isLanguageLevel9OrHigher(modifierOwner));
|
||||
(!((PsiClass)modifierOwnerParent).isInterface() || PsiUtil.isLanguageLevel9OrHigher(modifierOwner) && !((PsiClass)modifierOwnerParent).isAnnotationType());
|
||||
}
|
||||
else if (PsiModifier.STRICTFP.equals(modifier)) {
|
||||
isAllowed &= modifierOwnerParent instanceof PsiClass && (!((PsiClass)modifierOwnerParent).isInterface() || PsiUtil.isLanguageLevel8OrHigher(modifierOwner));
|
||||
|
||||
+5
@@ -20,4 +20,9 @@ interface E {
|
||||
|
||||
interface F {
|
||||
<error descr="Modifier 'private' not allowed here">private</error> int m = 0;
|
||||
}
|
||||
|
||||
@interface G {
|
||||
<error descr="Modifier 'private' not allowed here">private</error> String m();
|
||||
<error descr="Modifier 'private' not allowed here">private</error> String m1() {return "";}
|
||||
}
|
||||
Reference in New Issue
Block a user