Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344567

Summary: [region] all singletons are treated as non-singletons
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: ComponentsAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: b.kapukaranov, glyn.normington
Version: unspecifiedFlags: glyn.normington: review+
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 344631    
Bug Blocks:    
Attachments:
Description Flags
Patch + unit tests
none
Patch + unit and system tests none

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.