mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
17 lines
664 B
HTML
17 lines
664 B
HTML
<html>
|
|
<body>
|
|
Reports collectors that can be simplified.
|
|
<p>In particular, some cascaded <code>groupingBy()</code> collectors can be expressed by using a
|
|
simpler <code>toMap()</code> collector, which is also likely to be more performant.</p>
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p><small>New in 2017.1</small></p>
|
|
</body>
|
|
</html> |