From ba8a2fbc52ccc78ebf046924677d553cfd555601 Mon Sep 17 00:00:00 2001
From: William S Fulton
@@ -3796,7 +3797,7 @@ When arrays are used in functions like populate, the size of the C arra
Please be aware that the typemaps in this library are not efficient as all the elements are copied from the Java array to a C array whenever the array is passed to and from JNI code. -There is an alternative approach using the SWIG array library and this is covered in the next. +There is an alternative approach using the SWIG array library and this is covered in the next section.
%typemap(check) int * %{
if (error) {
- SWIG_exception(SWIG_IndexError, "Array element error");
+ SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array element error");
return $null;
}
%}
@@ -4513,7 +4514,7 @@ If the typemap gets put into a function with void as return, $null will expand t
JNIEXPORT void JNICALL Java_jnifn(...) {
if (error) {
- SWIG_exception(SWIG_IndexError, "Array element error");
+ SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array element error");
return ;
}
...
@@ -4527,7 +4528,7 @@ otherwise $null expands to NULL
JNIEXPORT jobject JNICALL Java_jnifn(...) {
if (error) {
- SWIG_exception(SWIG_IndexError, "Array element error");
+ SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array element error");
return NULL;
}
...