You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2026/07/27 09:20:05 UTC

(iceberg) branch main updated: BigQuery: Use pattern-matching instanceof (#17380)

This is an automated email from the ASF dual-hosted git repository.

nastra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 78789f32c2 BigQuery: Use pattern-matching instanceof (#17380)
78789f32c2 is described below

commit 78789f32c2418ed83de7f294bc9331aacf7a8331
Author: Uros Bojanic <22...@users.noreply.github.com>
AuthorDate: Mon Jul 27 11:19:56 2026 +0200

    BigQuery: Use pattern-matching instanceof (#17380)
---
 .../apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java b/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java
index beee736289..0e09226284 100644
--- a/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java
+++ b/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java
@@ -92,8 +92,8 @@ public final class BigQueryMetastoreClientImpl implements BigQueryMetastoreClien
 
         @Override
         public RetryResult beforeEval(Exception exception) {
-          if (exception instanceof BaseServiceException) {
-            boolean retriable = ((BaseServiceException) exception).isRetryable();
+          if (exception instanceof BaseServiceException serviceException) {
+            boolean retriable = serviceException.isRetryable();
             return retriable
                 ? ExceptionHandler.Interceptor.RetryResult.RETRY
                 : ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION;
@@ -672,8 +672,8 @@ public final class BigQueryMetastoreClientImpl implements BigQueryMetastoreClien
       BigQueryRetryHelper.BigQueryRetryHelperException retryException) {
     Throwable cause = retryException.getCause();
     String message = retryException.getMessage();
-    if (cause instanceof RuntimeException) {
-      throw (RuntimeException) cause;
+    if (cause instanceof RuntimeException runtimeException) {
+      throw runtimeException;
     } else {
       throw new RuntimeException(message, cause);
     }