You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2023/05/09 13:52:00 UTC

[jira] [Resolved] (CAMEL-19324) Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context"

     [ https://issues.apache.org/jira/browse/CAMEL-19324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Yue Fang resolved CAMEL-19324.
--------------------------------------
    Fix Version/s: 3.18.7
                   3.20.5
                   4.0
       Resolution: Fixed

> Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context"
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-19324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19324
>             Project: Camel
>          Issue Type: Improvement
>          Components: came-cxf
>            Reporter: Freeman Yue Fang
>            Assignee: Freeman Yue Fang
>            Priority: Minor
>             Fix For: 3.18.7, 3.20.5, 4.0
>
>
> Having
> {code}
>   MessageContentsList list = new MessageContentsList();
>         list.add("haha");
>         list.add("hehe");
> {code}
> {code}
>      from("timer:tick")
>                 .process(new Processor() {
>                     @Override
>                     public void process(Exchange exchange) throws Exception {
>                         exchange.getIn().setBody(list);
>                     }
>                 })
>                 .log("my body ${body}");
> {code}
> It prints "my body haha" but i would expect "my body [haha, hehe]" (as with ArrayList). 
> If MessageContentsList is used in "CXF context", the first element is return value, the other elements are Holders, so it has special logic in converter. But if use MessageContentsList in non - "CXF context", it should be treated as a general ArrayList, which can honour behaviour when converting to String.class is needed(like in to.("log...") processor)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)