diff --git a/CHANGES.current b/CHANGES.current index 570b0473f..92b882c4c 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,10 @@ Version 1.3.41 (in progress) ============================ +2009-12-23: wsfulton + Fix for %javaexception and directors so that all the appropriate throws clauses + are generated. Problem reported by Peter Greenwood. + 2009-12-20: wsfulton Add -debug-tmsearch option for debugging the typemap pattern matching rules. Documented in Typemaps.html. diff --git a/Examples/test-suite/java/java_director_runme.java b/Examples/test-suite/java/java_director_runme.java index dffba0ea5..86c92d49a 100644 --- a/Examples/test-suite/java/java_director_runme.java +++ b/Examples/test-suite/java/java_director_runme.java @@ -34,6 +34,12 @@ public class java_director_runme { System.gc(); System.runFinalization(); + // Give the finalizers a chance to run + try { + Thread.sleep(50); + } catch (InterruptedException e) { + } + /* Watch the Quux objects formerly in the QuuxContainer object get reaped */ System.gc(); @@ -73,3 +79,14 @@ class java_director_MyQuux extends Quux { return "java_director_MyQuux:" + member(); } } + +class java_director_JavaExceptionTest extends JavaExceptionTest { + public java_director_JavaExceptionTest() { + super(); + } + + public void etest() throws Exception { + super.etest(); + } +} + diff --git a/Examples/test-suite/java_director.i b/Examples/test-suite/java_director.i index 04d55e196..03d733d6a 100644 --- a/Examples/test-suite/java_director.i +++ b/Examples/test-suite/java_director.i @@ -122,3 +122,11 @@ struct JObjectTest { %} +%javaexception("Exception") etest "$action" +%inline %{ +struct JavaExceptionTest { + virtual ~JavaExceptionTest() {} + virtual void etest() {} +}; +%} + diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 7fccab5e1..bef41b0d2 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -3724,6 +3724,9 @@ public: String *upcall = NewStringf("self.%s(%s)", symname, imcall_args); + // Handle exception classes specified in the "except" feature's "throws" attribute + addThrows(n, "feature:except", n); + if (!is_void) { Parm *tp = NewParmFromNode(returntype, empty_str, n);