Bug 93891

Summary: Restricted UIPlugin is in my code assist
Product: [Eclipse Project] JDT Reporter: Wassim Melhem <wassim.melhem>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_audel, jerome_lanneluc, philippe_mulet
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Wassim Melhem CLA 2005-05-06 07:02:38 EDT
Build: N-20050506

1. Fresh workspace
2. File > New > Project...>Plug-in Project>Next
3. Enter 'com.example.xyz' as the project name.  Next.
4. Press Finish.
5. Using the plugin import wizard, import org.eclipse.ui AS SOURCE
6. Open the manifest.mf of org.eclipse.ui an delete the Export-Package header.
This in effect should make the two types in org.eclipse.ui inaccessible to all 
other plugins.

7. In the constructor of XyzPlugin, type UI and then ctrl-space.
You will see that UIPlugin is the first proposal, even though it is coming 
from org.eclipse.ui and is forbidden.  That's the bug.

8. Select the forbidden proposal and complete the statement as:
UIPlugin bla = null;

9. Save.  You will see that UIPlugin is now flagged as an error because it is 
forbidden.  This is correct.  So the classpath is correct.
Comment 1 David Audel CLA 2005-05-17 06:01:18 EDT
Fixed and test added
  CompletionTests2#testBug93891()

The problem was inside JavaSearchScope.
Now, add(JavaProject, IPath, int, HashSet, IClasspathEntry) use 'entry' instead
of 'rawEntry' to compute access restriction.
Comment 2 Maxime Daniel CLA 2005-05-27 04:40:45 EDT
Verified on build I20050526-2000-win32.