Bug 567125 - Contract of Platform.getPreferencesService or IEclipsePreferences is not defined
Summary: Contract of Platform.getPreferencesService or IEclipsePreferences is not defined
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-18 11:08 EDT by Wim Jongman CLA
Modified: 2020-09-18 11:15 EDT (History)
0 users

See Also:


Attachments
Project that shows the bahvior (3.29 KB, application/x-zip-compressed)
2020-09-18 11:08 EDT, Wim Jongman CLA
no flags Details
Project that shows the behavior (3.29 KB, application/x-zip-compressed)
2020-09-18 11:11 EDT, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Jongman CLA 2020-09-18 11:08:18 EDT
Created attachment 284175 [details]
Project that shows the bahvior

The code below always prints "node /fails does not exist". The flush is accepted, no errors are thrown and the javadoc does not state anywhere that this construct is not valid.

See attached project. This project must be set to autostart in the run config. 

 Preferences root = Platform.getPreferencesService().getRootNode();
 Preferences testnode;
 if (!root.nodeExists("fails")) {
	System.out.println("node /fails does not exist");
 }
 testnode = root.node("test");
 System.out.println(testnode.get("key", "fails"));
 testnode.put("key", "works");
 System.out.println(testnode.get("key", "fails"));
 testnode.flush();
Comment 1 Wim Jongman CLA 2020-09-18 11:11:42 EDT
Created attachment 284176 [details]
Project that shows the behavior
Comment 2 Wim Jongman CLA 2020-09-18 11:12:45 EDT
Apologies, there was a bug in my bug report.

The code below always prints "node /fails does not exist". The flush is accepted, no errors are thrown and the javadoc does not state anywhere that this construct is not valid.

See attached project. This project must be set to autostart in the run config. 

 Preferences root = Platform.getPreferencesService().getRootNode();
 Preferences testnode;
 if (!root.nodeExists("fails")) {
	System.out.println("node /fails does not exist");
 }
 testnode = root.node("test");
 System.out.println(testnode.get("key", "fails"));
 testnode.put("key", "works");
 System.out.println(testnode.get("key", "fails"));
 testnode.flush();
Comment 3 Wim Jongman CLA 2020-09-18 11:15:48 EDT
3rd time. Apologies for the spam.

The code below always prints "node /fails does not exist". The flush is accepted, no errors are thrown and the javadoc does not state anywhere that this construct is not valid.

See attached project. This project must be set to autostart in the run config. 

 Preferences root = Platform.getPreferencesService().getRootNode();
 Preferences testnode;
 if (!root.nodeExists("fails")) {
	System.out.println("node /fails does not exist");
 }
 testnode = root.node("fails"); <--- 
 System.out.println(testnode.get("key", "fails"));
 testnode.put("key", "works");
 System.out.println(testnode.get("key", "fails"));
 testnode.flush();