From e2d6865cc3a2a8ae31f588e5a96b82ce234543dc Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 4 Jun 2004 23:19:44 +0000 Subject: [PATCH] Correct changes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5977 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/java_typemaps_proxy.i | 18 ++++++++++++++++-- .../test-suite/java_typemaps_typewrapper.i | 8 +++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Examples/test-suite/java_typemaps_proxy.i b/Examples/test-suite/java_typemaps_proxy.i index 94d4cb9d2..4de7fa0b4 100644 --- a/Examples/test-suite/java_typemaps_proxy.i +++ b/Examples/test-suite/java_typemaps_proxy.i @@ -29,17 +29,31 @@ import java.lang.*; // for Exception %} // Create a new getCPtr() function which takes Java null and is public -// Make the pointer constructor public %typemap(javabody) NS::Greeting %{ private long swigCPtr; protected boolean swigCMemOwn; + protected $javaclassname(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + public static long getCPtr($javaclassname obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } +%} + +// Make the pointer constructor public +%typemap(javabody) NS::Farewell %{ + private long swigCPtr; + protected boolean swigCMemOwn; + public $javaclassname(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr($javaclassname obj) { + protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} diff --git a/Examples/test-suite/java_typemaps_typewrapper.i b/Examples/test-suite/java_typemaps_typewrapper.i index ebd82d50c..018767271 100644 --- a/Examples/test-suite/java_typemaps_typewrapper.i +++ b/Examples/test-suite/java_typemaps_typewrapper.i @@ -39,13 +39,15 @@ import java.lang.*; // for Exception // Make the pointer constructor public %typemap(javabody) Farewell * %{ private long swigCPtr; - protected boolean swigCMemOwn; - public $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; + public $javaclassname(long cPtr, boolean bFutureUse) { swigCPtr = cPtr; } + protected $javaclassname() { + swigCPtr = 0; + } + public static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; }