@@ -98,6 +98,14 @@ public void setActivity(Statement st)
9898
9999 public void setResultType (Type t )
100100 { resultType = t ; }
101+
102+ public boolean hasReturnVariable ()
103+ { if (resultType == null )
104+ { return false ; }
105+ if ("void" .equals (resultType + "" ))
106+ { return false ; }
107+ return true ;
108+ }
101109
102110 public String cg (CGSpec cgs )
103111 { String etext = this + "" ;
@@ -1212,7 +1220,7 @@ public String genQueryCode(Entity ent, Vector cons)
12121220 if (isClassScope () || isStatic ())
12131221 { res = res + "static " ; }
12141222
1215- if (resultType == null )
1223+ if (resultType == null || "void" . equals ( resultType + "" ) )
12161224 { JOptionPane .showMessageDialog (null , "ERROR: null result type for: " + this ,
12171225 "Type error" , JOptionPane .ERROR_MESSAGE );
12181226 return "" ;
@@ -1257,7 +1265,7 @@ public String genQueryCodeJava6(Entity ent, Vector cons)
12571265 if (isClassScope () || isStatic ())
12581266 { res = res + "static " ; }
12591267
1260- if (resultType == null )
1268+ if (resultType == null || "void" . equals ( resultType + "" ) )
12611269 { JOptionPane .showMessageDialog (null , "ERROR: null result type for: " + this ,
12621270 "Type error" , JOptionPane .ERROR_MESSAGE );
12631271 return "" ;
@@ -1303,7 +1311,7 @@ public String genQueryCodeJava7(Entity ent, Vector cons)
13031311 if (isClassScope () || isStatic ())
13041312 { res = res + "static " ; }
13051313
1306- if (resultType == null )
1314+ if (resultType == null || "void" . equals ( resultType + "" ) )
13071315 { JOptionPane .showMessageDialog (null , "ERROR: null result type for: " + this ,
13081316 "Type error" , JOptionPane .ERROR_MESSAGE );
13091317 return "" ;
@@ -1349,7 +1357,7 @@ public String genQueryCodeCSharp(Entity ent, Vector cons)
13491357 if (isClassScope () || isStatic ())
13501358 { res = res + "static " ; }
13511359
1352- if (resultType == null )
1360+ if (resultType == null || "void" . equals ( resultType + "" ) )
13531361 { JOptionPane .showMessageDialog (null , "ERROR: null result type for: " + this ,
13541362 "Type error" , JOptionPane .ERROR_MESSAGE );
13551363 return "" ;
@@ -1395,7 +1403,7 @@ public String genQueryCodeCPP(Entity ent, Vector cons)
13951403 // if (isClassScope() || isStatic())
13961404 // { res = res + "static "; }
13971405
1398- if (resultType == null )
1406+ if (resultType == null || "void" . equals ( resultType + "" ) )
13991407 { JOptionPane .showMessageDialog (null , "ERROR: null result type for: " + this ,
14001408 "Type error" , JOptionPane .ERROR_MESSAGE );
14011409 return "" ;
@@ -2134,7 +2142,7 @@ public String getOperationCode(Entity ent, Vector entities, Vector types)
21342142 if (ent .isInterface ())
21352143 { return " public " + ts + " " + name + "(" + pars + ");\n " ; }
21362144
2137- if (tp != null )
2145+ if (tp != null && ! "void" . equals ( ts ) )
21382146 { res = res + ts + " result;\n " ; }
21392147 localatts .addAll (parameters );
21402148 cde .typeCheck (types ,entities ,context ,localatts );
@@ -2173,7 +2181,7 @@ else if (activity != null)
21732181
21742182 res = " public " + header + ts + " " + name + "(" + pars + ")\n { " ;
21752183
2176- if (tp != null )
2184+ if (tp != null && ! "void" . equals ( ts ) )
21772185 { res = res + ts + " result;\n " ; }
21782186 localatts .addAll (parameters );
21792187
@@ -2309,7 +2317,7 @@ public String getOperationCodeJava6(Entity ent, Vector entities, Vector types)
23092317 if (ent != null && ent .isInterface ())
23102318 { return " public " + ts + " " + name + "(" + pars + ");\n " ; }
23112319
2312- if (tp != null )
2320+ if (tp != null && ! "void" . equals ( ts ) )
23132321 { res = res + ts + " result;\n " ; }
23142322 localatts .addAll (parameters );
23152323 cde .typeCheck (types ,entities ,context ,localatts );
@@ -2348,8 +2356,9 @@ else if (activity != null)
23482356
23492357 res = " public " + header + ts + " " + name + "(" + pars + ")\n { " ;
23502358
2351- if (tp != null )
2359+ if (tp != null && !( "void" . equals ( ts )) )
23522360 { res = res + ts + " result;\n " ; }
2361+
23532362 localatts .addAll (parameters );
23542363 Vector preterms = activity .allPreTerms ();
23552364 if (preterms .size () > 0 )
@@ -2955,7 +2964,7 @@ public String getOperationCodeCPP(Entity ent, Vector entities, Vector types, Vec
29552964 public String buildQueryOp (Entity ent , String opname ,
29562965 Type t , String resT ,
29572966 Vector entities , Vector types )
2958- { if (resultType == null )
2967+ { if (resultType == null || "void" . equals ( resT ) )
29592968 { System .err .println ("ERROR: No result type for " + opname );
29602969 return "" ;
29612970 }
@@ -3130,7 +3139,7 @@ public String buildQueryOp(Entity ent, String opname,
31303139 public String buildQueryOpJava6 (Entity ent , String opname ,
31313140 Type t , String resT ,
31323141 Vector entities , Vector types )
3133- { if (resultType == null )
3142+ { if (resultType == null || "void" . equals ( resT ) )
31343143 { System .err .println ("ERROR: No result type for " + opname );
31353144 return "" ;
31363145 }
@@ -3242,7 +3251,7 @@ public String buildQueryOpJava7(Entity ent, String opname,
32423251 Type t , String resT ,
32433252 Vector entities , Vector types )
32443253 {
3245- if (resultType == null )
3254+ if (resultType == null || "void" . equals ( resultType + "" ) )
32463255 { System .err .println ("ERROR: No result type for " + opname );
32473256 return "" ;
32483257 }
@@ -3348,7 +3357,7 @@ public String buildQueryOpJava7(Entity ent, String opname,
33483357 public String buildQueryOpCSharp (Entity ent , String opname ,
33493358 Type t , String resT ,
33503359 Vector entities , Vector types )
3351- { if (resultType == null )
3360+ { if (resultType == null || "void" . equals ( resultType + "" ) )
33523361 { System .err .println ("ERROR: No result type for " + opname );
33533362 return "" ;
33543363 }
@@ -3460,7 +3469,7 @@ public String buildQueryOpCSharp(Entity ent, String opname,
34603469 public String buildQueryOpCPP (Entity ent , String opname ,
34613470 Type t , String resT ,
34623471 Vector entities , Vector types , Vector decs )
3463- { if (resultType == null )
3472+ { if (resultType == null || "void" . equals ( resultType + "" ) )
34643473 { System .err .println ("ERROR: No result type for " + opname );
34653474 return "" ;
34663475 }
@@ -4384,6 +4393,8 @@ public String buildUpdateOp(Entity ent, String opname,
43844393 { String preheader = "" ;
43854394 String javaPars = getJavaParameterDec ();
43864395
4396+ System .out .println (">>> Building update op for " + opname + " : " + t + " >> " + resT );
4397+
43874398 String header = " public " ;
43884399 if (isAbstract ())
43894400 { header = header + "abstract " ; }
0 commit comments