wording, example added

This commit is contained in:
Alexey Kudravtsev
2016-08-10 18:32:19 +03:00
parent d84c213408
commit eb018359e6
@@ -1,7 +1,17 @@
<html>
<body>
This inspection reports <b>==</b> and <b>!=</b> equality operators that compare two objects.
<p>The quick fix offers to replace the equality operators with calls of the <b>.equals()</b> method
or with the safe <b>.equals()</b> method construct.
For example:<br> <code><b>if</b> (object1 == object2) {}</code>
<p>Quick fix replaces '==' with <b>.equals()</b>:
<p><code>object1.equals(object2);</code>
<p>or with safe <b>.equals()</b>:
<ul>
<li>
<code>java.util.Objects.equals(object1, object2)</code><br> (under Java7+) or
</li>
<li>
<code>object1 == null ? object2 == null : object1.equals(object1)</code><br> (under old JDKs)
</li>
</ul>
</body>
</html>