@Override
  public @NotNull CollectingInfoRunnable processFile(final @NotNull PsiFile file) {
    XmlFile xmlFile = (XmlFile)file;
    Project project = xmlFile.getProject();
    HighlightDisplayKey key = HighlightDisplayKey.find(myInspection.getShortName());
    Map<XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix, ProblemDescriptor> fixes = new LinkedHashMap<>();
    if (InspectionProjectProfileManager.getInstance(project).getCurrentProfile().isToolEnabled(key, xmlFile)) {
      ProblemsHolder holder = new ProblemsHolder(InspectionManager.getInstance(project), xmlFile, false);
      final XmlElementVisitor visitor = (XmlElementVisitor)myInspection.buildVisitor(holder, false);
      new PsiRecursiveElementVisitor() {
        @Override
        public void visitElement(@NotNull PsiElement element) {
          if (element instanceof XmlAttribute) {
            visitor.visitXmlAttribute((XmlAttribute)element);
          }
          else {
            super.visitElement(element);
          }
        }
      }.visitFile(xmlFile);
      ProblemDescriptor[] results = holder.getResultsArray();
      List<ProblemDescriptor> list = ContainerUtil.filter(results, myCondition);

      for (ProblemDescriptor result : list) {
        for (QuickFix fix : result.getFixes()) {
          if (fix instanceof XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix) {
            fixes.put((XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix)fix, result);
          }
        }
      }
    }
    return new CollectingInfoRunnable() {
      int myRemovedNameSpaces = 0;

      @Override
      public void run() {
        SmartPsiElementPointer<XmlTag> pointer = null;
        for (Map.Entry<XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix, ProblemDescriptor> fix : fixes.entrySet()) {
          pointer = fix.getKey().doFix(project, fix.getValue(), false);
          myRemovedNameSpaces++;
        }
        if (pointer != null) {
          XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.reformatStartTag(project, pointer);
        }
      }

      @Override
      public @Nullable String getUserNotificationInfo() {
        return myRemovedNameSpaces > 0
               ? XmlBundle.message("hint.text.removed.namespace", myRemovedNameSpaces, myRemovedNameSpaces > 1 ? 0 : 1)
               : null;
      }
    };
  }
@Override
  public @NotNull CollectingInfoRunnable processFile(final @NotNull PsiFile file)