orpiske commented on code in PR #22303:
URL: https://github.com/apache/camel/pull/22303#discussion_r3009566227


##########
components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java:
##########
@@ -1178,26 +1178,26 @@ protected static List<Source> 
getPayloadBodyElements(Message message, Map<String
                 part = ((Holder<?>) part).value;
             }
 
-            if (part instanceof Source) {
+            if (part instanceof Source source) {
                 Element element = null;
-                if (part instanceof DOMSource) {
-                    element = getFirstElement(((DOMSource) part).getNode());
+                if (part instanceof DOMSource domSource) {
+                    element = getFirstElement(domSource.getNode());
                 }
 
                 if (element != null) {
                     addNamespace(element, nsMap);
                     answer.add(new DOMSource(element));
                 } else {
-                    answer.add((Source) part);
+                    answer.add(source);
                 }
 
                 if (LOG.isTraceEnabled()) {
                     LOG.trace("Extract body element {}",
                             element == null ? "null" : getXMLString(element));
                 }
-            } else if (part instanceof Element) {
-                addNamespace((Element) part, nsMap);
-                answer.add(new DOMSource((Element) part));
+            } else if (part instanceof Element element) {

Review Comment:
   Fixed in d9c791bcc78 — renamed to `elem`. Thanks for catching that.
   
   _Claude Code on behalf of Otavio R. Piske_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to