Velocity
  1. Velocity
  2. VELOCITY-645

Value comparisons in strict mode should be strict

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7
    • Component/s: Engine
    • Labels:
      None

      Description

      In strict mode throw an exception when values cannot be correctly compared instead for ignoring this case.

      For example:
      #set($a = $NULL)
      #set($b = $NULL)
      #if ($a > $b)
      foobar
      #end

      1. 645.patch
        11 kB
        Byron Foster

        Activity

        Hide
        Will Glass-Husain added a comment -

        Does this patch still support the testing of equality using toString() when the operands are of different types?

        Show
        Will Glass-Husain added a comment - Does this patch still support the testing of equality using toString() when the operands are of different types?
        Hide
        Byron Foster added a comment -

        Yes. This patch does not effect the == and != operators. It effects the >=, >, <, <=, operators, and in these cases it doesn't change any behavior in the comparison. Where normally the comparisons logged to error when the comparison could not be made it now appropriately throws an exception when in strict mode (RUNTIME_REFERENCES_STRICT). These cases where over looked when I added strict mode

        Show
        Byron Foster added a comment - Yes. This patch does not effect the == and != operators. It effects the >=, >, <, <=, operators, and in these cases it doesn't change any behavior in the comparison. Where normally the comparisons logged to error when the comparison could not be made it now appropriately throws an exception when in strict mode (RUNTIME_REFERENCES_STRICT). These cases where over looked when I added strict mode

          People

          • Assignee:
            Unassigned
            Reporter:
            Byron Foster
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development