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

Documentation: Error for one of the examples from JN0025-Starting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.8.4
    • 1.8.6, 2.0-beta-3
    • GroovyDoc
    • Fedora Linux 15, JDK 1.6

    Description

      One of the examples from http://groovy.codehaus.org/JN0025-Starting is incorrect.

      def x= ['a', 'b', 'c'] as Integer[] //convert each item in list to an Integer
      assert x[0] == 97 && x[1] == 98 && x[2] == 99 //access each element individually

      It causes java.lang.NumberFormatException: For input string: "a"

      There's also a related ticket already: GROOVY-4602

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: