Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345640 - composite bundle which has substitutable exports does not work
Summary: composite bundle which has substitutable exports does not work
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 RC2   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 350739
  Show dependency tree
 
Reported: 2011-05-12 14:16 EDT by Thomas Watson CLA
Modified: 2011-06-29 14:47 EDT (History)
3 users (show)

See Also:
hargrave: review+
dj.houghton: review+


Attachments
patch + tests (5.77 KB, patch)
2011-05-12 14:22 EDT, Thomas Watson CLA
no flags Details | Diff
updated patch and tests (6.38 KB, patch)
2011-05-13 14:23 EDT, Thomas Watson CLA
no flags Details | Diff
updated patch and tests (5.64 KB, patch)
2011-05-13 14:37 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 Thomas Watson CLA 2011-05-12 14:16:14 EDT
If a composite bundle exports and imports the same package things do not work as expected when the resolver chooses the composite to be the exporter of the package.  When ends up happening is we incorrectly create a surrogate that has metadata to export and import the package.  The resolver for the surrogate/composite framework then may choose to make the surrogate an importer or an exporter of the package.  Since the surrogate is at bundle id 0 it is very likely that it will be resolved first and given preference to be the exporter.

So now we have the composite bundle on the outside thinking it is the exporter of the package, and the surrogate on the inside thinking it is the exporter of the package, but meanwhile no one gets wired to the actual provider of the package, which must be from another bundle installed inside of the composite.
Comment 1 Thomas Watson CLA 2011-05-12 14:22:42 EDT
Created attachment 195519 [details]
patch + tests

Here is a patch and test for the issue.  This patch applies cleanly to both 3.6 and 3.7 streams.
Comment 2 Thomas Watson CLA 2011-05-12 14:29:22 EDT
Considering for RC2.  Will need 2 additional committer reviews.
Comment 3 Thomas Watson CLA 2011-05-12 14:31:43 EDT
DJ, please review also.

DJ and BJ, please ping me to discuss.  This is not very straight forward.
Comment 4 Thomas Watson CLA 2011-05-13 14:23:19 EDT
Created attachment 195620 [details]
updated patch and tests

Updated patch to fix copy and paste error in the test.  It was using the wrong test method name for the composite bundle location.  Now it justs getName() instead.
Comment 5 Thomas Watson CLA 2011-05-13 14:37:59 EDT
Created attachment 195623 [details]
updated patch and tests

Same patch but removed the extra resource files that were meant for the testcase in bug 345743.
Comment 6 Thomas Watson CLA 2011-05-13 15:58:35 EDT
Patch released.