You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Al Bundy (Jira)" <ji...@apache.org> on 2021/02/25 22:03:00 UTC

[jira] [Updated] (VELOCITY-935) Negation dos not work correctly after update from 1.6 to 2.2

     [ https://issues.apache.org/jira/browse/VELOCITY-935?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Al Bundy updated VELOCITY-935:
------------------------------
    Description: 
With 1.6 we used this

 
{code:java}
#if ( ! "$!testrun" == "true" )
...
#end{code}
This ensures that the code is only executed if current run is not a testrun ($testrun false or empty).

 

Sine update to 2.2 this does not to work.

In my case $testrun was false, but code was not executed.

To get this to work I had to use brackets around the equals-check
{code:java}
#if ( ! ("$!testrun" == "true") )
...
#end
{code}
This breaks the logic of a lot of templates...

  was:
With 1.6 we used this

 
{code:java}
#if ( ! "$!testrun" == "true" )
...
#end{code}
This ensures that the code is only executed if current run is not a testrun ($testrun false or empty).

 

Sine update to 2.2 this does not to work.

In my case $testrun was false, but code was not executed.

To get this to work I had to brackets around the equals-check


{code:java}
#if ( ! ("$!testrun" == "true") )
...
#end
{code}
This breaks the logic of a lot of templates...


> Negation dos not work correctly after update from 1.6 to 2.2
> ------------------------------------------------------------
>
>                 Key: VELOCITY-935
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-935
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.2
>            Reporter: Al Bundy
>            Assignee: Claude Brisson
>            Priority: Major
>
> With 1.6 we used this
>  
> {code:java}
> #if ( ! "$!testrun" == "true" )
> ...
> #end{code}
> This ensures that the code is only executed if current run is not a testrun ($testrun false or empty).
>  
> Sine update to 2.2 this does not to work.
> In my case $testrun was false, but code was not executed.
> To get this to work I had to use brackets around the equals-check
> {code:java}
> #if ( ! ("$!testrun" == "true") )
> ...
> #end
> {code}
> This breaks the logic of a lot of templates...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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