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

Java syntax for creating an array does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-JSR-2
    • 1.0-JSR-3
    • None
    • None
    • Windows XP, Java 1.4.2

    Description

      When Groovy is embedded in a Java program, the standard Java syntax for creating a new array from a set of elements does not work. The following line

      shell.evaluate("a = new Object []

      {1,2,3}

      ");

      throws an exception:

      Script1.groovy: 1: unexpected token: , @ line 1, column 21.
      1 Error

      On the other hand, when exactly the same line is entered into groovysh, it works perfectly.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            peastman Peter Eastman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: