You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org> on 2008/08/17 19:17:44 UTC

[jira] Created: (VELOCITY-612) Support for #break directive inside foreach loops (includes a patch)

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

                 Key: VELOCITY-612
                 URL: https://issues.apache.org/jira/browse/VELOCITY-612
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
            Reporter: Jarkko Viinamäki
            Priority: Minor
             Fix For: 1.6


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-612) Support for #break directive inside foreach loops (includes a patch)

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna updated VELOCITY-612:
----------------------------------

    Attachment: ForeachBreakTestCase.java

this looks great, Jarkko.   i did enhance the test case some (see attached).   i'll go ahead and commit this.   do you think you could add a patch for documentation that demonstrates using this in #foreach?  :)

> Support for #break directive inside foreach loops (includes a patch)
> --------------------------------------------------------------------
>
>                 Key: VELOCITY-612
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-612
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>            Reporter: Jarkko Viinamäki
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: ForeachBreakTestCase.java, velocity-1.6-dev-break-directive.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-612) Support for #break directive inside foreach loops (includes a patch)

Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarkko Viinamäki updated VELOCITY-612:
--------------------------------------

    Attachment: velocity-1.6-dev-break-directive.patch

> Support for #break directive inside foreach loops (includes a patch)
> --------------------------------------------------------------------
>
>                 Key: VELOCITY-612
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-612
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>            Reporter: Jarkko Viinamäki
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: velocity-1.6-dev-break-directive.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-612) Support for #break directive inside foreach loops (includes a patch)

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-612.
-----------------------------------

    Resolution: Fixed

> Support for #break directive inside foreach loops (includes a patch)
> --------------------------------------------------------------------
>
>                 Key: VELOCITY-612
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-612
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>            Reporter: Jarkko Viinamäki
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: ForeachBreakTestCase.java, velocity-1.6-dev-break-directive.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org