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

35 lines
849 B
HTML

<html>
<body>
Reports any <code>assert</code> calls that can be replaced with simpler and equivalent calls.
<table>
<tr><th>Example</th><th>&rarr;</th><th>Replacement</th></tr>
<tr>
<td><code>assertEquals(<b>true</b>, x());</code></td>
<td></td>
<td><code>assertTrue(x());</code></td>
</tr>
<tr>
<td><code>assertTrue(y() != null);</code></td>
<td></td>
<td><code>assertNotNull(y());</code></td>
</tr>
<tr>
<td><code>assertTrue(z == z());</code></td>
<td></td>
<td><code>assertSame(z, z());</code></td>
</tr>
<tr>
<td><code>assertTrue(a.equals(a()));</code></td>
<td></td>
<td><code>assertEquals(a, a());</code></td>
</tr>
<tr>
<td><code>assertTrue(<b>false</b>);</code></td>
<td></td>
<td><code>fail();</code></td>
</tr>
</table>
<!-- tooltip end -->
</body>
</html>