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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • Bugzilla Id:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: