Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 282965 - [console] Diag command returns dynamically imported packages as missing
Summary: [console] Diag command returns dynamically imported packages as missing
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows Vista
: P3 minor (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-09 03:19 EDT by Lazar Kirchev CLA
Modified: 2009-08-17 15:28 EDT (History)
1 user (show)

See Also:


Attachments
sample bundles to reproduce the problem (882 bytes, application/zip)
2009-07-09 03:19 EDT, Lazar Kirchev CLA
no flags Details
Patch adding optional/dynamic to unresolved optional/dynamic packages (2.12 KB, patch)
2009-08-11 12:35 EDT, Lazar Kirchev CLA
tjwatson: iplog+
Details | Diff
patch (4.52 KB, patch)
2009-08-17 15:25 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 Lazar Kirchev CLA 2009-07-09 03:19:58 EDT
Created attachment 141160 [details]
sample bundles to reproduce the problem

If a bundle imports dynamically packages, which are not provided by any other bundle currently installed, the diag command returns the dynamically imported packages as unresolved direct constraints. This really does not affect the resolving of the bundle and it gets resolved correctly and activated, but the imports are still reported by diag. 
When another bundle providing these packages is installed and activated, diag stops returning the dynamically imported packages as missing for the first bundle.
Since diag should return only info why a bundle cannot resolve, it should not report the dynamic imports, because they do not prevent the bundle from resolving.

A am attaching two sample bundles to reproduce the bug. Bundle HelloWorldDummy exports the packages com.foo.bar and com.acme.bar, and bundle HelloWorld imports them dynamically. To reproduce the issue follow the steps below:
1. Install HelloWorld
2. Start HelloWorld
3. Run ss command and observe that the bundle status is ACTIVE
3. Run diag command for this bundle
4. Observe that the command reports com.foo.bar and com.acme.bar as unresolved direct constraints
5. Install and run HelloWorldDummy
6. Run diag command for bundle HelloWorld
7. Obsorve that diag reports that there are no unresolved constraints
Comment 1 Lazar Kirchev CLA 2009-08-11 12:35:42 EDT
Created attachment 144075 [details]
Patch adding optional/dynamic to unresolved optional/dynamic packages

This patch adds to the missing import package, returned by diag, <optional> or <dynamic>, if the import has the respective resolution directive.
Comment 2 Thomas Watson CLA 2009-08-17 15:25:13 EDT
Created attachment 144721 [details]
patch

I decided to use the same approach as the message for optional require-bundle constraints.
Comment 3 Thomas Watson CLA 2009-08-17 15:27:10 EDT
Patch released.  Thanks Lazar.
Comment 4 Thomas Watson CLA 2009-08-17 15:28:24 EDT
Sorry for the spam, forgot to set to FIXED.