Inspectopedia
 
2024.3

Non-short-circuit operation consumes infinite stream

Warning
New
Last modified: 03 December 2024

Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception.

Example:

This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.