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

Bug 316031

Summary: Is singleton defined in the right place?
Product: [Eclipse Project] Equinox Reporter: John Arthorne <john.arthorne>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description John Arthorne CLA 2010-06-07 13:16:14 EDT
3.6

From looking at bug 315853, it seemed wrong that two completely unrelated IU's clashed with each other in this way. Namespacing should allow us to avoid unrelated IU's interfering with each other. However, namespaces are only on provided capabilities, but "singletonness" is defined on the IU. If the singleton attribute was defined on the provided capability instead, we wouldn't have such collisions. For example imagine we had a singleton bundle and a feature with the same IU ID:

Bundle x:
 provided capability: "org.eclipse.equinox.p2.iu", "x"
 provided capability: "osgi.bundle", "x", singleton=true

Feature x:
 provided capability: "org.eclipse.equinox.p2.iu", "x"
 provided capability: "org.eclipse.update.feature", "x", singleton=true

With this scheme the bundle and feature IU's have the same ID, but it's ok because one provides a singleton bundle and the other provides a singleton feature.

Maybe it's too late to rethink this but wanted to open the bug for discussion of whether this makes any sense (obviously for post 3.6)
Comment 1 John Arthorne CLA 2010-06-07 13:27:12 EDT
I see Pascal raised the exact same question during last year's end-game...

*** This bug has been marked as a duplicate of bug 277523 ***