Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 388004 - [prefs] DefaultPreferences#nodeExists does not consult pluginCustomization file
Summary: [prefs] DefaultPreferences#nodeExists does not consult pluginCustomization file
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.8.1 Juno   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: Kepler M2   Edit
Assignee: Szymon Ptaszkiewicz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 287579 387783
  Show dependency tree
 
Reported: 2012-08-24 11:37 EDT by Szymon Ptaszkiewicz CLA
Modified: 2012-09-18 14:27 EDT (History)
0 users

See Also:
john.arthorne: review+


Attachments
Test case (3.80 KB, patch)
2012-08-24 11:48 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff
Patch v.0.1 (5.46 KB, patch)
2012-08-27 09:51 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff
Patch v.0.2 (5.90 KB, patch)
2012-09-17 08:46 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff
Test case v.0.2 (4.87 KB, patch)
2012-09-17 08:47 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Ptaszkiewicz CLA 2012-08-24 11:37:30 EDT
While working on bug 287579 it turned out that if we use -pluginCustomization <file> to pass default preferences, those preferences are not visible unless node that will store those preferences will be programatically created. This is a problem for users that do not create node in advance just to check some preference in that node. To be precise it is problematic when using the nodeExists method because it returns false if the node is defined/used in the file.
Comment 1 Szymon Ptaszkiewicz CLA 2012-08-24 11:48:09 EDT
Created attachment 220276 [details]
Test case
Comment 2 Szymon Ptaszkiewicz CLA 2012-08-24 11:51:26 EDT
DefaultPreferences are now part of o.e.equinox.preferences bundle so moving to Equinox/Compendium.
Comment 3 Szymon Ptaszkiewicz CLA 2012-08-27 09:51:03 EDT
Created attachment 220337 [details]
Patch v.0.1
Comment 4 Szymon Ptaszkiewicz CLA 2012-08-27 09:55:52 EDT
Patch is for the rt.equinox.bundles repo and test is for the eclipse.platform.runtime repo (that's where I found other tests related to preferences). Can someone review?
Comment 5 Szymon Ptaszkiewicz CLA 2012-09-17 08:38:12 EDT
(In reply to comment #4)
> Can someone review?

I have reviewed it myself and I found that absolute and empty paths are not handled correctly. Updated patch and test case will follow.
Comment 6 Szymon Ptaszkiewicz CLA 2012-09-17 08:46:32 EDT
Created attachment 221145 [details]
Patch v.0.2
Comment 7 Szymon Ptaszkiewicz CLA 2012-09-17 08:47:23 EDT
Created attachment 221146 [details]
Test case v.0.2
Comment 8 Szymon Ptaszkiewicz CLA 2012-09-17 08:52:27 EDT
John, can you review?
Comment 9 John Arthorne CLA 2012-09-18 14:27:49 EDT
The fix and test look good to me. The fix looks a bit more complicated  because it refactors some of the initialization code. However the crux of the fix is in DefaultPreferences#nodeExists which now lazily initializes the custom preferences before failing to find a node. Fix in master:

http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=2b5d91c51e72acc9105fc908c8829598ba7c8329

And test:

http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=d41164e4b98acdb50d9559b4c433c722994e20f7