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

Bug 340243

Summary: [prefs] Allow contribution of preference scopes without extension registry
Product: [Eclipse Project] Equinox Reporter: Gunnar Wagenknecht <gunnar>
Component: CompendiumAssignee: equinox.compendium-inbox <equinox.compendium-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: tjwatson
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Gunnar Wagenknecht CLA 2011-03-16 16:45:05 EDT
3.7M6

I just debugged a weird runtime issue and it turned out that, a bundle was using my own preference scope implementation. However, it did not get my scope implementation but a dummy instance of EclipsePreference.

The issue is that all bundles had been activated except the registry bundle. The registry bundle was activates later in the stack.

This is the activation flow:
-> org.eclipse.equinox.preferences
-> my.preferences.impl
-> some.bundle.using.my.prefs
-> org.eclipse.equinox.registry

This would be solved if my.preferences.impl was allowed to contribute org.eclipse.core.runtime.preferences.IScope implementations as an OSGi service.
Comment 1 Gunnar Wagenknecht CLA 2011-03-16 16:46:11 EDT
BTW, there is a simple workaround. Just hard reference IExtensionRegistry in my.preferences.impl which will trigger activation of the registry bundle.
Comment 2 Thomas Watson CLA 2011-03-16 17:02:54 EDT
I'm confused, wouldn't preferences use of the extension registry also cause the registry to get started when it is activated?
Comment 3 Gunnar Wagenknecht CLA 2011-03-16 17:09:21 EDT
No, it explicitly uses a string reference in it's activators in case the registry isn't there. Thus, there is no registry class-loading involved during preference activation.
Comment 4 Lars Vogel CLA 2019-11-08 04:38:11 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant please remove the stalebug whiteboard tag.