Inspectopedia
 
2024.3

Guava's functional primitives can be replaced with Java

Warning
New
Last modified: 03 December 2024

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

For example, the inspection reports usages of classes and interfaces like FluentIterable, Optional, Function, Predicate, or Supplier.

Example:

After the quick-fix is applied:

The quick-fix may change the semantics. Some lazily evaluated Guava iterables can be transformed to eagerly evaluated.

This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.