#956 feature "except" disable not working as expected

java (79)

I'm having problems interpreting section 11.3.3 of the manual, but I believe this is a bug. What I want to do is set a global exception specification, but disable it for toString and compareTo which disallow exceptions in the override.

I understand that the difference between clearing and disabling a feature is that clearing it falls back to any previous/more general description, while disabling it turns it off completely. I note that that (in 1.3.36) the macro for %nojavaexceptions clears the feature rather than disables it.

Based on that understanding, I would expect the following to work; it fails in the way described in the comments.

swig -module bogus -c++ -java myclass.cc \ && grep public MyClass.java MyClassToo.java


MyClass.java:public class MyClass {
MyClass.java: public synchronized void delete() {
MyClass.java: public int doit() throws Wildcard {
MyClass.java: public int throwit() throws throwit {
MyClass.java: public MyClass() throws Wildcard {
MyClassToo.java:public class MyClassToo {
MyClassToo.java: public synchronized void delete() {
MyClassToo.java: public int doit() throws Wildcard {
MyClassToo.java: public int throwit() throws {
MyClassToo.java: public MyClassToo() throws Wildcard {


  • Peter A. Bigot

    Peter A. Bigot - 2008-10-08

    Source file referenced in example

  • William Fulton

    William Fulton - 2008-12-23
    • status: open --> closed-fixed
  • William Fulton

    William Fulton - 2008-12-23

    Yes %nojavaexception was clearing the exception instead of disabling the exception. Fixed for 1.3.37... added in %clearjavaexception too and fixed clearing of java checked exceptions. There is also a bit more documentation on clearing/disabling features.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks