This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new dcc6568 Delegate to Objects.hashCode().
dcc6568 is described below
commit dcc6568100b3f631b017f55db57684f5037c80e6
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Aug 24 11:54:20 2021 -0400
Delegate to Objects.hashCode().
---
src/main/java/org/apache/commons/lang3/ObjectUtils.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java
b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
index 51d3428..c9da955 100644
--- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
@@ -760,8 +760,8 @@ public class ObjectUtils {
*/
@Deprecated
public static int hashCode(final Object obj) {
- // hashCode(Object) retained for performance, as hash code is often
critical
- return obj == null ? 0 : obj.hashCode();
+ // hashCode(Object) for performance vs. hashCodeMulti(Object[]), as
hash code is often critical
+ return Objects.hashCode(obj);
}
/**
@@ -791,7 +791,7 @@ public class ObjectUtils {
int hash = 1;
if (objects != null) {
for (final Object object : objects) {
- final int tmpHash = hashCode(object);
+ final int tmpHash = Objects.hashCode(object);
hash = hash * 31 + tmpHash;
}
}