Bug 96962 - Quickfix to solve restriction access problem
Summary: Quickfix to solve restriction access problem
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Adam Archer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on:
Blocks:
 
Reported: 2005-05-27 09:10 EDT by Pascal Rapicault CLA
Modified: 2007-09-04 16:47 EDT (History)
1 user (show)

See Also:
caniszczyk: review+


Attachments
patch (11.60 KB, patch)
2007-08-30 15:41 EDT, Adam Archer CLA
no flags Details | Diff
patch (13.58 KB, patch)
2007-08-31 13:53 EDT, Adam Archer CLA
no flags Details | Diff
patch (13.93 KB, patch)
2007-08-31 13:56 EDT, Adam Archer CLA
no flags Details | Diff
mylyn/context/zip (2.06 KB, application/octet-stream)
2007-09-03 22:33 EDT, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2005-05-27 09:10:03 EDT
I20050527
This morning I opened an existing workspace that was compiling fine yesterday (I
did not try to run it and it was not the point), and I've noticed that it was no
longer compiling because the type I was refering was "not accessible due to
access restrictions".

It tooks me a second or two before thinking that it could be that the plugin
providing the type was not exporting the proper package. I fixed the package
export and everything worked. Trivial.
However I think for new comers to eclipse or even long time users this is not
trivial. This problem must have a quick fix guiding the users on things that can
be done to solve the problem.

I mark as major since to me this is a major usability issue
Comment 1 Wassim Melhem CLA 2005-05-27 10:30:32 EDT
a quickfix is not major.  It is an enhancement at best.
Comment 2 Pascal Rapicault CLA 2005-05-27 10:34:50 EDT
I agree that what I want is an enhancement, however it is a major enhancement,
because this error will cause the users to scratch their heads many times before
they can actually figure out what needs to be changed.
Comment 3 Chris Aniszczyk CLA 2007-08-27 12:00:34 EDT
adam adam adam :D
Comment 4 Adam Archer CLA 2007-08-30 15:41:31 EDT
Created attachment 77409 [details]
patch

Adds a quickfix when:

1) The source project is a plug-in project.
2) The unaccessible node resolves to a plug-in project in the workspace.
3) The package containing the unaccessible node is not exported in the MANIFEST.MF.

The one thing I'm not sure about is if JDT will dispose the quickfix icon that I provide. I expect that they should and, therefore, have not bothered to do it myself, but we need to confirm this.
Comment 5 Adam Archer CLA 2007-08-30 15:45:02 EDT
Chris, can you review this one?
Comment 6 Chris Aniszczyk CLA 2007-08-30 16:49:39 EDT
will do, this one looks like fun.
Comment 7 Adam Archer CLA 2007-08-31 13:53:25 EDT
Created attachment 77492 [details]
patch

Turns out JDT does not dispose the Image for us. Unfortunately, because there is no life cycle management on the proposal interface, we have to use the ImageRegistry.
Comment 8 Adam Archer CLA 2007-08-31 13:56:58 EDT
Created attachment 77493 [details]
patch

In the last patch, I changed the other use of the same image to use the copy in the registry, but I forgot to remove the code that disposes it. This one's good.
Comment 9 Chris Aniszczyk CLA 2007-09-03 22:33:18 EDT
Great job Adam. This is easily one of the greatest PDE quickfixes ever.

I only found a small issue where you would have multiple quickfixes if you had two access restriction notices on something like MyClass.MyStaticField. We want to make sure that we don't present duplicate quickfixes for exporting the same package. I also did some patch cleanup.

Thanks again Adam, this one was a good one.
Comment 10 Chris Aniszczyk CLA 2007-09-03 22:33:22 EDT
Created attachment 77605 [details]
mylyn/context/zip