diff --git a/Examples/java/typemap/example.i b/Examples/java/typemap/example.i index a29c717d9..7c97e6673 100644 --- a/Examples/java/typemap/example.i +++ b/Examples/java/typemap/example.i @@ -62,7 +62,7 @@ void f2(char *BYTE); /* Take a copy of the C string as the typemap is for a non const C string */ jmethodID capacityID = (*jenv)->GetMethodID(jenv, sbufClass, "capacity", "()I"); - jint capacity = (jint) (*jenv)->CallObjectMethod(jenv, $input, capacityID); + jint capacity = (*jenv)->CallIntMethod(jenv, $input, capacityID); $1 = (char *) malloc(capacity+1); strcpy($1, pCharStr);