Bug 431924 - [Preferences] org.eclipse.ui.internal.preferences.WorkingCopy.keys() returns removed keys
Summary: [Preferences] org.eclipse.ui.internal.preferences.WorkingCopy.keys() returns ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Paul Webster CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2014-04-03 10:45 EDT by Bernd Fuhrmann CLA
Modified: 2014-04-29 09:09 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Fuhrmann CLA 2014-04-03 10:45:39 EDT
I created a working copy of some non-empty preferences. Then I removed some key from the working copy. However, that key is still mentioned in the result of keys():

IEclipsePreferences somePrefs;
somePrefs.put("something", "whatever");// just something, so it's not empty
workingCopyManager = new WorkingCopyManager();
workingCopy = workingCopyManager.getWorkingCopy(somePrefs);

workingCopy.remote("something");

for (String s:workingCopy.keys()) {System.out.println(s);}

"something" will still be printed here.

The cause for this seems to be this one:
org.eclipse.ui.internal.preferences.WorkingCopy.Preferences.keys
it doesn't reduce it's result be the keys set to null.
Comment 1 Timo Kinnunen CLA 2014-04-05 15:55:20 EDT
Pushed a fix to Gerrit for review: https://git.eclipse.org/r/24496
Comment 3 Paul Webster CLA 2014-04-29 09:09:43 EDT
In 4.4.0.I20140428-2000

PW