use of org.sonar.plugins.web.node.TagNode in project sonar-web by SonarSource.
the class UnclosedTagCheck method endElement.
@Override
public void endElement(TagNode element) {
if (!ignoreTag(element) && !nodes.isEmpty()) {
TagNode previousNode = nodes.remove(0);
if (!previousNode.getNodeName().equals(element.getNodeName())) {
createViolation(previousNode.getStartLinePosition(), "The tag \"" + previousNode.getNodeName() + "\" has no corresponding closing tag.");
List<TagNode> rollup = new ArrayList<>();
for (TagNode node : nodes) {
rollup.add(node);
if (node.getNodeName().equals(element.getNodeName())) {
nodes.removeAll(rollup);
break;
}
}
}
}
}
Aggregations