diff --git a/core/src/main/java/org/apache/gravitino/credential/CatalogCredentialContext.java b/core/src/main/java/org/apache/gravitino/credential/CatalogCredentialContext.java index 6ac0c498c02..2a7955d08ad 100644 --- a/core/src/main/java/org/apache/gravitino/credential/CatalogCredentialContext.java +++ b/core/src/main/java/org/apache/gravitino/credential/CatalogCredentialContext.java @@ -47,7 +47,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || !(o instanceof CatalogCredentialContext)) { + if (!(o instanceof CatalogCredentialContext)) { return false; } return Objects.equal(userName, ((CatalogCredentialContext) o).userName); diff --git a/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java b/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java index 1d0d8f7b3b6..635f530b073 100644 --- a/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java +++ b/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java @@ -43,7 +43,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || !(o instanceof CredentialCacheKey)) { + if (!(o instanceof CredentialCacheKey)) { return false; } CredentialCacheKey that = (CredentialCacheKey) o; diff --git a/core/src/main/java/org/apache/gravitino/credential/PathBasedCredentialContext.java b/core/src/main/java/org/apache/gravitino/credential/PathBasedCredentialContext.java index 06d17b134ba..2c015b0c569 100644 --- a/core/src/main/java/org/apache/gravitino/credential/PathBasedCredentialContext.java +++ b/core/src/main/java/org/apache/gravitino/credential/PathBasedCredentialContext.java @@ -67,7 +67,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || !(o instanceof PathBasedCredentialContext)) { + if (!(o instanceof PathBasedCredentialContext)) { return false; } PathBasedCredentialContext that = (PathBasedCredentialContext) o; diff --git a/iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/utils/IcebergHiveCachedClientPool.java b/iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/utils/IcebergHiveCachedClientPool.java index 1d4d6f0e6fd..06a8c32aab3 100644 --- a/iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/utils/IcebergHiveCachedClientPool.java +++ b/iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/utils/IcebergHiveCachedClientPool.java @@ -238,7 +238,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || !(o instanceof Key)) { + if (!(o instanceof Key)) { return false; } Key key = (Key) o;