This is an automated email from the ASF dual-hosted git repository.
yufei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 68508817 Enable errorprone PatternMatchingInstanceof (#393)
68508817 is described below
commit 685088179a1cece0d792a0861cdae61333282fc0
Author: Yuya Ebihara <[email protected]>
AuthorDate: Wed Oct 23 01:48:08 2024 +0900
Enable errorprone PatternMatchingInstanceof (#393)
---
build-logic/src/main/kotlin/polaris-java.gradle.kts | 1 +
.../service/catalog/PolarisPassthroughResolutionView.java | 12 ++++--------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/build-logic/src/main/kotlin/polaris-java.gradle.kts
b/build-logic/src/main/kotlin/polaris-java.gradle.kts
index 7c5aebac..c8ef9bbe 100644
--- a/build-logic/src/main/kotlin/polaris-java.gradle.kts
+++ b/build-logic/src/main/kotlin/polaris-java.gradle.kts
@@ -44,6 +44,7 @@ tasks.withType(JavaCompile::class.java).configureEach {
"MissingOverride",
"ModifiedButNotUsed",
"OrphanedFormatString",
+ "PatternMatchingInstanceof",
"StringCaseLocaleUsage",
)
}
diff --git
a/polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisPassthroughResolutionView.java
b/polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisPassthroughResolutionView.java
index 761d82cb..313e0265 100644
---
a/polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisPassthroughResolutionView.java
+++
b/polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisPassthroughResolutionView.java
@@ -69,8 +69,7 @@ public class PolarisPassthroughResolutionView implements
PolarisResolutionManife
PolarisResolutionManifest manifest =
entityManager.prepareResolutionManifest(callContext,
authenticatedPrincipal, catalogName);
- if (key instanceof Namespace) {
- Namespace namespace = (Namespace) key;
+ if (key instanceof Namespace namespace) {
manifest.addPath(
new ResolverPath(Arrays.asList(namespace.levels()),
PolarisEntityType.NAMESPACE),
namespace);
@@ -88,8 +87,7 @@ public class PolarisPassthroughResolutionView implements
PolarisResolutionManife
PolarisResolutionManifest manifest =
entityManager.prepareResolutionManifest(callContext,
authenticatedPrincipal, catalogName);
- if (key instanceof TableIdentifier) {
- TableIdentifier identifier = (TableIdentifier) key;
+ if (key instanceof TableIdentifier identifier) {
manifest.addPath(
new ResolverPath(
PolarisCatalogHelpers.tableIdentifierToList(identifier),
@@ -110,8 +108,7 @@ public class PolarisPassthroughResolutionView implements
PolarisResolutionManife
PolarisResolutionManifest manifest =
entityManager.prepareResolutionManifest(callContext,
authenticatedPrincipal, catalogName);
- if (key instanceof Namespace) {
- Namespace namespace = (Namespace) key;
+ if (key instanceof Namespace namespace) {
manifest.addPassthroughPath(
new ResolverPath(Arrays.asList(namespace.levels()),
PolarisEntityType.NAMESPACE),
namespace);
@@ -129,8 +126,7 @@ public class PolarisPassthroughResolutionView implements
PolarisResolutionManife
PolarisResolutionManifest manifest =
entityManager.prepareResolutionManifest(callContext,
authenticatedPrincipal, catalogName);
- if (key instanceof TableIdentifier) {
- TableIdentifier identifier = (TableIdentifier) key;
+ if (key instanceof TableIdentifier identifier) {
manifest.addPassthroughPath(
new ResolverPath(
PolarisCatalogHelpers.tableIdentifierToList(identifier),