This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 39e8a09d0b [#6272] fix: Remove the unnecessary null checks (#6282)
39e8a09d0b is described below
commit 39e8a09d0b8dfbfa551e6bfc58ec56549f41717d
Author: SEO G S <[email protected]>
AuthorDate: Thu Jan 16 17:43:01 2025 +0900
[#6272] fix: Remove the unnecessary null checks (#6282)
**What changes were proposed in this pull request?**
Remove the unnecessary null checks.
**Why are the changes needed?**
[#6272] Unnecessary because instanceof returns null
**Does this PR introduce _any_ user-facing change?**
N/A
**How was this patch tested?**
N/A
---
.../java/org/apache/gravitino/credential/CatalogCredentialContext.java | 2 +-
.../main/java/org/apache/gravitino/credential/CredentialCacheKey.java | 2 +-
.../org/apache/gravitino/credential/PathBasedCredentialContext.java | 2 +-
.../gravitino/iceberg/common/utils/IcebergHiveCachedClientPool.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
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 6ac0c498c0..2a7955d08a 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 class CatalogCredentialContext implements
CredentialContext {
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 1d0d8f7b3b..635f530b07 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 class CredentialCacheKey {
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 06d17b134b..2c015b0c56 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 class PathBasedCredentialContext implements
CredentialContext {
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 1d4d6f0e6f..06a8c32aab 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 class IcebergHiveCachedClientPool
if (this == o) {
return true;
}
- if (o == null || !(o instanceof Key)) {
+ if (!(o instanceof Key)) {
return false;
}
Key key = (Key) o;