map(x -> x)
or filter(x -> true)
,
useless sorted
or distinct
.
Note that a mapping operation in code like streamOfIntegers.map(Integer::valueOf)
works as requireNonNull
check:
if stream contains a null
, it will throw NullPointerException
, thus it's not absolutely useless. Uncheck the
"Report useless boxing in Stream.map" checkbox if you don't want such cases to be reported.
This inspection is available since Java 8 only.
New in 2017.1