You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "dk2k (via GitHub)" <gi...@apache.org> on 2023/04/05 07:47:48 UTC

[GitHub] [camel] dk2k commented on a diff in pull request #9816: Removed empty List headerParts and the related loop

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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org