mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
18 lines
765 B
HTML
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> |