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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.6
    • Engine
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: