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

reader.transformLine(writer) {closure} doesn't yield closure return value to the writer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-JSR-4
    • groovy-jdk
    • None

    Description

      reader = new StringReader('abc')
      writer = new StringWriter()

      reader.transformLine(writer)

      { it }

      assert writer.toString().startsWith('abc')

      writer.toString() is empty but should contain
      'abc' plus a System-dependent line feed (writer.newLine()).

      The code in DefaultGroovyMethods looks ok, though...

      Attachments

        Activity

          People

            alang Alan Green
            codevise Dierk König
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: