dk2k commented on code in PR #9816:
URL: https://github.com/apache/camel/pull/9816#discussion_r1158145625


##########
components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/SoapDataFormat.java:
##########
@@ -121,33 +121,18 @@ protected List<Object> createContentFromObject(
             final Object inputObject, String soapAction,
             List<Object> headerElements) {
         List<Object> bodyParts = new ArrayList<>();
-        List<Object> headerParts = new ArrayList<>();
         bodyParts.add(inputObject);
 
         List<Object> bodyElements = new ArrayList<>();
         for (Object bodyObj : bodyParts) {
             QName name = 
elementNameStrategy.findQNameForSoapActionOrType(soapAction, 
bodyObj.getClass());
             if (name == null) {
                 LOG.warn("Could not find QName for class {}", 
bodyObj.getClass().getName());
-                continue;
             } else {
                 bodyElements.add(getElement(bodyObj, name));
             }
         }
 
-        for (Object headerObj : headerParts) {
-            QName name = 
elementNameStrategy.findQNameForSoapActionOrType(soapAction, 
headerObj.getClass());
-            if (name == null) {
-                LOG.warn("Could not find QName for class {}", 
headerObj.getClass().getName());
-                continue;
-            } else {
-                JAXBElement<?> headerElem = getElement(headerObj, name);
-                if (null != headerElem) {
-                    headerElements.add(headerElem);

Review Comment:
   headerParts is always an empty list. You refer to the code inside the loop, 
but this loop iterates through an empty list. Hence, the referred code is never 
reached. The entire loop can be removed



-- 
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