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

Simple expression and predicate have different behaviors when used along with properties

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.3
    • Fix Version/s: 2.10.5, 2.11.1, 2.12.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      The following simple expression doesn't behave the same way whether it's used as expression or predicate:

      '{{foo}}' == 'bar'
      

      When used in an expression, it works perfectly.

      When used in a predicate the given expression is thrown:

      org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: functionEnd has no matching start token at location 7
      '{{foo}}' == 'bar'
             *
      
      	at org.apache.camel.language.simple.SimplePredicateParser.parsePredicate(SimplePredicateParser.java:69)
      	at org.apache.camel.language.simple.SimpleLanguage.createPredicate(SimpleLanguage.java:136)
      	at org.apache.camel.builder.SimpleBuilder.matches(SimpleBuilder.java:73)
      	at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:66)
      ...
      

      You'll find attached the source code that shows the error

        Attachments

        1. properties_everywhere.patch
          6 kB
          Antoine DESSAIGNE
        2. CamelTest.java
          3 kB
          Antoine DESSAIGNE

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              antoine.dessaigne Antoine DESSAIGNE
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: