Details
Description
Given a Java class A with public method of signature:
public void doSomething ( final String[] args )
then the Groovy script:
A a = new A ( )
a.doSomething ( new String[]
)
ought to compile. Instead the result is:
Caught: General error during parsing: unexpected token: ,
/home/users/russel/Progs/Groovy/Varargs/./test.groovy:9:40: unexpected token: ,
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatement(GroovyRecognizer.java:7179)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1051)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.blockBody(GroovyRecognizer.java:1248)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.closedBlock(GroovyRecognizer.java:7046)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.appendedBlock(GroovyRecognizer.java:9352)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathElement(GroovyRecognizer.java:9287)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathExpression(GroovyRecognizer.java:8913)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.postfixExpression(GroovyRecognizer.java:11113)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.unaryExpressionNotPlusMinus(GroovyRecognizer.java:10973)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.powerExpression(GroovyRecognizer.java:10798)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multiplicativeExpression(GroovyRecognizer.java:10730)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.additiveExpression(GroovyRecognizer.java:10397)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.shiftExpression(GroovyRecognizer.java:8109)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.relationalExpression(GroovyRecognizer.java:10133)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.equalityExpression(GroovyRecognizer.java:10073)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.regexExpression(GroovyRecognizer.java:10021)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.andExpression(GroovyRecognizer.java:9989)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.exclusiveOrExpression(GroovyRecognizer.java:9957)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.inclusiveOrExpression(GroovyRecognizer.java:9925)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalAndExpression(GroovyRecognizer.java:9893)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalOrExpression(GroovyRecognizer.java:9861)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.conditionalExpression(GroovyRecognizer.java:3861)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.assignmentExpression(GroovyRecognizer.java:8672)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expression(GroovyRecognizer.java:6369)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.strictContextExpression(GroovyRecognizer.java:7226)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.argument(GroovyRecognizer.java:11749)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.argList(GroovyRecognizer.java:5463)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.methodCallArgs(GroovyRecognizer.java:9549)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathElement(GroovyRecognizer.java:9272)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathExpression(GroovyRecognizer.java:8913)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.postfixExpression(GroovyRecognizer.java:11113)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.unaryExpressionNotPlusMinus(GroovyRecognizer.java:10973)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.powerExpression(GroovyRecognizer.java:10798)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multiplicativeExpression(GroovyRecognizer.java:10730)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.additiveExpression(GroovyRecognizer.java:10397)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.shiftExpression(GroovyRecognizer.java:8109)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.relationalExpression(GroovyRecognizer.java:10133)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.equalityExpression(GroovyRecognizer.java:10073)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.regexExpression(GroovyRecognizer.java:10021)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.andExpression(GroovyRecognizer.java:9989)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.exclusiveOrExpression(GroovyRecognizer.java:9957)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.inclusiveOrExpression(GroovyRecognizer.java:9925)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalAndExpression(GroovyRecognizer.java:9893)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalOrExpression(GroovyRecognizer.java:9861)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.conditionalExpression(GroovyRecognizer.java:3861)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.assignmentExpression(GroovyRecognizer.java:8672)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expression(GroovyRecognizer.java:6369)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatement(GroovyRecognizer.java:7157)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1051)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit(GroovyRecognizer.java:655)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:79)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:297)
at org.codehaus.groovy.control.CompilationUnit$3.call(CompilationUnit.java:352)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:594)
at org.codehaus.groovy.control.CompilationUnit.parse(CompilationUnit.java:343)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:313)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:237)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:206)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:156)
at groovy.lang.GroovyShell$1.run(GroovyShell.java:261)
at java.security.AccessController.doPrivileged(Native Method)
at groovy.lang.GroovyShell.run(GroovyShell.java:259)
at groovy.lang.GroovyShell.run(GroovyShell.java:202)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:397)
at groovy.ui.GroovyMain.run(GroovyMain.java:233)
at groovy.ui.GroovyMain.process(GroovyMain.java:219)
at groovy.ui.GroovyMain.main(GroovyMain.java:123)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:429)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)