View | Details | Raw Unified | Return to bug 346010 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-2 / +5 lines)
Lines 4788-4797 Link Here
4788
	 * @param optionValue The value of the option. If <code>null</code>, then
4788
	 * @param optionValue The value of the option. If <code>null</code>, then
4789
	 * 	the option will be removed from the preferences instead.
4789
	 * 	the option will be removed from the preferences instead.
4790
	 * @param eclipsePreferences The eclipse preferences to be updated
4790
	 * @param eclipsePreferences The eclipse preferences to be updated
4791
	 * @param otherOptions more options being stored, used to avoid conflict between deprecated option and its compatible
4791
	 * @return <code>true</code> if the preferences have been changed,
4792
	 * @return <code>true</code> if the preferences have been changed,
4792
	 * 	<code>false</code> otherwise.
4793
	 * 	<code>false</code> otherwise.
4793
	 */
4794
	 */
4794
	public boolean storePreference(String optionName, String optionValue, IEclipsePreferences eclipsePreferences) {
4795
	public boolean storePreference(String optionName, String optionValue, IEclipsePreferences eclipsePreferences, Map otherOptions) {
4795
		int optionLevel = this.getOptionLevel(optionName);
4796
		int optionLevel = this.getOptionLevel(optionName);
4796
		if (optionLevel == UNKNOWN_OPTION) return false; // unrecognized option
4797
		if (optionLevel == UNKNOWN_OPTION) return false; // unrecognized option
4797
		
4798
		
Lines 4809-4814 Link Here
4809
				eclipsePreferences.remove(optionName); // get rid off old preference
4810
				eclipsePreferences.remove(optionName); // get rid off old preference
4810
				String[] compatibleOptions = (String[]) this.deprecatedOptions.get(optionName);
4811
				String[] compatibleOptions = (String[]) this.deprecatedOptions.get(optionName);
4811
				for (int co=0, length=compatibleOptions.length; co < length; co++) {
4812
				for (int co=0, length=compatibleOptions.length; co < length; co++) {
4813
					if (otherOptions != null && otherOptions.containsKey(compatibleOptions[co]))
4814
						continue; // don't overwrite explicit value of otherOptions at compatibleOptions[co]
4812
					if (optionValue == null) {
4815
					if (optionValue == null) {
4813
						eclipsePreferences.remove(compatibleOptions[co]);
4816
						eclipsePreferences.remove(compatibleOptions[co]);
4814
					} else {
4817
					} else {
Lines 4862-4868 Link Here
4862
					if (defaultValue != null && defaultValue.equals(value)) {
4865
					if (defaultValue != null && defaultValue.equals(value)) {
4863
						value = null;
4866
						value = null;
4864
					}
4867
					}
4865
					storePreference(key, value, instancePreferences);
4868
					storePreference(key, value, instancePreferences, newOptions);
4866
				}
4869
				}
4867
				try {
4870
				try {
4868
					// persist options
4871
					// persist options
(-)model/org/eclipse/jdt/internal/core/JavaProject.java (-2 / +2 lines)
Lines 2928-2934 Link Here
2928
	public void setOption(String optionName, String optionValue) {
2928
	public void setOption(String optionName, String optionValue) {
2929
		// Store option value
2929
		// Store option value
2930
		IEclipsePreferences projectPreferences = getEclipsePreferences();
2930
		IEclipsePreferences projectPreferences = getEclipsePreferences();
2931
		boolean modified = JavaModelManager.getJavaModelManager().storePreference(optionName, optionValue, projectPreferences);
2931
		boolean modified = JavaModelManager.getJavaModelManager().storePreference(optionName, optionValue, projectPreferences, null);
2932
2932
2933
		// Write changes
2933
		// Write changes
2934
		if (modified) {
2934
		if (modified) {
Lines 2957-2963 Link Here
2957
					Map.Entry entry = (Map.Entry) entries.next();
2957
					Map.Entry entry = (Map.Entry) entries.next();
2958
					String key = (String) entry.getKey();
2958
					String key = (String) entry.getKey();
2959
					String value = (String) entry.getValue();
2959
					String value = (String) entry.getValue();
2960
					javaModelManager.storePreference(key, value, projectPreferences);
2960
					javaModelManager.storePreference(key, value, projectPreferences, newOptions);
2961
				}
2961
				}
2962
2962
2963
				// reset to default all options not in new map
2963
				// reset to default all options not in new map

Return to bug 346010