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

Java syntax for creating an array does not work

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0-JSR-3
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: