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

GString not converted to String in some cases

    XMLWordPrintableJSON

Details

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

    Description

      The following groovy snippet results in an exception because the GString is not automatically converted into a String:

      stringList = ["US-ASCII", "UTF-8", "UTF-16"].each {
      "test".getBytes("${it}")
      }

      I had a difficult time getting this down to a simple test case. It appears that this is only a problem when you're using an overloaded method (like getBytes()). This same test will work fine with concat().

      Attachments

        Activity

          People

            Unassigned Unassigned
            nstimm Sean Timm
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: