mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-22 11:29:28 +07:00
Also: do not flush fields of this class when pure super-constructor is called Fixes IDEA-337287 "Constant values" false-positive when base class constructor calls overridden method with field initialization GitOrigin-RevId: 477fc87c4b679b3aa0bcdc5723bcffb644ab6976
35 lines
527 B
Java
35 lines
527 B
Java
class Example {
|
|
public static class Extended extends Base {
|
|
|
|
private String field;
|
|
|
|
public Extended() {
|
|
super();
|
|
// Do not expect warning on field.trim(), as it's initialized via superclass constructor
|
|
System.out.println(field.trim());
|
|
}
|
|
|
|
@Override
|
|
protected void init() {
|
|
field = "Set";
|
|
}
|
|
}
|
|
|
|
public static class Base {
|
|
|
|
public Base() {
|
|
init();
|
|
}
|
|
|
|
protected void init() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
new Extended();
|
|
}
|
|
|
|
}
|