Bug 76266 - [plan][compiler] Access restriction should also apply to inherited members
Summary: [plan][compiler] Access restriction should also apply to inherited members
Status: VERIFIED 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.2 M5   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-14 10:42 EDT by Philipe Mulet CLA
Modified: 2006-02-14 10:28 EST (History)
4 users (show)

See Also:


Attachments
Fix draft - see WORK task tags for review (29.55 KB, patch)
2005-06-09 11:36 EDT, Maxime Daniel CLA
no flags Details | Diff
Tests - part added, part aligned according to the fix side effects -compiler (29.07 KB, patch)
2005-06-09 11:37 EDT, Maxime Daniel CLA
no flags Details | Diff
Tests - part added, part aligned according to the fix side effects - model (19.39 KB, patch)
2005-06-09 11:37 EDT, Maxime Daniel CLA
no flags Details | Diff
New proposal, sync'd with v_631 level, workspace unified format (54.66 KB, patch)
2006-01-03 11:31 EST, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2004-10-14 10:42:17 EDT
Build 20041012

When inheriting a public member from a restricted type, through a legal type, it
should be diagnosed as an access violation as well (even though no direct
reference to restricted type)
Comment 1 Maxime Daniel CLA 2005-06-09 11:35:12 EDT
Attempted a fix, that:
- propagates access restrictions from types to their methods and fields;
- checks such access restrictions;
- reports a new series of errors associated to illegal access to constructors,
  methods and fields.

A case of interest has been raised by the double diagnostic on types and
constructors when the latter is invoked implicitly. The fix avoids this for
access restrictions.

Side effects:
- deprecation detection suffered from the double diagnostic described above;
  this has been removed and tests have been aligned accordingly;
- breakages in the SuppressWarnings behavior have raised an investigation of
  the severity of deprecated references within javadoc tags; the fix changes 
  the behavior in that it takes the min severity of those (instead of the
  max).

The three attachment that follow give the fix. A review with other team
members is planned for tomorrow, and the fix provided so far should not be
considered as a release candidate.
Comment 2 Maxime Daniel CLA 2005-06-09 11:36:12 EDT
Created attachment 22702 [details]
Fix draft - see WORK task tags for review
Comment 3 Maxime Daniel CLA 2005-06-09 11:37:04 EDT
Created attachment 22703 [details]
Tests - part added, part aligned according to the fix side effects -compiler
Comment 4 Maxime Daniel CLA 2005-06-09 11:37:47 EDT
Created attachment 22704 [details]
Tests - part added, part aligned according to the fix side effects - model
Comment 5 Philipe Mulet CLA 2005-06-13 06:35:56 EDT
+1 for RC3

Dirk - would you vote for this to be fixed ? Without it, we have a hole in our
access restriction story (when inherited members).
Comment 6 Philipe Mulet CLA 2005-06-14 12:16:39 EDT
Discussing with Dirk, we agreed to defer this one to a later stage, since it is
not a critical defect, but rather an enhancement.
Comment 7 Philipe Mulet CLA 2005-06-23 07:37:56 EDT
Good candidate for 3.1.1
Comment 8 Maxime Daniel CLA 2005-07-19 08:37:32 EDT
Refreshed patches to catch up with 3.1 maintenance branch. Still needs review.
(Note: since we do not add any problem IDs, the patch should apply to HEAD
unchanged.)
Comment 9 Philipe Mulet CLA 2005-09-07 09:14:54 EDT
Not for 3.1.1, will release this into 3.2
Comment 10 Maxime Daniel CLA 2006-01-03 11:29:15 EST
(In reply to comment #1)
...
> Side effects:
...
> - breakages in the SuppressWarnings behavior have raised an investigation of
>   the severity of deprecated references within javadoc tags; the fix changes 
>   the behavior in that it takes the min severity of those (instead of the
>   max).
Thinking a second time over the issue, reverted back to the previous 
behavior in this area, the UI delivering a consistent user experience.

Comment 11 Maxime Daniel CLA 2006-01-03 11:31:04 EST
Created attachment 32416 [details]
New proposal, sync'd with v_631 level, workspace unified format
Comment 12 Maxime Daniel CLA 2006-01-04 08:37:23 EST
Added the test class AccessRestrictionsTests to show typical use cases.
Comment 13 Maxime Daniel CLA 2006-01-06 05:01:46 EST
This fix triggers a full rebuild of the workspace.
Comment 14 Jerome Lanneluc CLA 2006-02-14 10:28:32 EST
Verified for 3.2 M5 using build I20060214-0010