Inspectopedia
 
2024.3

Lambda can be replaced with method call

Info
New
Last modified: 03 December 2024

Reports lambda expressions which can be replaced with a call to a JDK method.

For example, an expression x -> x of type Function<T, T> can be replaced with a Function.identity() call.

This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.

New in 2017.1