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 a075bfd6dfbd3f0922b0c8882cb477fb599eed8f
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Aug 19 10:06:16 2024 +0200

    (chores) convert core/camel-core-catalog to use pattern matching for 
instanceof
---
 .../src/main/java/org/apache/camel/catalog/impl/CatalogHelper.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/CatalogHelper.java
 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/CatalogHelper.java
index 5039eccea26..db41d8eaa50 100644
--- 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/CatalogHelper.java
+++ 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/CatalogHelper.java
@@ -117,8 +117,7 @@ public final class CatalogHelper {
     public static boolean isNotEmpty(Object value) {
         if (value == null) {
             return false;
-        } else if (value instanceof String) {
-            String text = (String) value;
+        } else if (value instanceof String text) {
             return !text.isBlank();
         } else {
             return true;
@@ -278,8 +277,8 @@ public final class CatalogHelper {
     @SuppressWarnings("unchecked")
     private static Object replaceWithList(Object oldValue, String newValue) {
         List<String> list;
-        if (oldValue instanceof List) {
-            list = (List<String>) oldValue;
+        if (oldValue instanceof List oldValueList) {
+            list = oldValueList;
             list.add(newValue);
 
         } else {

Reply via email to