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 0346116a5a474f229408eb6f62234bb72a8e3c4b
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Jan 26 11:51:54 2026 +0000

    (chores): modernize instanceof checks in camel-xslt
---
 .../org/apache/camel/component/xslt/XmlSourceHandlerFactoryImpl.java  | 4 ++--
 .../src/main/java/org/apache/camel/component/xslt/XsltBuilder.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XmlSourceHandlerFactoryImpl.java
 
b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XmlSourceHandlerFactoryImpl.java
index 636b9a908d82..59c2ba73d742 100644
--- 
a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XmlSourceHandlerFactoryImpl.java
+++ 
b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XmlSourceHandlerFactoryImpl.java
@@ -114,8 +114,8 @@ public class XmlSourceHandlerFactoryImpl implements 
SourceHandlerFactory {
      */
     protected Source getSource(Exchange exchange, Object body) {
         // body may already be a source
-        if (body instanceof Source) {
-            return (Source) body;
+        if (body instanceof Source source) {
+            return source;
         }
         Source source = null;
         if (body != null) {
diff --git 
a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltBuilder.java
 
b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltBuilder.java
index 41bbf1cefa46..30fc027fde20 100644
--- 
a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltBuilder.java
+++ 
b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltBuilder.java
@@ -119,8 +119,8 @@ public class XsltBuilder implements Processor {
 
             source = prepareSource(source);
 
-            if (source instanceof SAXSource) {
-                tryAddEntityResolver((SAXSource) source);
+            if (source instanceof SAXSource saxSource) {
+                tryAddEntityResolver(saxSource);
             }
 
             LOG.trace("Using {} as source", source);

Reply via email to