PsiElementVisitor (final @NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) { if (!JavaFxFileTypeFactory.isFxml(session.getFile())) return PsiElementVisitor.EMPTY_VISITOR; return new XmlElementVisitor() { @Override public void visitXmlTag(@NotNull XmlTag tag) { super.visitXmlTag(tag); final XmlElementDescriptor descriptor = tag.getDescriptor(); if (descriptor instanceof JavaFxPropertyTagDescriptor) { final PsiClass parentTagClass = JavaFxPsiUtil.getTagClass(tag.getParentTag()); if (parentTagClass != null) { final String propertyName = JavaFxPsiUtil.getDefaultPropertyName(parentTagClass); final String tagName = tag.getName(); if (Comparing.strEqual(tagName, propertyName) && !isCollectionAssignment(parentTagClass, propertyName, tag)) { final TextRange startTagRange = XmlTagUtil.getStartTagRange(tag); final TextRange rangeInElement = startTagRange != null ? startTagRange.shiftRight(-tag.getTextOffset()) : null; holder.registerProblem(tag, rangeInElement, JavaFXBundle.message("inspection.javafx.default.tag.could.be.removed"), new UnwrapTagFix(tagName)); } } } } }; }