resource bundle editor: do not update tree nodes if duplicated-key property is appear...
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Fri, 7 Oct 2016 07:51:22 +0000 (10:51 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Fri, 7 Oct 2016 07:53:44 +0000 (10:53 +0300)
plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java

index d2af3f6dcc2edfe27c82f652415e42c764979c67..28c1b63f7b60c515bdd829bed4c1cab1e989daa7 100644 (file)
@@ -69,12 +69,13 @@ public class ResourceBundleFileStructureViewElement implements StructureViewTree
     final HashSet<String> remains = new HashSet<>(myElements.keySet());
     for (Map.Entry<String, Collection<IProperty>> entry : propertyNames.entrySet()) {
       final String propKey = entry.getKey();
-      final IProperty representative = entry.getValue().iterator().next();
+      Collection<IProperty> properties = entry.getValue();
       final ResourceBundlePropertyStructureViewElement oldPropertyNode = myElements.get(propKey);
-      if (oldPropertyNode != null && oldPropertyNode.getProperty() == representative) {
+      if (oldPropertyNode != null && properties.contains(oldPropertyNode.getProperty())) {
         remains.remove(propKey);
         continue;
       }
+      final IProperty representative = properties.iterator().next();
       final ResourceBundlePropertyStructureViewElement node = new ResourceBundlePropertyStructureViewElement(representative);
       myElements.put(propKey, node);
     }