Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-2
-
None
-
Windows, Java 1.5.0_03
Description
If I create a Java class which contains a field declared as:
int[][] x;
then pass an object to groovy and ask it to execute:
println (the object).x[0]
it throws:
Exception in thread "main" java.lang.ClassFormatError: Illegal class name "gjdk/[I_GroovyReflectorArray" in class file gjdk/[I_GroovyReflectorArray
Printing just (the object).x works fine.
The full code which reproduces this error is:
bug4.groovy:
class bug4 {
def bubbles(a)
}
bug4j.java:
import groovy.lang.*;
import java.io.*;
import org.codehaus.groovy.control.CompilationFailedException;
public class bug4j {
public int[][] x;
void ricky() throws CompilationFailedException, InstantiationException,
IOException, IllegalAccessException {
x = new int[][]
;
// Create the groovy object
ClassLoader parent = getClass().getClassLoader();
GroovyClassLoader loader = new GroovyClassLoader(parent);
Class groovyClass = loader.parseClass(new File("bug4.groovy"));
GroovyObject bug4 = (GroovyObject) groovyClass.newInstance();
Object[] args =
{this};
bug4.invokeMethod("bubbles", args);
}
public static void main(String[] args) throws CompilationFailedException,
InstantiationException, IOException, IllegalAccessException
}
Attachments
Issue Links
- is duplicated by
-
GROOVY-1092 Multidimensional arrays are broken
- Closed