diff --git a/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java index ca7b1c06c..07d9190e8 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java @@ -87,7 +87,7 @@ public class ConstantInitializer implements ConcurrentInitializer { */ @Override public int hashCode() { - return getObject() != null ? getObject().hashCode() : 0; + return Objects.hashCode(object); } /**