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

31 lines
737 B
HTML

<html>
<body>
Reports <code>if</code> statements in which common parts can be extracted from the branches.
<p>These common parts are independent from the condition and make <code>if</code> statements harder to understand.</p>
<p>Example:</p>
<pre><code>
if (x &gt; 12) {
doSomethingBefore();
doSomethingDifferent1();
doSomethingAfter();
} else {
doSomethingBefore();
doSomethingDifferent2();
doSomethingAfter();
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
doSomethingBefore();
if (x &gt; 12) {
doSomethingDifferent1();
} else {
doSomethingDifferent2();
}
doSomethingAfter();
</code></pre>
<!-- tooltip end -->
<p><small>Updated in 2018.1</small></p>
</body>
</html>