Files
openide/java/java-impl/resources/inspectionDescriptions/UseHashCodeMethodInspection.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

18 lines
765 B
HTML

<html>
<body>
Reports bitwise operations that can be replaced with a call to the <code>Long.hashCode()</code> or <code>Double.hashCode()</code> methods.
It detects the construct <code>(int)(x ^ (x >>> 32))</code> where <code>x</code> is a variable of type <code>long</code> or
the result of a previous <code>Double.doubleToLongBits()</code> call. The replacement shortens the code, improving its readability.
<p><b>Example:</b></p>
<pre><code>
int result = (int)(var ^ (var >>> 32));
</code></pre>
<p>After applying the quick-fix:</p>
<pre><code>
int result = Long.hashCode(var);
</code></pre>
<!-- tooltip end -->
<p>This inspection only reports if the language level of the project or module is 8 or higher.
<p><small>New in 2024.1</small></p>
</body>
</html>