camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-7305) Simple Language - ResultType Coercion is not consistent
Date Tue, 18 Mar 2014 06:25:52 GMT

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

Claus Ibsen resolved CAMEL-7305.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.14.0
                   2.13.1
                   2.12.4
         Assignee: Claus Ibsen

Fixed by CAMEL-7298

> Simple Language - ResultType Coercion is not consistent
> -------------------------------------------------------
>
>                 Key: CAMEL-7305
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7305
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.12.3
>            Reporter: Alan Foster
>            Assignee: Claus Ibsen
>             Fix For: 2.12.4, 2.13.1, 2.14.0
>
>
> Both of the following code snippets lead to unexpected results when setting a resultType
to be a boolean/integer
> {code:title=Scenario - Handling POJO}
>     <camelContext trace="false" xmlns="http://camel.apache.org/schema/blueprint">
>         <route>
>             <from uri="direct:entry"/>
>             <!-- Return any kind of POJO -->
>             <bean ref="complexModelFactory" method="createComplexModel" />
>             <setBody>
>                 <simple resultType="java.lang.Boolean">${body}</simple>
>             </setBody>
>             <log message="The body is currently :: '${body}'" />
>         </route>
>     </camelContext>
> {code}
> {code:title=Scenario - Handling missing header}
>     <camelContext trace="false" xmlns="http://camel.apache.org/schema/blueprint">
>         <route>
>             <from uri="direct:entry"/>
>             <setBody>
>                 <simple resultType="java.lang.Boolean">${headers.missing}</simple>
>             </setBody>
>             <log message="The body is currently :: '${body}'" />
>         </route>
>     </camelContext>
> {code}
> The log for both of these scenarios is -
> {code}[                          main] route1                         INFO  The body
is currently :: ''{code}
> It might be expected that the resulting body would either be true or false.
> I am not sure if the below behaviour is as expected either - as they are similiar scenarios,
but with different outcomes.
> {code}
>             <!-- No error - but header is not an integer -->
>             <setBody>
>                 <simple resultType="java.lang.Integer">${headers.missing}</simple>
>             </setBody>
>            <!-- Causes java.lang.NumberFormatException: For input string: "" -->
>             <setBody>
>                 <simple resultType="java.lang.Integer"></simple>
>             </setBody>
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message