diff --git a/Lib/java/arrays_java.i b/Lib/java/arrays_java.i index 696dcab08..fedc8743c 100644 --- a/Lib/java/arrays_java.i +++ b/Lib/java/arrays_java.i @@ -1,7 +1,8 @@ /* arrays_java.i * These typemaps give more natural support for arrays. The typemaps are not efficient * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from Java and visa versa. + * from Java and visa versa. The Java array is expected to be the same size as the C array. + * An exception is thrown if they are not. Example usage: Wrapping: @@ -63,8 +64,7 @@ int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNI void SWIG_JavaArrayArgout##JFUNCNAME (JNIEnv *jenv, JNITYPE *jarr, CTYPE *carr, JNITYPE##Array input) { int i; - jsize sz; - sz = JCALL1(GetArrayLength, jenv, input); + jsize sz = JCALL1(GetArrayLength, jenv, input); for (i=0; i