Inspectopedia 2024.3 Help

Java 8

'Collections.sort()' can be replaced with 'List.sort()'   New in this release

Reports calls of Collections.sort(list, comparator) which can be replaced with list.sort(comparator).

'Comparator' combinator can be used   New in this release

Reports Comparator instances defined as lambda expressions that could be expressed using Comparator.comparing() calls.

Anonymous type can be replaced with lambda   New in this release

Reports anonymous classes which can be replaced with lambda expressions.

Anonymous type can be replaced with method reference   New in this release

Reports anonymous classes which can be replaced with method references.

Anonymous type has shorter lambda alternative   New in this release

Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument.

Expression can be folded into Stream chain   New in this release

Reports expressions with a repeating pattern that could be replaced with Stream API or a String.join() call.

Guava pseudo-functional call can be converted to Stream API call   New in this release

Reports usages of Guava pseudo-functional code when Java Stream API is available.

Guava's functional primitives can be replaced with Java   New in this release

Reports usages of Guava's functional primitives that can be migrated to standard Java API calls.

Lambda can be replaced with method call   New in this release

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

Lambda can be replaced with method reference   New in this release

Reports lambdas that can be replaced with method references.

Loop can be collapsed with Stream API   New in this release

Reports loops which can be replaced with stream API calls using lambda expressions.

Loop can be replaced with 'Collection.removeIf()'   New in this release

Reports loops which can be collapsed into a single Collection.removeIf() call.

Loop can be replaced with 'List.replaceAll()'   New in this release

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

Map.forEach() can be used   New in this release

Suggests replacing for(Entry<?,?> entry : map.entrySet()) {...} or map.entrySet().forEach(entry -> ...) with map.forEach((key, value) -> ...).

Simplifiable 'Map' operations   New in this release

Reports common usage patterns of java.util.Map and suggests replacing them with: getOrDefault(), computeIfAbsent(), putIfAbsent(), merge(), or replaceAll().

Simplifiable forEach() call   New in this release

Reports forEach() calls that can be replaced with a more concise method or from which intermediate steps can be extracted.

Standard 'hashCode()' method can be used   New in this release

Reports bitwise operations that can be replaced with a call to the Long.hashCode() or Double.hashCode() methods.

Statement lambda can be replaced with expression lambda   New in this release

Reports lambda expressions with code block bodies when expression-style bodies can be used instead.

Last modified: 11 September 2024