mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 06:39:38 +07:00
[java-inspections] UseHashCodeMethodInspection: support double type
Also: fix comment processing Improvement of IDEA-338114 GitOrigin-RevId: 87d057ccbea4262c40e2717c2ea3c004ac9865b0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e356e99136
commit
6e1d684df0
@@ -3,6 +3,7 @@ public class Test {
|
||||
Long var = 1234567890123456789L;
|
||||
|
||||
public void testMethod() {
|
||||
int result = var.hashCode();
|
||||
/*shift amount*/
|
||||
int result = var.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ public class Test {
|
||||
Long var1 = 1234567890123456784L;
|
||||
|
||||
public void testMethod(boolean f) {
|
||||
int result = (f ? var : var1).hashCode();
|
||||
/*shift amount*/
|
||||
int result = (f ? var : var1).hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with 'Double.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(double d) {
|
||||
System.out.println(Double.hashCode(d));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Replace with 'Double.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(Double d) {
|
||||
/*comment*/
|
||||
System.out.println(d.hashCode());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace with 'Long.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(double d) {
|
||||
long l = Double.doubleToLongBits(d);
|
||||
System.out.println(Long.hashCode(l));
|
||||
System.out.println(l);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace with 'Long.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(double d) {
|
||||
long l = Double.doubleToLongBits(d);
|
||||
d++;
|
||||
System.out.println(Long.hashCode(l));
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ public class Test {
|
||||
long var = 1234567890123456789L;
|
||||
|
||||
public void testMethod() {
|
||||
int result = Long.hashCode(var);
|
||||
/*shift amount*/
|
||||
int result = Long.hashCode(var);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Replace with 'Double.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(double d) {
|
||||
long l = Double.doubleToLongBits(d);
|
||||
System.out.println((int) (l<caret> ^ (l >>> 32)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Replace with 'Double.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(Double d) {
|
||||
long l = Double.doubleToLongBits(/*comment*/d);
|
||||
System.out.println((int) (l ^ <caret>(l >>> 32)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace with 'Long.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(double d) {
|
||||
long l = Double.doubleToLongBits(d);
|
||||
System.out.println((int) (l ^ (l<caret> >>> 32)));
|
||||
System.out.println(l);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace with 'Long.hashCode()'" "true-preview"
|
||||
public class Test {
|
||||
void test(double d) {
|
||||
long l = Double.doubleToLongBits(d);
|
||||
d++;
|
||||
System.out.println((int) (l<caret> ^ (l >>> 32)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user