Community
Participate
Working Groups
In 1119, we have a way not to generate code for an assignment with no effect. This is for code like: class A { int i; A() { i = i; } } In case of an inner class, we might want to do it anyway: public class A { int i; A(int j) { i = j; } A() { } class B extends A { B() { this.i = A.this.i; } } public static void main(String[] args) { A a = new A(3); System.out.print(a.i + " "); System.out.print(a.new B().i); } } Compile and run and you will end up with: 3 0 instead of: 3 3 Javac returns the proper values. The bug is that the assignment this.i = A.this.i; is not generated.
Fixed. Qualified this references are no longer eligible for such a diagnosis.
Verified.