[ 
http://issues.apache.org/jira/browse/VELOCITY-350?page=comments#action_12329801 
] 

Will Glass-Husain commented on VELOCITY-350:
--------------------------------------------

Discussion on dev list.  From Nathan Bubna:

> 1.  if foo and bar are both numbers, do a numeric comparison.
> 2.  if foo and bar are strings, do a direct string comparison
> 3.  if bar is an instance of foo's class and/or foo is an instance of
> bar's class, then do foo.equals(bar)
> 4.  otherwise, compare foo.toString() with bar.toString()


> Base Equality on toString() when operands are of different classes
> ------------------------------------------------------------------
>
>          Key: VELOCITY-350
>          URL: http://issues.apache.org/jira/browse/VELOCITY-350
>      Project: Velocity
>         Type: Bug
>   Components: Source
>     Versions: 1.5
>  Environment: Operating System: Windows XP
> Platform: PC
>     Reporter: Will Glass-Husain
>     Assignee: Velocity-Dev List

>
> This was discussed on the dev list a few weeks ago.  If two objects being 
> compared are of different (non-numeric) classes, I'd like to see equality be 
> based on toString (rather than just be false).  This just makes sense in a 
> template environment where types are not visible to template writers, and is 
> also the way that JSTL/JSP 2.0 works.  This is particularly useful when 
> comparing a literal String to a class implementing Bloch's Typesafe 
> Enumeration pattern [1] or a StringBuffer.
> Comments welcome.
> [1]
> http://java.sun.com/developer/Books/shiftintojava/

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to