mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
warn about private/static modifiers inside local classes (IDEA-85567)
This commit is contained in:
+8
@@ -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 {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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>
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ class X extends <error descr="Classes cannot directly extend 'java.lang.Enum'">E
|
||||
|
||||
enum StaticInEnumConstantInitializer {
|
||||
AN {
|
||||
<error descr="Inner classes cannot have static declarations">static</error> class s {
|
||||
<error descr="Modifier 'static' not allowed here">static</error> class s {
|
||||
}
|
||||
private <error descr="Inner classes cannot have static declarations">static</error> final String t = String.valueOf(1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user