Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 95476 - StateHelper#getVisiblePackages returns system packages
Summary: StateHelper#getVisiblePackages returns system packages
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-16 18:00 EDT by Wassim Melhem CLA
Modified: 2005-05-19 13:04 EDT (History)
2 users (show)

See Also:


Attachments
Possible fix (2.25 KB, patch)
2005-05-16 19:28 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wassim Melhem CLA 2005-05-16 18:00:27 EDT
3.1M7

When PDE asks StateHelper to return all the packages visible to a particular 
bundle, the result includes all the system packages when the jre profile is 
set on the state.

This problematic for PDE and JDT because the 100+ system packages are 
associated with the osgi plugin.  So when PDE creates access rules for JDT to 
set on osgi.jar, every one of these system packages will have an associated 
access rule.  These rules are totally unnecessary on osgi.jar since said JAR 
does not contain any of these packages.

The only way PDE could help with system packages is if PDE had access over the 
JRE container, which we don't.

Therefore, when PDE asks for visible packages, please exclude system packages.
Comment 1 Thomas Watson CLA 2005-05-16 19:28:01 EDT
Created attachment 21243 [details]
Possible fix

Wassim, please test this out.
Comment 2 Wassim Melhem CLA 2005-05-16 19:37:48 EDT
I just verified that PDE now receives 39 exported packages for the 
org.eclipse.osgi plugin starting with org.osgi.framework and ending with 
org.eclipse.osgi.internal.resolver.

System packages are history.
Comment 3 Jeff McAffer CLA 2005-05-16 22:10:24 EDT
Keep in mind that in 3.2 we hope to have control over the JRE container as well 
so these packages will be interesting in the future.
Comment 4 Wassim Melhem CLA 2005-05-16 22:12:49 EDT
This will be tricky jeff, since the JRE container is owned by JDT and they 
would like to remain agnostic of anything Eclipse-y.
Comment 5 Jeff McAffer CLA 2005-05-16 22:36:44 EDT
that's why its a 3.2 item...
Comment 6 Thomas Watson CLA 2005-05-17 09:08:49 EDT
We can consider adding a getSystemPackages to State.  Can PDE somehow extend 
the JRE container (proper term?) to filter only the packages from 
getSystemPackages.  At a minimum it seems we could ask the JDT to add an 
option the the JRE container to filter a set of packages.  I may be way off 
since I am not that familiar with JDT.

Again this would not happen in 3.1.
Comment 7 Wassim Melhem CLA 2005-05-17 09:13:51 EDT
>At a minimum it seems we could ask the JDT to add an option the the JRE 
>container to filter a set of packages.

JDT does have such a mechanism, but it requires the user to manually add all 
these jre access rules into the .classpath file.  The user will then have to 
maintain it.

This is certainly far from the luxurious transparent support that PDE provides 
for its container.

We would certainly have to come up with a creative solution in 3.2 that 
maintains the generic nature of JDT and yet allow PDE to have some control 
over the JRE container.
Comment 8 Jeff McAffer CLA 2005-05-17 09:28:12 EDT
lets do both!  remove the system packages from the normal result and add 
getSystemPakcages.  That way PDE gets what they need and other users can 
reconstruct the full picture.
Comment 9 Thomas Watson CLA 2005-05-17 09:30:46 EDT
marking for RC1 ...
Comment 10 Thomas Watson CLA 2005-05-17 09:48:40 EDT
Fixed in HEAD.

Added the method State#getSystemPackages for future use by PDE.
Comment 11 Wassim Melhem CLA 2005-05-19 13:04:29 EDT
One idea might be for the plugin projects to not use the JRE container anymore 
and have the PDE add the JRE jars with the right access restrictions as part 
of the PDE container.