Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
None
-
None
-
None
Description
(from the mailing list):
I wrote:
– script –
c1 = new Class[]
c2 = new Class[]
{ IllegalStateException.class }println (c1)
println (c2)
[c1, c2].each
– output –
[Ljava.lang.Class;@14da8f4
[Ljava.lang.Class;@fd68b1
Incorrect arguments to closure: CommandLine4$_run_closure1@10a2d64.
Expected: [class java.lang.Object], actual: [class java.lang.Exception,
class java.lang.Throwable]
John Wilson responded:
It's a bug
The closure code is getting confused into thinking that you are calling it with Exception.class, Throwable.class as parameters.
Attachments
Issue Links
- is depended upon by
-
GROOVY-764 closures
- Closed
- is duplicated by
-
GROOVY-886 each(){} throws NPE when called on a Java Object[], that contains String[]'s with null entries
- Closed