warn about private/static modifiers inside local classes (IDEA-85567)

This commit is contained in:
anna
2012-05-03 11:36:21 +02:00
parent db276c581e
commit 75c174955f
5 changed files with 13 additions and 5 deletions
@@ -66,3 +66,11 @@ interface i3 {
<error descr="Modifier 'transient' not allowed here">transient</error> int m2() { return 0; }
<error descr="Modifier 'synchronized' not allowed here">synchronized</error> int m3() { return 0; }
}
class LocalClassWithInner {
void foo () {
class A {
<error descr="Modifier 'private' not allowed here">private</error> class B {}
}
}
}
@@ -48,7 +48,7 @@ public class a {
<error descr="Inner classes cannot have static declarations">static</error>
final int f2 = x instanceof Integer ? 1 : 0;
<error descr="Inner classes cannot have static declarations">static</error>
<error descr="Modifier 'static' not allowed here">static</error>
class a_ic_c2 {}
<error descr="Inner classes cannot have static declarations">static</error>
@@ -75,7 +75,7 @@ public class a {
<error descr="Inner classes cannot have static declarations">static</error>
final int f2 = x instanceof Integer ? 1 : 0;
<error descr="Inner classes cannot have static declarations">static</error>
<error descr="Modifier 'static' not allowed here">static</error>
class a_ic_c2 {}
<error descr="Inner classes cannot have static declarations">static</error>