mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
26 lines
734 B
HTML
26 lines
734 B
HTML
<html>
|
|
<body>
|
|
Reports suspicious indentation of statements after a control statement without braces.
|
|
<p>
|
|
Such indentation can make it look like the statement is inside the control statement,
|
|
when in fact it will be executed unconditionally after the control statement.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class Bar {
|
|
void foo(int i) {
|
|
if (i == 0)
|
|
System.out.println("foo");
|
|
System.out.println("bar"); // warning
|
|
if (i == 1);
|
|
System.out.println("great"); // warning
|
|
if (i == 42)
|
|
System.out.println("answer");
|
|
System.out.println("question"); // warning
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
|
|
</body>
|
|
</html> |