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 only reports if the project or module is configured to use a language level of 8 or higher.
New in 2017.1