Delegate to Objects.hashCode().
This commit is contained in:
parent
d05073e66d
commit
dcc6568100
|
@ -760,8 +760,8 @@ public class ObjectUtils {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static int hashCode(final Object obj) {
|
public static int hashCode(final Object obj) {
|
||||||
// hashCode(Object) retained for performance, as hash code is often critical
|
// hashCode(Object) for performance vs. hashCodeMulti(Object[]), as hash code is often critical
|
||||||
return obj == null ? 0 : obj.hashCode();
|
return Objects.hashCode(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -791,7 +791,7 @@ public class ObjectUtils {
|
||||||
int hash = 1;
|
int hash = 1;
|
||||||
if (objects != null) {
|
if (objects != null) {
|
||||||
for (final Object object : objects) {
|
for (final Object object : objects) {
|
||||||
final int tmpHash = hashCode(object);
|
final int tmpHash = Objects.hashCode(object);
|
||||||
hash = hash * 31 + tmpHash;
|
hash = hash * 31 + tmpHash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue