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

Henning Schmiedehausen closed VELOCITY-113.
-------------------------------------------


> cannot compare Timestamp.getTime() to 0
> ---------------------------------------
>
>                 Key: VELOCITY-113
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-113
>             Project: Velocity
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 1.3-rc1
>         Environment: Operating System: All
> Platform: PC
>            Reporter: Melehin Anton
>         Assigned To: Velocity-Dev List
>
> I was trying to make a macro to show empty line when $dt (Timestamp) object 
> is 
> empty:
> #macro ( dateshowempty $dt)
>   #set ($mlsc = $dt.getTime())
>   #if ($mlsc == 0) --.--.---- 
>   #else ${dt} 
>   #end
> debug: $mlsc
> #end
> Argument is Timestamp object. Macro never prints empty line (--.--.----)
> Condition doesn't work... 
> However, debug line prints [debug: 0]
> Perhaps, it happens because getTime() returns long? 
> Velocity cannot compare Long to Integer and condition is wrong forever?
> I changed line: #set ($mlsc = $dt.getTime()) to: #set ($mlsc = 0) -- 
> everything OK --
>  I saw my empty line (--.--.----)
> Maybe I could set $mlsc to long type (something like 0L), but I don't know 
> how to 
> do it...

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to