| Summary: | [clean up] "Remove 'this' qualifier" erroneously removes explicit reference to containing instance within inner subclass of outer class | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Matt Whitlock <eclipse> | ||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 M4 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 183870 [details]
Fix
Fixed in HEAD. |
Build Identifier: I20100909-0800 public class Test { String label = "works"; class Nested extends Test { Nested() { label = "broken"; } @Override public String toString() { return Test.this.label; // this line gets altered by the clean up } } public static void main(String[] args) { System.out.println(new Test().new Nested()); } } This example should print "works", but this bug changes the expression `Test.this.label` to `label`, which is a different reference, and the altered program prints "broken" instead. Reproducible: Always