mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-30 08:41:59 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
19 lines
549 B
HTML
19 lines
549 B
HTML
<html>
|
|
<body>
|
|
Reports <code>java.util.Optional</code> or <code>com.google.common.base.Optional</code> types with an array or collection type parameter.
|
|
<p>In such cases, it is more clear to just use an empty array or collection to indicate the absence of result.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
Optional<List<Integer>> foo() {
|
|
return Optional.empty();
|
|
}
|
|
</code></pre>
|
|
<p>This code could look like:</p>
|
|
<pre><code>
|
|
List<Integer> foo() {
|
|
return List.of();
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |