DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14160>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14160 cannot compare Timestamp.getTime() to 0 Summary: cannot compare Timestamp.getTime() to 0 Product: Velocity Version: 1.3-rc1 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: Build AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] 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... -- To unsubscribe, e-mail: <mailto:velocity-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:velocity-dev-help@;jakarta.apache.org>
