Community
Participate
Working Groups
Let's consider following example: public class X { String str; } public class Y { X local; void foo() { local = new X(); local.str = "string"; } } When I set compiler option "Unqualifed access to instance field" to Warning, I get following messages while compiling: ---------- 1. WARNING in D:\usr\OTI\workspaces\dvpt\v30\current\_Bug\Y.java (at line 4) local = new X(); ^^^^^ Unqualified access to the field Y.local ---------- ---------- 2. WARNING in D:\usr\OTI\workspaces\dvpt\v30\current\_Bug\Y.java (at line 5) local.str = "string"; ^^^^^^^^^ Unqualified access to the field Y.local ---------- 2 problems (2 warnings) First warning is OK, but I would prefer to have: 2. WARNING in D:\usr\OTI\workspaces\dvpt\v30\current\_Bug\Y.java (at line 5) local.str = "string"; ^^^^^ Unqualified access to the field Y.local ---------- for second warning message...
Similar to bug 48617...
Fixed. Modify ProblemReporter.unqualifiedFieldAccess(NameReference,Field) method to set source range on first token when NameReference is a QualifiedNameReference. No test cases added as NegativeTest.test401 already look at this kind of error.
Verified 3.0M7