From f521fc113baf410f0ed054844e83fe1d9d3a5c08 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Tue, 9 Jan 2024 17:44:28 +0100 Subject: [PATCH] Java: fix description grammer and clean up GitOrigin-RevId: 97d7233b483154c0698a3eb2d694cbb023173443 --- .../UseHashCodeMethodInspection.html | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/java/java-impl/src/inspectionDescriptions/UseHashCodeMethodInspection.html b/java/java-impl/src/inspectionDescriptions/UseHashCodeMethodInspection.html index 830d942e8df1..6fdb78d4f284 100644 --- a/java/java-impl/src/inspectionDescriptions/UseHashCodeMethodInspection.html +++ b/java/java-impl/src/inspectionDescriptions/UseHashCodeMethodInspection.html @@ -1,19 +1,15 @@ -

-Informs you when bitwise operations can be replaced with the Long.hashCode() or Double.hashCode() method. - It detects instances of the pattern (int)(x ^ (x >>> 32)) where x is a variable of type long or - the result of the previous Double.doubleToLongBits() call. This replacement shortens the code improves its readability. -

-

- Example: -

+Reports bitwise operations that can be replaced with a call to the Long.hashCode() or Double.hashCode() methods. +It detects the construct (int)(x ^ (x >>> 32)) where x is a variable of type long or +the result of a previous Double.doubleToLongBits() call. The replacement shortens the code, improving its readability. +

Example:


-int result = (int)(var ^ (var >>> 32));
+  int result = (int)(var ^ (var >>> 32));
 
-After applying the quick-fix: +

After applying the quick-fix:


-int result = Long.hashCode(var);
+  int result = Long.hashCode(var);
 

This inspection only reports if the language level of the project or module is 8 or higher.