diff --git a/Lib/java/director.swg b/Lib/java/director.swg index 8226773dd..416361c27 100644 --- a/Lib/java/director.swg +++ b/Lib/java/director.swg @@ -403,6 +403,7 @@ namespace Swig { }; // Helper method to determine if a Java throwable matches a particular Java class type + // Note side effect of clearing any pending exceptions SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) { bool matches = false; diff --git a/Lib/java/java.swg b/Lib/java/java.swg index 809fc40a3..184ee56aa 100644 --- a/Lib/java/java.swg +++ b/Lib/java/java.swg @@ -1051,11 +1051,15 @@ Swig::LocalRefGuard $1_refguard(jenv, $input); } %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1); return $null; %} -// For directors to raise/throw the original Java exception +/* For methods to raise/throw the original Java exception thrown in a director method */ %typemap(throws) Swig::DirectorException %{ $1.raiseJavaException(jenv); return $null; %} +/* Java to C++ DirectorException should already be handled. Suppress warning and do nothing in the + event a user specifies a global: %catches(Swig::DirectorException); */ +%typemap(directorthrows) Swig::DirectorException "" + /* Typemaps for code generation in proxy classes and Java type wrapper classes */ /* The javain typemap is used for converting function parameter types from the type