diff --git a/CHANGES.current b/CHANGES.current index 7d7779fd9..6e480cc47 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,21 @@ Version 1.3.30 (in progress) ============================ +10/12/2006: wsfulton + [Java] Remove potential race condition on the proxy class' delete() method + (it is now a synchronized method, but is now customisable by changing the + methodmodifier attribute in the the javadestruct or javadestruct_derived typemap) + + *** POTENTIAL INCOMPATIBILITY *** + +10/12/2006: wsfulton + [Ruby, Python] Remove redundant director code in %extend methods (%extend + methods cannot be director methods) + +10/12/2006: wsfulton + [Ruby, Python] Fix #1505594 - director objects not returned as director objects + in %extend methods. + 10/11/2006: wsfulton [Java] Fix #1238798 - Directors using unsigned long long or any other type marshalled across the JNI boundary using a Java class (where the jni typemap diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html index f7214382e..2083674ec 100644 --- a/Doc/Manual/Java.html +++ b/Doc/Manual/Java.html @@ -4816,7 +4816,7 @@ class modifiers for the Java class: default is "public class" Java code is copied verbatim to the Java class: empty default -
%typemap(javadestruct, methodname="delete")
%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized")
%typemap(javadestruct_derived, methodname="delete")
+%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized")
%typemap(javaimports)
@@ -4867,7 +4869,7 @@ In summary the contents of the typemaps make up a proxy class like this: implements [ javainterfaces typemap ] { [ javabody or javabody_derived typemap ] [ javafinalize typemap ] -public void delete() [ javadestruct OR javadestruct_derived typemap ] +public synchronized void delete() [ javadestruct OR javadestruct_derived typemap ] [ javacode typemap ] ... proxy functions ... } @@ -4875,7 +4877,7 @@ public void delete() [ javadestruct OR javadestruct_derived typemap ]-Note the delete() methodname is configurable, see "javadestruct" and "javadestruct_derived" typemaps above. +Note the delete() methodname and method modifiers are configurable, see "javadestruct" and "javadestruct_derived" typemaps above.
diff --git a/Lib/java/java.swg b/Lib/java/java.swg index cc65eaebd..5d0dccc62 100644 --- a/Lib/java/java.swg +++ b/Lib/java/java.swg @@ -1133,7 +1133,7 @@ SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME) // Set the default for SWIGTYPE: Java owns the C/C++ object. SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) -%typemap(javadestruct, methodname="delete") SWIGTYPE { +%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE { if(swigCPtr != 0 && swigCMemOwn) { swigCMemOwn = false; $jnicall; @@ -1141,7 +1141,7 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) swigCPtr = 0; } -%typemap(javadestruct_derived, methodname="delete") SWIGTYPE { +%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE { if(swigCPtr != 0 && swigCMemOwn) { swigCMemOwn = false; $jnicall; diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 90daea5a2..8706553da 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -1595,17 +1595,24 @@ class JAVA : public Language { const String *tm = NULL; Node *attributes = NewHash(); String *destruct_methodname = NULL; + String *destruct_methodmodifiers = NULL; if (derived) { tm = typemapLookup("javadestruct_derived", typemap_lookup_type, WARN_NONE, attributes); destruct_methodname = Getattr(attributes, "tmap:javadestruct_derived:methodname"); + destruct_methodmodifiers = Getattr(attributes, "tmap:javadestruct_derived:methodmodifiers"); } else { tm = typemapLookup("javadestruct", typemap_lookup_type, WARN_NONE, attributes); destruct_methodname = Getattr(attributes, "tmap:javadestruct:methodname"); + destruct_methodmodifiers = Getattr(attributes, "tmap:javadestruct:methodmodifiers"); } if (!destruct_methodname) { Swig_error(input_file, line_number, "No methodname attribute defined in javadestruct%s typemap for %s\n", (derived ? "_derived" : ""), proxy_class_name); } + if (!destruct_methodmodifiers) { + Swig_error(input_file, line_number, + "No methodmodifier attribute defined in javadestruct%s typemap for %s.\n", (derived ? "_derived" : ""), proxy_class_name); + } // Emit the finalize and delete methods if (tm) { @@ -1622,7 +1629,7 @@ class JAVA : public Language { else Replaceall(destruct, "$jnicall", "throw new UnsupportedOperationException(\"C++ destructor does not have public access\")"); if (*Char(destruct)) - Printv(proxy_class_def, "\n ", "public void ", destruct_methodname, "() ", destruct, "\n", NIL); + Printv(proxy_class_def, "\n ", destruct_methodmodifiers, " void ", destruct_methodname, "() ", destruct, "\n", NIL); } /* Insert directordisconnect typemap, if this class has directors enabled */