diff --git a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java index 4691a0a33ca9..d4692d5acc87 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java @@ -107,7 +107,7 @@ public abstract class DomElementsInspection extends XmlSup } /** - * Not intended to be overriden or called by implementors. + * Not intended to be overridden or called by implementors. * Override {@link #checkFileElement(com.intellij.util.xml.DomFileElement, DomElementAnnotationHolder)} (which is preferred) or * {@link #checkDomElement(com.intellij.util.xml.DomElement, DomElementAnnotationHolder, DomHighlightingHelper)} instead. */ @@ -117,6 +117,7 @@ public abstract class DomElementsInspection extends XmlSup for (Class domClass: myDomClasses) { final DomFileElement fileElement = DomManager.getDomManager(file.getProject()).getFileElement((XmlFile)file, domClass); if (fileElement != null) { + //noinspection unchecked return checkDomFile((DomFileElement)fileElement, manager, isOnTheFly); } } @@ -134,15 +135,17 @@ public abstract class DomElementsInspection extends XmlSup } /** - * not intended to be overriden or called by implementors + * not intended to be overridden or called by implementors */ @Nullable protected ProblemDescriptor[] checkDomFile(@NotNull final DomFileElement domFileElement, @NotNull final InspectionManager manager, - final boolean isOnTheFly) { + @SuppressWarnings("UnusedParameters") final boolean isOnTheFly) { final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(manager.getProject()); final List list = annotationsManager.checkFileElement(domFileElement, this); + if (list.isEmpty()) return ProblemDescriptor.EMPTY_ARRAY; + List problems = ContainerUtil.concat(list, new Function>() { public Collection fun(final DomElementProblemDescriptor s) {