mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
自己实现的hashCode替换为标准hashCode
This commit is contained in:
parent
1af2366c2e
commit
669a7a0b96
@ -179,8 +179,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final long bits = Double.doubleToLongBits(value);
|
return Double.hashCode(value);
|
||||||
return (int) (bits ^ bits >>> 32);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
@ -192,7 +192,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return (int) (value ^ (value >>> 32));
|
return Long.hashCode(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
@ -380,7 +380,7 @@ public class Money implements Serializable, Comparable<Money> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return (int) (cent ^ (cent >>> 32));
|
return Long.hashCode(cent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,7 +74,7 @@ public class SingletonTest {
|
|||||||
@Disabled
|
@Disabled
|
||||||
void issue3435Test() {
|
void issue3435Test() {
|
||||||
final String key = "123";
|
final String key = "123";
|
||||||
final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
|
final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
|
||||||
for (int i = 0; i < 100; i++) {
|
for (int i = 0; i < 100; i++) {
|
||||||
threadPoolExecutor.execute(() -> {
|
threadPoolExecutor.execute(() -> {
|
||||||
Singleton.get(key, () -> {
|
Singleton.get(key, () -> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user