Inspectopedia 2025.2 Help

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.

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

Example:

ImmutableList<String> results = FluentIterable.from(List.of(1, 2, 3)).transform(Object::toString).toList();

After the quick-fix is applied:

List<String> results = List.of(1, 2, 3).stream().map(Object::toString).collect(Collectors.toList());

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

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

Guava
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Java | Java language level migration aids | Java 8

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

Inspection options

Here you can find the description of settings available for the Guava's functional primitives can be replaced with Java inspection, and the reference of their default values.

Report variables

Default value:

Selected
Report method chains

Default value:

Selected
Report return types

Default value:

Selected
Erase @javax.annotations.Nullable from converted functions

Default value:

Selected

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection Guava

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.2, Qodana for JVM 2025.2,

Last modified: 18 September 2025