mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
30 lines
1.4 KiB
HTML
30 lines
1.4 KiB
HTML
<html>
|
|
<body>
|
|
Reports method calls whose result is ignored.
|
|
<p>For many methods, ignoring the result is perfectly
|
|
legitimate, but for some it is almost certainly an error. Examples of methods where ignoring
|
|
the result is likely an error include <code>java.io.inputStream.read()</code>,
|
|
which returns the number of bytes actually read, and any method on
|
|
<code>java.lang.String</code> or <code>java.math.BigInteger</code>. These methods do not produce side-effects and thus pointless
|
|
if their result is ignored.
|
|
</p>
|
|
<p>The calls to the following methods are inspected:</p>
|
|
<ul>
|
|
<li>Simple getters (which do nothing except return a field)</li>
|
|
<li>Methods specified in the settings of this inspection</li>
|
|
<li>Methods annotated with <code>org.jetbrains.annotations.Contract(pure=true)</code></li>
|
|
<li>Methods annotated with .*.<code>CheckReturnValue</code></li>
|
|
<li>Methods in a class or package annotated with <code>javax.annotation.CheckReturnValue</code></li>
|
|
<li>Optionally, all non-library methods</li>
|
|
</ul>
|
|
<p>Calls to methods annotated with Error Prone's or AssertJ's <code>@CanIgnoreReturnValue</code> annotation are not reported.
|
|
|
|
<!-- tooltip end -->
|
|
<p>
|
|
Use the inspection settings to specify the classes to check.
|
|
Methods are matched by name or name pattern using Java regular expression syntax.
|
|
For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.
|
|
<p>
|
|
|
|
</body>
|
|
</html> |