mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
32 lines
626 B
Java
32 lines
626 B
Java
class Test {
|
|
|
|
int i = 0;
|
|
|
|
void test() {
|
|
class Inner extends Test {
|
|
Inner() {
|
|
Test.this.i = 10;
|
|
}
|
|
|
|
int t() {
|
|
return Test.this.i - this.i; // different fields
|
|
}
|
|
|
|
int t1() {
|
|
return <warning descr="Result of 'this.i - this.i' is always '0'">this.i - this.i</warning>;
|
|
}
|
|
|
|
int t2() {
|
|
return <warning descr="Result of 'Test.this.i - Test.this.i' is always '0'">Test.this.i - Test.this.i</warning>;
|
|
}
|
|
}
|
|
System.out.println(new Inner().t());
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
Test one = new Test();
|
|
one.test();
|
|
}
|
|
|
|
}
|