Bug 188070 - [prefs] OSGi Preferences are not available after applying prefs from the root node
Summary: [prefs] OSGi Preferences are not available after applying prefs from the root...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-05-21 07:07 EDT by Danail Nachev CLA
Modified: 2007-05-22 16:47 EDT (History)
0 users

See Also:
tjwatson: review+
pascal: review+


Attachments
test project which trigger the bug (3.95 KB, application/zip)
2007-05-21 07:21 EDT, Danail Nachev CLA
no flags Details
proposal fix for this bug (2.00 KB, patch)
2007-05-21 07:28 EDT, Danail Nachev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Danail Nachev CLA 2007-05-21 07:07:34 EDT
The org.eclipse.core.internal.preferences.OSGiPreferencesServiceManager service factory keeps a reference to a node used when creating new OSGi preferences services for each bundle.

If for some reason this node is removed from the preferences hierarchy, the osgi prefs manager fails to function properly. The problem is that on each service request it tries to reference the node which fails, because the node is removed.

I found that one scenario when the node is removed is the following:

1) export the root preferences node
2) import the root preferences node

This will cause all nodes to be removed, because the root node is removed.
Comment 1 Danail Nachev CLA 2007-05-21 07:21:49 EDT
Created attachment 67966 [details]
test project which trigger the bug

This is a test project, which triggers the bug by following the scenario laid out above.
Comment 2 Danail Nachev CLA 2007-05-21 07:28:00 EDT
Created attachment 67968 [details]
proposal fix for this bug

This is a proposal fix for the bug. It checks whether the node was removed before using it.
Comment 3 DJ Houghton CLA 2007-05-22 11:17:12 EDT
+1. Adding Tom for review as well. Thanks for the patch.
Comment 4 Thomas Watson CLA 2007-05-22 12:17:31 EDT
Patch is good.  I also ran the OSGi TCK and it passes on the patched code.
Comment 5 DJ Houghton CLA 2007-05-22 16:47:04 EDT
Released.