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

@ToString should use getX() rather than the field x when getting property values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 1.8.1
    • None
    • None

    Description

      I expect the following example to work:

      @TupleConstructor @ToString class Point { int x, y }
      def p1 = new Point(1, 2)
      def p2 = new Point(1, 1) { int getY() { 2 } }
      assert p1.toString() == 'Point(1, 2)'
      assert p2.toString() == 'Point(1, 2)'
      

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: