diff --git a/.idea/ant.xml b/.idea/ant.xml
index 2debdc230402..da9cafe3e95c 100644
--- a/.idea/ant.xml
+++ b/.idea/ant.xml
@@ -1,15 +1,7 @@
-
-
-
-
-
-
-
-
-
+
diff --git a/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java b/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java
index d0f17ba7c4c7..518e12a25cfe 100644
--- a/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java
+++ b/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java
@@ -17,10 +17,7 @@
package com.intellij.util.config;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.util.Factory;
-import com.intellij.openapi.util.InvalidDataException;
-import com.intellij.openapi.util.JDOMExternalizable;
-import com.intellij.openapi.util.WriteExternalException;
+import com.intellij.openapi.util.*;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
@@ -77,17 +74,19 @@ public class ExternalizablePropertyContainer
public void readExternal(Element element) throws InvalidDataException {
HashMap propertyByName = new HashMap();
- for (Iterator iterator = myExternalizers.keySet().iterator(); iterator.hasNext();) {
- AbstractProperty abstractProperty = iterator.next();
+ for (AbstractProperty abstractProperty : myExternalizers.keySet()) {
propertyByName.put(abstractProperty.getName(), abstractProperty);
}
- List children = element.getChildren();
- for (Iterator iterator = children.iterator(); iterator.hasNext();) {
- Element child = iterator.next();
+ final List children = element.getChildren();
+ for (Element child : children) {
AbstractProperty property = propertyByName.get(child.getName());
- if (property == null) continue;
- Externalizer externalizer = myExternalizers.get(property);
- if (externalizer == null) continue;
+ if (property == null) {
+ continue;
+ }
+ final Externalizer externalizer = myExternalizers.get(property);
+ if (externalizer == null) {
+ continue;
+ }
myValues.put(property, externalizer.readValue(child));
}
}
@@ -96,13 +95,16 @@ public class ExternalizablePropertyContainer
List properties = new ArrayList(myExternalizers.keySet());
Collections.sort(properties, AbstractProperty.NAME_COMPARATOR);
for (AbstractProperty property : properties) {
- Externalizer externalizer = myExternalizers.get(property);
+ final Externalizer externalizer = myExternalizers.get(property);
if (externalizer == null) {
continue;
}
- Element child = new Element(property.getName());
- externalizer.writeValue(child, getValueOf(property));
- element.addContent(child);
+ final Object propValue = property.get(this);
+ if (!Comparing.equal(propValue, property.getDefault(this))) {
+ final Element child = new Element(property.getName());
+ externalizer.writeValue(child, propValue);
+ element.addContent(child);
+ }
}
}