groovy
  1. groovy
  2. GROOVY-4655

groovy.transform.EqualsAndHashCode annotation does not handle cycles

    Details

    • Number of attachments :
      3

      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)

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

        Activity

          People

          • Assignee:
            Paul King
            Reporter:
            Travis
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: