Bug 97224

Summary: [polish][compiler] Inconsistent error message for non-visible field
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2005-05-30 07:12:56 EDT
Build 3.1rc1

On following testcase, the various occurrences of visibility errors are not
flagged with a consistent error message:

public class X {
	X someX;
	private int val = 0;
}

class Other {
	{
		int i = new X().someX.val; // The field val is not visible
		X x = new X();
		int j = x.someX.val; // The field x.someX.val is not visible
	}
}

Both should include the field declaring class, and read:
The field X.val is not visible
Comment 1 Philipe Mulet CLA 2005-05-30 07:16:07 EDT
Changed problem reporter, and adapted various compiler tests which were exposing
offending error message (e.g. NegativeTest#test221).
Comment 2 Frederic Fusier CLA 2005-06-07 10:31:35 EDT
Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD
However, note that text range for the compiler error is still inconsistent:
 - first is "val"
 - second is "x.someX.val"
Perhaps should it be "someX.val" for both?
Comment 3 Olivier Thomann CLA 2005-06-10 11:29:13 EDT
Open bug 98689 for field source range inconsistencies.
Comment 4 Jerome Lanneluc CLA 2005-06-10 11:29:44 EDT
Verified with I20050610-0010