Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344567 - [region] all singletons are treated as non-singletons
Summary: [region] all singletons are treated as non-singletons
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Components (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 344631
Blocks:
  Show dependency tree
 
Reported: 2011-05-03 09:37 EDT by Thomas Watson CLA
Modified: 2011-05-03 23:15 EDT (History)
2 users (show)

See Also:
glyn.normington: review+


Attachments
Patch + unit tests (5.71 KB, patch)
2011-05-03 10:31 EDT, Thomas Watson CLA
no flags Details | Diff
Patch + unit and system tests (15.17 KB, patch)
2011-05-03 16:40 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-03 09:37:38 EDT
In org.eclipse.equinox.internal.region.hook.RegionResolverHook we have the following method

public void filterSingletonCollisions(BundleCapability singleton, 
  Collection<BundleCapability> collisionCandidates) {
	collisionCandidates.clear(); // XXX temporary hack in lieu of Borislav's changes
}

Clearing all collisionCandidates will cause all singleton bundles to be treated as non-singletons.  At a minimum we must keep all collision candidates that are in the same region as the specified singleton.  We may want to consider candidates in other regions that are visible to the region containing the singleton.
Comment 1 Glyn Normington CLA 2011-05-03 09:38:53 EDT
Yes, I think the normal digraph visibility rules should apply here for consistency.
Comment 2 Thomas Watson CLA 2011-05-03 09:58:10 EDT
I will take a shot at implementing this.
Comment 3 Glyn Normington CLA 2011-05-03 10:00:41 EDT
Thanks Tom.
Comment 4 Thomas Watson CLA 2011-05-03 10:31:06 EDT
Created attachment 194588 [details]
Patch + unit tests

Here is what I was thinking.  Simply using the same logic as filterMatches except if the region cannot be found for the singleton bundle then retain all collisions.  Still need to write some system tests.
Comment 5 Thomas Watson CLA 2011-05-03 10:33:38 EDT
Glyn, could you give me a review.  I would like to release this later today after writing some system tests, but wanted to get a review from you before you leave for the day.
Comment 6 Glyn Normington CLA 2011-05-03 10:34:13 EDT
(In reply to comment #4)
> Created attachment 194588 [details]
> Patch + unit tests
> 
> Here is what I was thinking.  Simply using the same logic as filterMatches
> except if the region cannot be found for the singleton bundle then retain all
> collisions.  Still need to write some system tests.

Looks like a good fix to me.
Comment 7 Thomas Watson CLA 2011-05-03 14:44:01 EDT
In writing some system tests I found bug344631 which blocks this bug from being fixed properly.
Comment 8 Thomas Watson CLA 2011-05-03 16:40:55 EDT
Created attachment 194646 [details]
Patch + unit and system tests

The system test will fail until bug344631 is fixed.
Comment 9 Thomas Watson CLA 2011-05-03 23:15:11 EDT
patch released.