mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
QD-6555: make derived references reachable for not initializing entry methods IJ-CR-112227
GitOrigin-RevId: cca88dd3552e5ca7a217474d82c17f89c28a7cba
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6e7efe04da
commit
a6eb2f5500
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
public abstract class A {
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public abstract void foo();
|
||||
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public void bar() {
|
||||
foo();
|
||||
new B;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
public class B extends A {
|
||||
@Override
|
||||
public void foo() {}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
public abstract class A {
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public abstract void foo();
|
||||
public void bar() {
|
||||
foo();
|
||||
}
|
||||
public void baz() {
|
||||
bar();
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public class B extends A {
|
||||
@Override
|
||||
public void foo() {}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
|
||||
public class Main {
|
||||
public A field;
|
||||
public static void main(String[] args) {
|
||||
init();
|
||||
field.baz();
|
||||
}
|
||||
|
||||
private static void init()
|
||||
{
|
||||
if (condition()) {
|
||||
field = new A;
|
||||
}
|
||||
else {
|
||||
field = new B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user