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

Groovy String's toString() method always returns the same string

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-3
    • 1.0-beta-4
    • None
    • None

    Description

      i = 0
      c =

      {it << ++i}

      .asWritable()
      s = "string ${c}\n"
      System.out << s
      System.out << s.toString()
      System.out << s
      System.out << s.toString()

      prints

      string 1
      string 2
      string 3
      string 2

      I think it should print

      string 1
      string 2
      string 3
      string 4

      Attachments

        Activity

          People

            tug John Wilson
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: