- Sonar Gradle plugin 3.1.1
- Analysis runs on JDK 14
attachmentPoints.stream() .filter(point -> satisfiesCosntraint(point)) .findAny() .orElseThrow(() -> new CantileverRuleViolationException("None of the attachment points satisfy the constraint"));
orElseThrow statement is reported as a violation:
When the call to a function doesn’t have any side effects, what is the point of making the call if the results are ignored?
However, in this case, there is a side effect - an exception is thrown.