Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-612

Support for #break directive inside foreach loops (includes a patch)

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      Here's a small patch that adds support for #break directive that can be used to break foreach-loops.

      Catch: #break does not verify that it is inside a foreach loop. If it is not, a RuntimeException of type BreakException is thrown during rendering and not caught properly. Testcases are also quite laughable but the directive seems to work OK.

        Attachments

        1. velocity-1.6-dev-break-directive.patch
          10 kB
          Jarkko Viinamäki
        2. ForeachBreakTestCase.java
          3 kB
          Nathan Bubna

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wyla Jarkko Viinamäki
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: