diff --git a/Lib/csharp/enums.swg b/Lib/csharp/enums.swg index 8878b2b3b..955bc3845 100644 --- a/Lib/csharp/enums.swg +++ b/Lib/csharp/enums.swg @@ -12,9 +12,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown"); -} +%} %typemap(csin) enum SWIGTYPE "(int)$csinput" %typemap(csout) enum SWIGTYPE { diff --git a/Lib/csharp/enumsimple.swg b/Lib/csharp/enumsimple.swg index 23cc67433..b65a42a8e 100644 --- a/Lib/csharp/enumsimple.swg +++ b/Lib/csharp/enumsimple.swg @@ -14,9 +14,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown"); -} +%} %typemap(csin) enum SWIGTYPE "$csinput" %typemap(csout) enum SWIGTYPE { diff --git a/Lib/java/enumsimple.swg b/Lib/java/enumsimple.swg index 257cfa8e2..983812293 100644 --- a/Lib/java/enumsimple.swg +++ b/Lib/java/enumsimple.swg @@ -18,14 +18,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); -} +%} %typemap(javain) enum SWIGTYPE "$javainput" %typemap(javaout) enum SWIGTYPE { diff --git a/Lib/java/enumtypeunsafe.swg b/Lib/java/enumtypeunsafe.swg index c5c1cfb43..8487e7d93 100644 --- a/Lib/java/enumtypeunsafe.swg +++ b/Lib/java/enumtypeunsafe.swg @@ -18,14 +18,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); -} +%} %typemap(javain) enum SWIGTYPE "$javainput" %typemap(javaout) enum SWIGTYPE { @@ -33,7 +28,7 @@ } // '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public $static class" +%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" %typemap(javagetcptr) enum SWIGTYPE "" %javaenum(typeunsafe);