public not allowed for local inner classes

This commit is contained in:
anna
2012-05-04 17:07:44 +02:00
parent 0eb2183bd4
commit f80ca08fe4
2 changed files with 2 additions and 1 deletions

View File

@@ -820,7 +820,7 @@ public class HighlightUtil {
}
else {
if (PsiModifier.PUBLIC.equals(modifier)) {
isAllowed = modifierOwnerParent instanceof PsiJavaFile || modifierOwnerParent instanceof PsiClass;
isAllowed = modifierOwnerParent instanceof PsiJavaFile || (modifierOwnerParent instanceof PsiClass && ((PsiClass)modifierOwnerParent).getQualifiedName() != null);
}
else if (PsiModifier.STATIC.equals(modifier) || PsiModifier.PRIVATE.equals(modifier) || PsiModifier.PROTECTED.equals(modifier) ||
PsiModifier.PACKAGE_LOCAL.equals(modifier)) {

View File

@@ -71,6 +71,7 @@ class LocalClassWithInner {
void foo () {
class A {
<error descr="Modifier 'private' not allowed here">private</error> class B {}
<error descr="Modifier 'public' not allowed here">public</error> class B1 {}
}
}
}