Java 8
- 'Collections.sort()' can be replaced with 'List.sort()'
Reports calls of Collections.sort(list, comparator) which can be replaced with list.sort(comparator).
- 'Comparator' combinator can be used
Reports Comparator instances defined as lambda expressions that could be expressed using Comparator.comparing() calls.
- Anonymous type can be replaced with lambda
Reports anonymous classes which can be replaced with lambda expressions.
- Anonymous type can be replaced with method reference
Reports anonymous classes which can be replaced with method references.
- Anonymous type has shorter lambda alternative
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
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
Reports usages of Guava pseudo-functional code when Java Stream API is available.
- Guava's functional primitives can be replaced with Java
Reports usages of Guava's functional primitives that can be migrated to standard Java API calls.
- Lambda can be replaced with method call
Reports lambda expressions which can be replaced with a call to a JDK method.
- Lambda can be replaced with method reference
Reports lambdas that can be replaced with method references.
- Loop can be collapsed with Stream API
Reports loops which can be replaced with stream API calls using lambda expressions.
- Loop can be replaced with 'Collection.removeIf()'
Reports loops which can be collapsed into a single Collection.removeIf() call.
- Loop can be replaced with 'List.replaceAll()'
Reports loops which can be collapsed into a single List.replaceAll() call.
- Map.forEach() can be used
Suggests replacing for(Entry<?,?> entry : map.entrySet()) {...} or map.entrySet().forEach(entry -> ...) with map.forEach((key, value) -> ...).
- Simplifiable 'Map' operations
Reports common usage patterns of java.util.Map and suggests replacing them with: getOrDefault(), computeIfAbsent(), putIfAbsent(), merge(), or replaceAll().
- Simplifiable forEach() call
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
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
Reports lambda expressions with code block bodies when expression-style bodies can be used instead.