[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-scm
Subject:    [jira] Created: (GROOVY-1167) Object.collect(Collection,Closure) fails to work with Set parameter
From:       "Russel Winder (JIRA)" <jira () codehaus ! org>
Date:       2005-11-28 12:05:06
Message-ID: 85016673.1133179506240.JavaMail.haus-jira () codehaus01 ! managed ! contegix ! com
[Download RAW message or body]

Object.collect(Collection,Closure) fails to work with Set parameter
-------------------------------------------------------------------

         Key: GROOVY-1167
         URL: http://jira.codehaus.org/browse/GROOVY-1167
     Project: groovy
        Type: Bug
 Environment: Debian GNU/Linux ; Java 1.5.0_05 ; Groovy CVS 2005-11-28T11:00
    Reporter: Russel Winder
 Assigned to: Guillaume Laforge 


This method suffers the same problem as Object.collect(Closure) where the object \
having collect applied to is not a List, this is effectively GROOVY-1164.

However this method also has a problem with the parameter.  It claims that the \
parameter can be a Collection and it works fine with anything that is a List.  \
However if the parameter is a Set:

def a = [ 'a' , 'b' , 'c' , 'd' ]
def b = [ 'e' , 'f' , 'g' , 'h' ] as Set
def c = a.collect { it + it }
println c.getClass ( ).getName ( ) + ": " + c

then the result is:

Caught: java.lang.ClassCastException: java.util.ArrayList


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic