You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Ben Speakmon (JIRA)" <de...@velocity.apache.org> on 2007/04/11 20:16:32 UTC

[jira] Commented: (VELOCITY-528) Velocity 1.5 raises errors for templates that ran in 1.4.

    [ https://issues.apache.org/jira/browse/VELOCITY-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488134 ] 

Ben Speakmon commented on VELOCITY-528:
---------------------------------------

Thanks for the explanation, Nathan.

> Velocity 1.5 raises errors for templates that ran in 1.4.
> ---------------------------------------------------------
>
>                 Key: VELOCITY-528
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-528
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 1.5
>         Environment: Windows XP SP2, JDK 1.5
>            Reporter: Michael Giroux
>             Fix For: 1.5.1, 1.6
>
>
> Migrated from Velocity 1.4 to 1.5.  I have several templates that ran in 1.4 and now fail in 1.5.  I raised this in the mailing list and Nathan Bubna asked me to file a bug.
> This is probably an error in my template, but 1.4 allowed it to execute without complaints.  I might have been lucky that nothing bad happened.  
> Existing templates contain the following.
>  public $method.returnType $method.name(
>  #foreach($param in $parameters)
>     ...
>  #end
> The intent here is to emit a java method signature for a method named $method.name .  This works in 1.4.
> In Velocity 1.5, an error is thrown indicating that the #foreach is unexpected.  Velocity 1.5 is expecting a method parameter becuase the variable name is terminated by an open paren.
> I fixed the problem by adding curly braces to the template as follows:
>  public $method.returnType ${method.name}(
>  #foreach($param in $parameters)
>     ...
>  #end
> This is probably a bug in 1.4, and poor coding practice in my template, but given the fact that it did work and now doesn't, there should be some mention of this "improvement" in the 1.5 release notes.

-- 
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