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

groovy.transform.EqualsAndHashCode annotation does not handle cycles

    XMLWordPrintableJSON

Details

    Description

      The groovy.transform.EqualsAndHashCode AST transformation does not handle object graphs with cycles. See the attached junit tests.

      Some of the test methods I included actually pass - I just included them for completeness. Basically, the equals method handles cycles just fine. The hashcode method does not so all the tests related to the hashcode method fail.

      This is a pretty serious issue because these object structures are common with some frameworks (like orm tools)

      Attachments

        1. Bar.groovy
          0.2 kB
          Travis Schneeberger
        2. EqualsAndHashCodeCycleTest.groovy
          2 kB
          Travis Schneeberger
        3. Foo.groovy
          0.2 kB
          Travis Schneeberger

        Activity

          People

            paulk Paul King
            leo.herbie Travis Schneeberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: