List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:December 9 2007 10:26pm
Subject:Rev 354: Fixes to SWIG to add in Override and SuppressWarnings in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 354
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Sun 2007-12-09 16:25:41 -0600
message:
  Fixes to SWIG to add in Override and SuppressWarnings
modified:
  swig/SWIG/Lib/java/enumtypesafe.swg enumtypesafe.swg-20071104211339-fod7yzi8t7xd3g0w-911
  swig/SWIG/Lib/java/java.swg    java.swg-20071104211339-fod7yzi8t7xd3g0w-913
  swig/SWIG/Source/Modules/java.cxx java.cxx-20071104211339-fod7yzi8t7xd3g0w-1275
  swig/update_from_swigsvn.sh    update_from_swigsvn.-20071104211339-fod7yzi8t7xd3g0w-5
=== modified file 'swig/SWIG/Lib/java/enumtypesafe.swg'
--- a/swig/SWIG/Lib/java/enumtypesafe.swg	2007-12-05 06:37:22 +0000
+++ b/swig/SWIG/Lib/java/enumtypesafe.swg	2007-12-09 22:25:41 +0000
@@ -81,6 +81,7 @@
     return swigValue;
   }
 
+  @Override
   public String toString() {
     return swigName;
   }

=== modified file 'swig/SWIG/Lib/java/java.swg'
--- a/swig/SWIG/Lib/java/java.swg	2007-11-04 21:32:20 +0000
+++ b/swig/SWIG/Lib/java/java.swg	2007-12-09 22:25:41 +0000
@@ -1094,6 +1094,7 @@
 %}
 
 %typemap(javafinalize) SWIGTYPE %{
+  $javaoverride
   protected void finalize() {
     delete();
   }
@@ -1141,7 +1142,8 @@
     swigCPtr = 0;
   }
 
-%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public
synchronized") SWIGTYPE {
+%typemap(javadestruct_derived, methodname="delete", methodmodifiers="@Override
+  public synchronized") SWIGTYPE {
     if(swigCPtr != 0 && swigCMemOwn) {
       swigCMemOwn = false;
       $jnicall;

=== modified file 'swig/SWIG/Source/Modules/java.cxx'
--- a/swig/SWIG/Source/Modules/java.cxx	2007-12-05 06:37:22 +0000
+++ b/swig/SWIG/Source/Modules/java.cxx	2007-12-09 22:25:41 +0000
@@ -252,8 +252,9 @@
 
     // Add a symbol to the parser for conditional compilation
     Preprocessor_define("SWIGJAVA 1", 0);
-    Preprocessor_define("USEJAVA5 1", 0);
-
+    if (use_java5) { 
+      Preprocessor_define("USEJAVA5 1", 0);
+    }
     // Add typemap definitions
     SWIG_typemap_lang("java");
     SWIG_config_file("java.swg");
@@ -1202,8 +1203,10 @@
 
         if (use_java5) { 
 	  Replaceall(enum_code, "$suppresswarnings", "@SuppressWarnings(\"unused\")"); 
+	  Replaceall(enum_code, "$javaoverride", "@Override");
         } else { 
           Replaceall(enum_code, "$suppresswarnings", "");
+	  Replaceall(enum_code, "$javaoverride", "");
         }
 	Replaceall(enum_code, "$javaclassname", symname);
 
@@ -1695,9 +1698,13 @@
     if (use_java5) {
       Replaceall(proxy_class_code, "$suppresswarnings", "@SuppressWarnings(\"unused\")");
       Replaceall(proxy_class_def, "$suppresswarnings", "@SuppressWarnings(\"unused\")");
+      Replaceall(proxy_class_code, "$javaoverride", "@Override");
+      Replaceall(proxy_class_def, "$javaoverride", "@Override");
     } else {
       Replaceall(proxy_class_code, "$suppresswarnings", "");
       Replaceall(proxy_class_def, "$suppresswarnings", "");
+      Replaceall(proxy_class_code, "$javaoverride", "");
+      Replaceall(proxy_class_def, "$javaoverride", "");
     }
 
     Replaceall(proxy_class_code, "$javaclassname", proxy_class_name);
@@ -2842,8 +2849,10 @@
 
         if (use_java5) { 
 	  Replaceall(swigtype, "$suppresswarnings", "@SuppressWarnings(\"unused\")"); 
+	  Replaceall(swigtype, "$javaoverride", "@Override");
         } else { 
           Replaceall(swigtype, "$suppresswarnings", "");
+	  Replaceall(swigtype, "$javaoverride", "");
         }
     Replaceall(swigtype, "$javaclassname", classname);
     Replaceall(swigtype, "$module", module_class_name);
@@ -4133,6 +4142,6 @@
      -noproxy        - Generate the low-level functional interface instead\n\
                        of proxy classes\n\
      -oldvarnames    - old intermediary method names for variable wrappers\n\
-     -usejava5          - Enable use of newer Java5 constructs\n\
+     -usejava5       - Enable use of newer Java5 constructs\n\
      -package <name> - set name of the Java package to <name>\n\
 \n";

=== modified file 'swig/update_from_swigsvn.sh'
--- a/swig/update_from_swigsvn.sh	2007-12-06 09:25:04 +0000
+++ b/swig/update_from_swigsvn.sh	2007-12-09 22:25:41 +0000
@@ -5,6 +5,11 @@
 bzr diff -r324..325 SWIG/Lib/java/enums.swg >> SWIG.patch
 bzr diff -r324..328 SWIG/Lib/java/enumtypesafe.swg >> SWIG.patch
 bzr diff -r324..328 SWIG/Source/Modules/java.cxx >> SWIG.patch
+bzr diff -r352..353 SWIG/Source/Makefile.am >> SWIG.patch 
+bzr diff -r353..354 SWIG/Lib/java/enumtypesafe.swg >> SWIG.patch
+bzr diff -r353..354 SWIG/Source/Modules/java.cxx >> SWIG.patch
+bzr diff -r353..354 SWIG/Lib/java/java.swg >> SWIG.patch
+
 rm -rf SWIG
 svn export https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-1.3.33 SWIG
 rm SWIG/Tools/config/config.guess SWIG/Tools/config/config.sub

Thread
Rev 354: Fixes to SWIG to add in Override and SuppressWarnings in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/develMonty Taylor9 Dec