diff --git a/src/main/java/org/opensearch/security/user/User.java b/src/main/java/org/opensearch/security/user/User.java index 12d916354d..6abba3d734 100644 --- a/src/main/java/org/opensearch/security/user/User.java +++ b/src/main/java/org/opensearch/security/user/User.java @@ -229,7 +229,7 @@ public final boolean equals(final Object obj) { if (obj == null) { return false; } - if (!(User.class.isAssignableFrom(getClass()) && User.class.isAssignableFrom(obj.getClass()))) { + if (!(obj instanceof User)) { return false; } final User other = (User) obj;