Bug 105779 - [osgi] console shows plugin using dynamic import as importing all packages availble on runtime platform
Summary: [osgi] console shows plugin using dynamic import as importing all packages av...
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.1   Edit
Assignee: Thomas Watson CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
: 100054 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-02 09:05 EDT by Michael Burkhart CLA Friend
Modified: 2005-08-17 13:52 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix for 3.1.1 (838 bytes, patch)
2005-08-03 13:40 EDT, Thomas Watson CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Burkhart CLA Friend 2005-08-02 09:05:57 EDT
If my plugin has a Dynamic-Import: * in it's manifest file, when I launch my 
eclipse runtime with the -console option and run a "bundle <bundle-id>" 
against that bundle it shows all of the packages available on the platform in 
the Imported packages list.
Comment 1 Michael Burkhart CLA Friend 2005-08-02 09:20:43 EDT
One correction to the above note, it should have been DynamicImport-Package: 
*  not Dynamic-Import: *. Sorry.
Comment 2 Pascal Rapicault CLA Friend 2005-08-02 09:23:39 EDT
What do you expect to see?
Comment 3 Thomas Watson CLA Friend 2005-08-02 09:40:41 EDT
For dynamically imported packages, the expectation is to see only the package 
wirings for the packages which the bundle loaded at least one class or 
resource from.

There are two situations which cause the Framework to aggressively wire 
dynamic imports.

-  When PackageAdmin is used to find bundles which import an exported packaged 
(ExportedPackage#getImportingBundles).  If a bundle dynamically imports the 
exported package then it is wired to the exported package when 
getImportingBundles is called.  This is the case when using the "bundle" 
command in the console.

-  When firing ServiceEvents the Framework checks for package consistency 
between the bundle which registered the service and the listener bundle.  If 
the listener bundle dynamically imports the package then it gets wired to the 
exported package during this check.

The framework should avoid wiring dynamic imports until the bundle actually 
loads a class or resource from the dynamically imported package.  Both cases 
above can easily be avoided.  The fix for this is simple and should be 
considered for 3.1.1.
Comment 4 Thomas Watson CLA Friend 2005-08-03 13:35:05 EDT
Fixed in HEAD (3.2).  Will attach patch for R3_1_maintenance branch.
Comment 5 Thomas Watson CLA Friend 2005-08-03 13:40:34 EDT
Created attachment 25624 [details]
Proposed fix for 3.1.1

Pascal, please review patch for 3.1.1.
Comment 6 Pascal Rapicault CLA Friend 2005-08-04 17:06:36 EDT
Patch good to go. It has been released in the maintenance stream.
Comment 7 Thomas Watson CLA Friend 2005-08-17 13:52:33 EDT
*** Bug 100054 has been marked as a duplicate of this bug. ***