Community
Participate
Working Groups
QuickFix produce wrong code while trying to fix the way class accesses field of the static member of the static class instance, i.e.: instance.staticField.flag = true; Where "instance" is the static field of the same class as caller, "staticField" its static member (instance of inner class StaticField) and the "flag" is a public field. Code is a bit meaningless, but there is no matter. Using QuickFix results in: StaticField.flag = true; while should be: InstanceClass.staticField.flag = true; or staticField.flag = true;
Time permitted for 2.1 since this is not a common case.
A problem is that the compiler highlights to much code. It should only highlight 'instance.staticField'; it currently does: instance.staticField.flag I fixed the quick fix with a temporary fix that uses the problem arguments (which I try to avoid as they are not really specified). It would be better to fix it in the compiler. public class E { public void foo(ConstClass instance) { instance.staticField.flag= true; } } public class ConstClass { public static StaticField staticField = new StaticField(); } public class StaticField { public boolean flag; }
We should now be highlighting the proper portion of the qualified name.
Fixed.
Verified for 3.0M6