Community
Participate
Working Groups
Some Visitors like that in "MarkerManager.visitorFindMaxSeverity" could stop early if some condition apply (in that case max Severity reached). But the IElementContentVisitor does not allow an early stop. It only allows to stop that further "*children* should be visited". Siblings (and there descendends!) are still executed leading to unnecessary work. Would be good to add a new API or extend ElementTreeIterator like java.nio.file.FileVisitor which does allow to stop at various situations. Also it would look nicer in stacktraces if it's not recursive but iterative like in java.nio.file.Files.walkFileTree(). ... and then use it for findMaxProblemSeverity!
Haven't checked code yet, but widely used pattern would be to throw OperationCancelledException from visitor and catch in the iterator.