diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/EqualsUtil.java b/smack-core/src/main/java/org/jivesoftware/smack/util/EqualsUtil.java index 9d786cc8f..8110358a7 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/EqualsUtil.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/EqualsUtil.java @@ -1,6 +1,6 @@ /** * - * Copyright 2019 Florian Schmaus. + * Copyright 2019-2020 Florian Schmaus. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,12 @@ public final class EqualsUtil { return false; } + int thisHashCode = thisObject.hashCode(); + int otherHashCode = other.hashCode(); + if (thisHashCode != otherHashCode) { + return false; + } + EqualsUtil.Builder equalsBuilder = new EqualsUtil.Builder(); equalsComperator.compare(equalsBuilder, thisObjectClass.cast(other));