mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 10:14:57 +07:00
24 lines
715 B
HTML
24 lines
715 B
HTML
<html>
|
|
<body>
|
|
Reports comparison operations where the constant value is on the wrong side.
|
|
<p>Some coding conventions specify that constants should be on a specific side of a comparison, either left or right.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
boolean compare(int x) {
|
|
return 1 > x; // Constant '1' on the left side of the comparison
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
boolean compare(int x) {
|
|
return x < 1;
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
Use the inspection settings to choose the side of constants in comparisons
|
|
and whether to warn if <code>null</code> literals are on the wrong side.
|
|
</p>
|
|
<p><small>New in 2019.2</small></p>
|
|
</body>
|
|
</html> |