Commons OGNL
  1. Commons OGNL
  2. OGNL-35

CLONE -expression concatenated via "and" / "&&" is not evaluated correctly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: ExpressionCompiler
    • Labels:
      None
    • Environment:
      tapestry

      Description

      having a condition like:

      condition="ognl:condition1 && condition2"

      condition2 gets evaluatated, even if condition1 returns false

      in version 2.6.9 it worked correctly

      the manual says explicitly:

      e1 && e2, e1 and e2

      getValue is called on e1 and the result is interpreted as a boolean. If false, that result is returned; if true, getValue is called on e2 and its value is returned.

        Activity

        Hide
        Marco Valverde added a comment -

        sorry, did not find a way to reopen the original issue, but this isn't solved!

        Show
        Marco Valverde added a comment - sorry, did not find a way to reopen the original issue, but this isn't solved!
        Hide
        Ben Dotte added a comment -

        I hit this one as well. It is a particular problem when you need the expression to short-circuit to avoid getting a stack trace from the 2nd expression getting evaluated. For example:

        <showCrumbs jwcid="@If" condition="ognl:categoryId != null && ancestors.size > 1">

        getAncestors() depends on the fact that getCategoryId() is not null. This one worked in OGNL 2.6, it throws an exception in 2.7.

        Show
        Ben Dotte added a comment - I hit this one as well. It is a particular problem when you need the expression to short-circuit to avoid getting a stack trace from the 2nd expression getting evaluated. For example: <showCrumbs jwcid="@If" condition="ognl:categoryId != null && ancestors.size > 1"> getAncestors() depends on the fact that getCategoryId() is not null. This one worked in OGNL 2.6, it throws an exception in 2.7.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Marco Valverde
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development