### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v
retrieving revision 1.468
diff -u -r1.468 JavaModelManager.java
--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 28 Jul 2011 17:07:05 -0000 1.468
+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 14 Aug 2011 15:27:04 -0000
@@ -4788,10 +4788,11 @@
* @param optionValue The value of the option. If null
, then
* the option will be removed from the preferences instead.
* @param eclipsePreferences The eclipse preferences to be updated
+ * @param otherOptions more options being stored, used to avoid conflict between deprecated option and its compatible
* @return true
if the preferences have been changed,
* false
otherwise.
*/
- public boolean storePreference(String optionName, String optionValue, IEclipsePreferences eclipsePreferences) {
+ public boolean storePreference(String optionName, String optionValue, IEclipsePreferences eclipsePreferences, Map otherOptions) {
int optionLevel = this.getOptionLevel(optionName);
if (optionLevel == UNKNOWN_OPTION) return false; // unrecognized option
@@ -4809,6 +4810,8 @@
eclipsePreferences.remove(optionName); // get rid off old preference
String[] compatibleOptions = (String[]) this.deprecatedOptions.get(optionName);
for (int co=0, length=compatibleOptions.length; co < length; co++) {
+ if (otherOptions != null && otherOptions.containsKey(compatibleOptions[co]))
+ continue; // don't overwrite explicit value of otherOptions at compatibleOptions[co]
if (optionValue == null) {
eclipsePreferences.remove(compatibleOptions[co]);
} else {
@@ -4862,7 +4865,7 @@
if (defaultValue != null && defaultValue.equals(value)) {
value = null;
}
- storePreference(key, value, instancePreferences);
+ storePreference(key, value, instancePreferences, newOptions);
}
try {
// persist options
Index: model/org/eclipse/jdt/internal/core/JavaProject.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v
retrieving revision 1.447
diff -u -r1.447 JavaProject.java
--- model/org/eclipse/jdt/internal/core/JavaProject.java 10 May 2011 19:29:43 -0000 1.447
+++ model/org/eclipse/jdt/internal/core/JavaProject.java 14 Aug 2011 15:27:07 -0000
@@ -2928,7 +2928,7 @@
public void setOption(String optionName, String optionValue) {
// Store option value
IEclipsePreferences projectPreferences = getEclipsePreferences();
- boolean modified = JavaModelManager.getJavaModelManager().storePreference(optionName, optionValue, projectPreferences);
+ boolean modified = JavaModelManager.getJavaModelManager().storePreference(optionName, optionValue, projectPreferences, null);
// Write changes
if (modified) {
@@ -2957,7 +2957,7 @@
Map.Entry entry = (Map.Entry) entries.next();
String key = (String) entry.getKey();
String value = (String) entry.getValue();
- javaModelManager.storePreference(key, value, projectPreferences);
+ javaModelManager.storePreference(key, value, projectPreferences, newOptions);
}
// reset to default all options not in new map