Object allocation in loop
Reports object or array allocations inside loops. While not necessarily a problem, an object allocation inside a loop is a great place to look for memory leaks and performance issues.
The inspection reports the following constructs:
Explicit allocations via
Methods known to return new object
Instance-bound method references
Lambdas that capture variables or
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3