mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 05:51:25 +07:00
[java-highlighting] Allow statics inside inner since Java 16 (IDEA-257410)
Also remove redundant record tests GitOrigin-RevId: ce57189891b3df3ba4659e8e3a2ded125234911a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6362ce9276
commit
5d20b5dbb9
@@ -0,0 +1,94 @@
|
||||
//statics in inner
|
||||
public class a {
|
||||
|
||||
static final Number x = null;
|
||||
static final int ix = x== null ? 4 : 3;
|
||||
|
||||
class ic {
|
||||
static int i;
|
||||
|
||||
static final int f1 = 3 < 4 ? (a.ix==5 ? 1 : 3) / 4 + 18 : 0;
|
||||
|
||||
static final int f2 = x instanceof Integer ? 1 : 0;
|
||||
|
||||
static class a_ic_c {}
|
||||
|
||||
interface a_ic_i {}
|
||||
static interface a_ic_i2 {}
|
||||
|
||||
static int a_ic_m(String s) { return 0; }
|
||||
|
||||
// static initializer
|
||||
static {}
|
||||
}
|
||||
|
||||
|
||||
interface ii {
|
||||
static int i = 9;
|
||||
void f();
|
||||
// since nested interface is implicitly static:
|
||||
static class ii_c {}
|
||||
}
|
||||
|
||||
// static inside class inside code block
|
||||
void f() {
|
||||
class ic2 {
|
||||
static int i;
|
||||
|
||||
static final int f1 = 3 < 4 ? (a.ix==5 ? 1 : 3) / 4 + 18 : 0;
|
||||
|
||||
static final int f2 = x instanceof Integer ? 1 : 0;
|
||||
|
||||
static class a_ic_c2 {}
|
||||
|
||||
static int a_ic_m2(String s) { return 0; }
|
||||
// static initializer
|
||||
static {}
|
||||
}
|
||||
}
|
||||
|
||||
void f1()
|
||||
{
|
||||
new a() {
|
||||
static int i;
|
||||
|
||||
static final int f1 = 3 < 4 ? (a.ix==5 ? 1 : 3) / 4 + 18 : 0;
|
||||
|
||||
static final Object o = null;
|
||||
|
||||
static final int f2 = x instanceof Integer ? 1 : 0;
|
||||
|
||||
static class a_ic_c2 {}
|
||||
|
||||
static int a_ic_m2(String s) { return 0; }
|
||||
// static initializer
|
||||
static {}
|
||||
};
|
||||
}
|
||||
|
||||
// local interface
|
||||
class cc {
|
||||
void f() {
|
||||
interface i {}
|
||||
}
|
||||
void ff() {
|
||||
class inn {
|
||||
interface i {}
|
||||
}
|
||||
}
|
||||
|
||||
Object o = new Runnable() {
|
||||
interface i {}
|
||||
public void run() {}
|
||||
};
|
||||
}
|
||||
|
||||
void withanonymous() {
|
||||
new Object() {
|
||||
<error descr="Modifier 'private' not allowed here">private</error> class RT {}
|
||||
private void method() {}
|
||||
private int myI;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user