Files
openide/java/java-impl/resources/inspectionDescriptions/ThrowableSupplierOnlyThrowException.html
2025-02-05 04:43:28 +00:00

17 lines
452 B
HTML

<html>
<body>
Reports <code>Supplier</code> lambdas in <code>Optional.orElseThrow()</code> calls that throw an exception, instead of returning it.
<p><b>Example:</b></p>
<pre><code>
optional.orElseThrow(() -> {
throw new RuntimeException();
});
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
optional.orElseThrow(() -> new RuntimeException());
</code></pre>
<!-- tooltip end -->
<p><small>New in 2023.1</small></p>
</body>
</html>