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

Regression: Null element coerced to "null" String when containing List is coerced to String array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.7.6
    • 1.7.7, 1.8-beta-4
    • None
    • None

    Description

      From http://groovy.329449.n5.nabble.com/Change-in-contains-behavior-in-1-7-6-vs-1-7-5-td3367327.html:

      Groovy 1.7.5:

      def x = [null] as String[]
      println x[0] == null  // true
      println x[0]?.length() // null
      

      Groovy 1.7.6:

      def x = [null] as String[]
      println x[0] == null  // false
      println x[0]?.length() // 4
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            pniederw Peter Niederwieser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: