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

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

commit 6d3cbd51aa19e4a2c03f0ac72dce1768905c2d13
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Fri Feb 6 13:30:29 2026 +0000

    (chores): modernize instanceof checks in camel-google-pubsub
---
 .../camel/component/google/pubsub/GooglePubsubConsumer.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumer.java
 
b/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumer.java
index 26d60949ac26..ef40e7605580 100644
--- 
a/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumer.java
+++ 
b/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumer.java
@@ -183,10 +183,10 @@ public class GooglePubsubConsumer extends DefaultConsumer 
{
 
                     // Check if error is recoverable
                     boolean isRecoverable = false;
-                    if (e instanceof ApiException) {
-                        isRecoverable = ((ApiException) e).isRetryable();
-                    } else if (e.getCause() instanceof ApiException) {
-                        isRecoverable = ((ApiException) 
e.getCause()).isRetryable();
+                    if (e instanceof ApiException ae) {
+                        isRecoverable = ae.isRetryable();
+                    } else if (e.getCause() instanceof ApiException ae) {
+                        isRecoverable = ae.isRetryable();
                     }
 
                     if (isRecoverable) {

Reply via email to