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

Exception passing array into Closure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • None
    • 1.0-JSR-3
    • None
    • None

    Description

      (from the mailing list):

      I wrote:

      – script –
      c1 = new Class[]

      { Exception.class, Throwable.class }

      c2 = new Class[]

      { IllegalStateException.class }

      println (c1)
      println (c2)
      [c1, c2].each

      {println(it)}

      – 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

          Activity

            People

              tug John Wilson
              davisond Darren Davison
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: