[ 
https://issues.apache.org/jira/browse/VELTOOLS-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18089681#comment-18089681
 ] 

Claude Brisson commented on VELTOOLS-210:
-----------------------------------------

A test under 1.7 of the following template gave "key value false", so I could 
not reproduce your issue.
{code:java}
#set($key1 = "value")#set($value = "key value false")
#if(${key1} == 1 || "yes" )
  #set($value = "key value true")
#end
${value}
 {code}

> velocity 1.7 vs velocity 2.3 : the evaluation of if condition in script is 
> different 
> -------------------------------------------------------------------------------------
>
>                 Key: VELTOOLS-210
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-210
>             Project: Velocity Tools
>          Issue Type: Bug
>          Components: VelocityView
>    Affects Versions: 3.1
>            Reporter: ambika
>            Priority: Major
>
> *script used :* 
>  
> Map<String, Object> variables = new HashMap<>();
> variables.put("key1", "value");
>  
> Context context = velocityEngine.getToolsContext(variables);
>  
> String inString = "#set($value = \"key value false\")" +
> "#if(${key1} == 1 ||\"yes\" )" +
> " #set($value = \"{*}{{*}}key value true{{*}}{*}\")" +
> "#end\n${value}";
>  
> inString = velocityEngine.evaluate(context, "tag", inString);
> System.out.println(inString);
>  
>  
> Output:
>  
> older version output : key value true
>  
> newer version output : key value false 
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to