mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not store default values in ant.xml
This commit is contained in:
Generated
+1
-9
@@ -1,15 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AntConfiguration">
|
||||
<defaultAnt bundledAnt="true" />
|
||||
<buildFile url="file://$PROJECT_DIR$/build/update.xml">
|
||||
<additionalClassPath />
|
||||
<antReference projectDefault="true" />
|
||||
<customJdkName value="" />
|
||||
<maximumHeapSize value="128" />
|
||||
<maximumStackSize value="2" />
|
||||
<properties />
|
||||
</buildFile>
|
||||
<buildFile url="file://$PROJECT_DIR$/build/update.xml" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
||||
+18
-16
@@ -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<String, AbstractProperty> propertyByName = new HashMap<String, AbstractProperty>();
|
||||
for (Iterator<AbstractProperty> iterator = myExternalizers.keySet().iterator(); iterator.hasNext();) {
|
||||
AbstractProperty abstractProperty = iterator.next();
|
||||
for (AbstractProperty abstractProperty : myExternalizers.keySet()) {
|
||||
propertyByName.put(abstractProperty.getName(), abstractProperty);
|
||||
}
|
||||
List<Element> children = element.getChildren();
|
||||
for (Iterator<Element> iterator = children.iterator(); iterator.hasNext();) {
|
||||
Element child = iterator.next();
|
||||
final List<Element> 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<AbstractProperty> properties = new ArrayList<AbstractProperty>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user