Inspectopedia
 
2024.3

Loop can be replaced with 'List.replaceAll()'

Warning
New
Last modified: 03 December 2024

Reports loops which can be collapsed into a single List.replaceAll() call.

Example:

After the quick-fix is applied:

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

New in 2022.1