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

strang behavior: sort vs sort()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.0-beta-4
    • 1.0-JSR-2
    • None
    • None
    • WIN2k SP3, jdk1.4.2_04

    Description

      when using sort w/o () strange things happen
      see result of the following script:

      println "sort()..."
      country = [ 'Canada', 'Austria', 'Brazil' ]
      country.sort().each { println "Hello ${it}" }
      println "sort..."
      country2 = [ 'Canada', 'Austria', 'Brazil' ]
      country2.sort.each { println "Hello ${it}" }

      Output:
      sort()...
      Hello Austria
      Hello Brazil
      Hello Canada
      sort...
      Hello Canada
      Hello Austria
      Hello Austria
      Hello Brazil

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            chris68 Chris
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: