Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1812

== operator inconsistent with Object#equals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0
    • 1.1-rc-3
    • groovy-jdk
    • None
    • JDK 6 on WinXP platform

    Description

      class MyClass {
      boolean equals(MyClass o)

      { # change to Object o, it works return true }

      }

      o = new MyClass()
      o2 = new MyClass()

      println o.equals(o2)
      println o2.equals(o)
      println o == o2

      Attachments

        1. equalsPatch.patch
          2 kB
          Alex Tkachman
        2. patch_for_1812.diff
          1 kB

        Activity

          People

            ait Alex Tkachman
            shhgs Huang Guang Shen
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: