[kaffe] Bug Report: jni & two dimensional array parameter

Daniel Dittmann ddittmann@gmx.de
Tue Sep 23 23:53:03 2003


This is a multi-part message in MIME format.
--------------080606040208040200030000
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

i want to call an jni-function with an two-dimensional integer-array 
parameter.

The complete example from:

http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jnistring.html#multi


public class ArrayManipulation {

***snip***
public native void manipulateArray(
         int[][] multiplier, Boolean lock);
***snip***

}


The generation of the c-headerfile failed.

 >/usr/local/kaffe/bin/javac ArrayManipulation.java
 >export CLASSPATH=./:/usr/local/kaffe/jre/lib/rt.jar
 >/usr/local/kaffe/bin/javah ArrayManipulation
bogus array type `['


The attached patch fixed this error.


Thank you
Daniel

--------------080606040208040200030000
Content-Type: text/plain;
 name="kaffe_jni_sign.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="kaffe_jni_sign.diff"

diff -Naur kaffe/kaffe/kaffeh/support.c kaffe.patched/kaffe/kaffeh/support.c
--- kaffe/kaffe/kaffeh/support.c	2003-09-19 10:51:56.000000000 +0200
+++ kaffe.patched/kaffe/kaffeh/support.c	2003-08-01 00:46:45.000000000 +0200
@@ -311,6 +311,7 @@
 		case 'D':
 			return "jdoubleArray";
 		case 'L':
+		case '[':
 			return "jobjectArray";
 		default:
 			dprintf("bogus array type `%c'", sig[1]);

--------------080606040208040200030000--