Community
Participate
Working Groups
20070415 In the following code: p/X.java ----------------- package p; public class X { static int NEW_FIELD; } q/Y.java ----------------- package q; import p.X; public class Y { void foo() { int i = X.OLD_FIELD; } void bar() { int j = X.OLD_FIELD; } } 'OLD_FIELD' can not be resolved. The error range is 'X.OLD_FIELD', but should be only 'OLD_FIELD'. If you change to public class Y { void foo() { int i = X.OLD_FIELD(); } void bar() { int j = X.OLD_FIELD(); } } then the error range is only 'OLD_FIELD()'
The error message I get is X.OLD_FIELD cannot be resolved to a variable, instead of OLD_FIELD cannot be resolved, as reported here. In view of this error message, I believe that the error range is consistent. Srikanth, what do you think? Does the error range need any change here?
(In reply to comment #1) > The error message I get is X.OLD_FIELD cannot be resolved to a variable, > instead of OLD_FIELD cannot be resolved, as reported here. In view of this > error message, I believe that the error range is consistent. > > Srikanth, what do you think? Does the error range need any change here? This seems to be have been the behavior at least since 3.3.2. I agree that current message and range are appropriate. This defect could be closed with no change.
Verified for 3.6M6.
Reopening, given we just fixed bug 303830: we should align this one with it and it will also help us fix bug 182319.
Created attachment 162094 [details] Proposed fix + updated regression tests
Ayushman, please review.
(In reply to comment #5) > Created an attachment (id=162094) [details] > Proposed fix + updated regression tests Patch looks good to me.
(In reply to comment #7) > Patch looks good to me. Yup, I agree with Frederic.
Released for 3.6M7. Updated existing regression tests.
Verified in HEAD.
*** Bug 182319 has been marked as a duplicate of this bug. ***