|
@@ -4227,8 +4227,16 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
|
4227
|
4227
|
} else {
|
4228
|
4228
|
getJavaWriter().invokeVirtual(methodInfo);
|
4229
|
4229
|
}
|
4230
|
|
- if (methodInfo.genericResult)
|
|
4230
|
+ if (methodInfo.genericResult) {
|
4231
|
4231
|
getJavaWriter().checkCast(context.getInternalName(resultType));
|
|
4232
|
+ }
|
|
4233
|
+
|
|
4234
|
+ //Make sure that method results are popped if ZC thinks its a void but it actually is not.
|
|
4235
|
+ //Fixes an issue for List#add() returning void in ZC but Z in Java.
|
|
4236
|
+ if(resultType.type == BasicTypeID.VOID && !methodInfo.descriptor.endsWith(")V")) {
|
|
4237
|
+ final boolean isLarge = methodInfo.descriptor.endsWith(")D") && methodInfo.descriptor.endsWith(")L");
|
|
4238
|
+ getJavaWriter().pop(isLarge);
|
|
4239
|
+ }
|
4232
|
4240
|
|
4233
|
4241
|
return true;
|
4234
|
4242
|
}
|