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 b44c927e06c1a0838c8236a576ba7f3998f1854d
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Jan 26 10:41:30 2026 +0000

    (chores): modernize instanceof checks in camel-jslt
---
 .../apache/camel/component/jslt/JsltEndpoint.java    | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
 
b/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
index 5476715789a7..3ca8c381dcc5 100644
--- 
a/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
+++ 
b/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
@@ -218,16 +218,16 @@ public class JsltEndpoint extends ResourceEndpoint {
         if (body instanceof WrappedFile) {
             body = ((WrappedFile<?>) body).getFile();
         }
-        if (body instanceof String) {
-            input = objectMapper.readTree((String) body);
-        } else if (body instanceof Reader) {
-            input = objectMapper.readTree((Reader) body);
-        } else if (body instanceof File) {
-            input = objectMapper.readTree((File) body);
-        } else if (body instanceof byte[]) {
-            input = objectMapper.readTree((byte[]) body);
-        } else if (body instanceof InputStream) {
-            input = objectMapper.readTree((InputStream) body);
+        if (body instanceof String string) {
+            input = objectMapper.readTree(string);
+        } else if (body instanceof Reader reader) {
+            input = objectMapper.readTree(reader);
+        } else if (body instanceof File file) {
+            input = objectMapper.readTree(file);
+        } else if (body instanceof byte[] byteArray) {
+            input = objectMapper.readTree(byteArray);
+        } else if (body instanceof InputStream inputstream) {
+            input = objectMapper.readTree(inputstream);
         } else {
             throw new ValidationException(exchange, "Allowed body types are 
String, Reader, File, byte[] or InputStream.");
         }

Reply via email to