diff --git a/dom/impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java b/dom/impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java index bc1991d87d8c..29e96cc7c20e 100644 --- a/dom/impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java +++ b/dom/impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java @@ -608,8 +608,8 @@ public abstract class DomInvocationHandler extends UserDataHolderBase implements myGenericInfo.buildMethodMaps(); if (ATTRIBUTES == qname) { - for (Map.Entry entry : myGenericInfo.getAttributeChildrenEntries()) { - getOrCreateAttributeChild(entry.getKey().findMethod(getRawType()), entry.getValue().createEvaluatedXmlName(this)); + for (Map.Entry entry : myGenericInfo.getAttributeChildrenEntries()) { + getOrCreateAttributeChild(entry.getValue().findMethod(getRawType()), entry.getKey().createEvaluatedXmlName(this)); } } diff --git a/dom/impl/src/com/intellij/util/xml/impl/GenericInfoImpl.java b/dom/impl/src/com/intellij/util/xml/impl/GenericInfoImpl.java index 24ebbbad503c..c19d6de82065 100644 --- a/dom/impl/src/com/intellij/util/xml/impl/GenericInfoImpl.java +++ b/dom/impl/src/com/intellij/util/xml/impl/GenericInfoImpl.java @@ -38,6 +38,7 @@ public class GenericInfoImpl implements DomGenericInfo { private final Map myCollectionChildrenGetterMethods = new THashMap(); private final Map myCollectionChildrenAdditionMethods = new THashMap(); private final Map myCollectionChildrenClasses = new TreeMap(); + private final Map myAttributes = new TreeMap(); private final Map myAttributeChildrenMethods = new THashMap(); private final Map> myCompositeChildrenMethods = new THashMap>(); private final Map>> myCompositeCollectionAdditionMethods = @@ -69,8 +70,8 @@ public class GenericInfoImpl implements DomGenericInfo { return myCollectionChildrenClasses.get(tagName); } - final Set> getAttributeChildrenEntries() { - return myAttributeChildrenMethods.entrySet(); + final Set> getAttributeChildrenEntries() { + return myAttributes.entrySet(); } final Set getFixedChildrenNames() { @@ -82,7 +83,7 @@ public class GenericInfoImpl implements DomGenericInfo { } final Collection getAttributeChildrenNames() { - return myAttributeChildrenMethods.values(); + return myAttributes.keySet(); } final Pair getFixedChildInfo(JavaMethodSignature method) { @@ -256,7 +257,9 @@ public class GenericInfoImpl implements DomGenericInfo { final String s = annotation == null ? null : annotation.value(); String attributeName = StringUtil.isEmpty(s) ? getNameFromMethod(signature, true) : s; assert attributeName != null && StringUtil.isNotEmpty(attributeName) : "Can't guess attribute name from method name: " + method.getName(); - myAttributeChildrenMethods.put(signature, XmlName.create(attributeName, method)); + final XmlName attrName = XmlName.create(attributeName, method); + myAttributeChildrenMethods.put(signature, attrName); + myAttributes.put(attrName, signature); return true; } @@ -553,9 +556,9 @@ public class GenericInfoImpl implements DomGenericInfo { } @Nullable public AttributeChildDescriptionImpl getAttributeChildDescription(XmlName attributeName) { - final JavaMethod getter = findGetterMethod(myAttributeChildrenMethods, attributeName); - if (getter == null) return null; - return new AttributeChildDescriptionImpl(attributeName, getter); + buildMethodMaps(); + final JavaMethodSignature signature = myAttributes.get(attributeName); + return signature == null ? null : new AttributeChildDescriptionImpl(attributeName, JavaMethod.getMethod(myClass, signature)); } public final Type[] getConcreteInterfaceVariants() { @@ -571,9 +574,9 @@ public class GenericInfoImpl implements DomGenericInfo { public List getAttributeChildrenDescriptions() { buildMethodMaps(); final ArrayList result = new ArrayList(); - for (Map.Entry entry : myAttributeChildrenMethods.entrySet()) { - final JavaMethod getter = JavaMethod.getMethod(myClass, entry.getKey()); - result.add(new AttributeChildDescriptionImpl(entry.getValue(), getter)); + for (final Map.Entry entry : myAttributes.entrySet()) { + final JavaMethod getter = JavaMethod.getMethod(myClass, entry.getValue()); + result.add(new AttributeChildDescriptionImpl(entry.getKey(), getter)); } return result; }