]> OCCT Git - occt-wok.git/commitdiff
5082,5083 Some corrections and improvements in WOK Java extractor.cdl,cxx,h,java...
authorcascade <cascade@opencascade.com>
Mon, 9 Feb 2004 11:22:16 +0000 (11:22 +0000)
committercascade <cascade@opencascade.com>
Mon, 9 Feb 2004 11:22:16 +0000 (11:22 +0000)
src/CPPJini/CPPJini_Template.edl

index bc975abee6c6ee592bca3324cc2dd2e162ca6885..053850a8922bc61a128c0d641f4120fc10ea550e 100755 (executable)
@@ -23,9 +23,9 @@ $
 $
 $package %Interface;
 $
-$import jcas.Object;
+$import jcas.Transient;
 $
-$public class Standard_Transient extends jcas.Object {
+$public class Standard_Transient extends jcas.Transient {
 $
 $ static {
 $    System.loadLibrary("%LibName");
@@ -363,8 +363,12 @@ $
 $%ClassName* the_%ArgName = (%ClassName*) jcas_GetHandle(env,%ArgName);
 $if ( the_%ArgName == NULL ) {
 $
-$ the_%ArgName = new %ClassName ();
-$ jcas_SetHandle ( env, %ArgName, the_%ArgName );
+$ // The following assumes availability of the default constructor (what may not
+$ // always be the case). Therefore explicit exception is thrown if the null
+$ // object has been passed.
+$ // the_%ArgName = new %ClassName ();
+$ // jcas_SetHandle ( env, %ArgName, the_%ArgName );
+$ jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
 $
 $}  // end if
 @end;