IDEA-78820 Greedy removing of unused namespace declaration
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 26 Dec 2011 11:53:38 +0000 (15:53 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 26 Dec 2011 11:53:38 +0000 (15:53 +0400)
(cherry picked from commit df957c16d4f24d7a9367bfb23902256680129228)

xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java

index 009a89b175cd5578e081aa7b2600c8318371bd13..c49be1b8653f79ef60fcc38d780e22ba0c050b06 100644 (file)
@@ -182,7 +182,7 @@ public class XmlUnusedNamespaceInspection extends XmlSuppressableInspectionTool
 
   private static PsiReference[] getLocationReferences(String namespace, XmlAttributeValue value) {
     PsiReference[] references = value.getReferences();
-    for (int i = 0, referencesLength = references.length; i < referencesLength; i++) {
+    for (int i = 0, referencesLength = references.length; i < referencesLength; i+=2) {
       PsiReference reference = references[i];
       if (namespace.equals(getNamespaceFromReference(reference))) {
         if (i + 1 < referencesLength) {