Bug 26255 - project compiler settings : cannot go back to worspace settings
Summary: project compiler settings : cannot go back to worspace settings
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-14 05:46 EST by Adam Kiezun CLA
Modified: 2002-12-17 07:25 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-11-14 05:46:32 EST
20021113
after i switched to project settings i cannot go back to workspace settings 
again
Comment 1 Adam Kiezun CLA 2002-11-14 08:31:33 EST
critical - i could not find a good workaround
Comment 2 Martin Aeschlimann CLA 2002-11-14 11:39:37 EST
the problem is in IJavaProject.setOptions, it only iterates the element in the 
new map, but not all options: cleared options are not recognixed and not 
cleared in the underlying store.

I fixed it for M3 by adding a setOptions(null) first.

	public void setOptions(Map newOptions) {

		Preferences preferences;
		if (newOptions == null){
			setPreferences(preferences = new Preferences());
		} else {
			preferences = getPreferences();
			Iterator keys = newOptions.keySet().iterator();
			while (keys.hasNext()){
				String key = (String)keys.next();
				if (!JavaModelManager.OptionNames.contains
(key)) continue; // unrecognized option
				// no filtering for encoding (custom encoding 
for project is allowed)
				String value = (String)newOptions.get(key);
				preferences.setValue(key, value);
			}
		}
		
		// persist options
		savePreferences(preferences);	
	}
Comment 3 Philipe Mulet CLA 2002-11-21 11:03:04 EST
Fixed. The preference object is always reinitialized.
Comment 4 David Audel CLA 2002-12-17 07:25:10 EST
Verified.