Bug 97224 - [polish][compiler] Inconsistent error message for non-visible field
Summary: [polish][compiler] Inconsistent error message for non-visible field
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-30 07:12 EDT by Philipe Mulet CLA
Modified: 2005-06-10 11:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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