Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-350

Base Equality on toString() when operands are of different classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5
    • 1.5
    • Engine
    • None
    • Operating System: Windows XP
      Platform: PC
    • 33322

    Description

      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/

      Attachments

        Activity

          People

            Unassigned Unassigned
            wglass@forio.com Will Glass-Husain
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: