Add feature director:except for improved director exception handling in Java

Closes #91
This commit is contained in:
Marvin Greenberg 2013-10-22 20:31:14 +01:00 • committed by William S Fulton
commit 6736e74127
12 changed files with 1469 additions and 51 deletions

View file

@ -41,6 +41,29 @@ class DirectorMethodException: public Swig::DirectorException {};
#endif
#ifdef SWIGJAVA
// Default for director exception warns about unmapped exceptions now in java
// Suppress warnings for this older test
// %warnfilter(476) Bar;
// Default for java is to throw Swig::DirectorException if no
// direct:except feature. Since methods below have exception specification
// cannot throw director exception.
// Change back to old 2.0 default behavior
%feature("director:except") {
jthrowable $error = jenv->ExceptionOccurred();
if ($error) {
// Dont clear exception, still be active when return to java execution
// Essentially ignore exception occurred -- old behavior.
return $null;
}
}
#endif
#ifdef SWIGRUBY
%feature("director:except") {