Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7298

Simple Language - Binary Expression Equality Fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.12.3, 2.13.0
    • 2.12.4, 2.13.1, 2.14.0
    • camel-core
    • None
    • Windows 8.1

    • Unknown

    Description

      When writing the following code, the expression

      ${headers.true} == ${headers.true}

      evaluates to false - rather than the expected true.

          <camelContext trace="false" xmlns="http://camel.apache.org/schema/blueprint">
              <route>
                  <from uri="direct:entry"/>
      
                  <setHeader headerName="true">
                      <constant>true</constant>
                  </setHeader>
      
                  <setBody>
                      <simple resultType="java.lang.Boolean">${headers.true} == ${headers.true}</simple>
                  </setBody>
      
                  <log message="The expression evaluated to :: ${body}" />
      
              </route>
          </camelContext>
      
      [                          main] route1                         INFO  The expression evaluated to :: false
      

      Edit: I have tried debugging this, and it seems that the "==" token is being treated as a LiteralExpression - rather than an being a Binary Operator? I'm imaging therefore that the `false` is purely from coercing a String to the java.lang.Boolean resultType?

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              alanfoster Alan Foster
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: