Files
openide/java/java-impl/resources/inspectionDescriptions/StaticPseudoFunctionalStyleMethod.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

19 lines
981 B
HTML

<html>
<body>
Reports usages of Guava pseudo-functional code when <code>Java Stream API</code> is available.
<p>Though <code>Guava Iterable API</code> provides functionality similar to <code>Java Streams API</code>, it's slightly different and
may miss some features.
Especially, primitive-specialized stream variants like <code>IntStream</code> are more performant than generic variants.</p>
<p><b>Example:</b></p>
<pre><code>
List&lt;String&gt; transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>List&lt;String&gt; transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());</code></pre>
<p>
<b>Note:</b> Code semantics can be changed; for example, Guava's <code>Iterable.transform</code> produces a lazy-evaluated iterable,
but the replacement is eager-evaluated.
</p>
<!-- tooltip end -->
</body>
</html>