|
@@ -23,7 +23,10 @@ import org.openzen.zenscript.javashared.*;
|
23
|
23
|
import java.io.FileOutputStream;
|
24
|
24
|
import java.io.IOException;
|
25
|
25
|
import java.lang.reflect.Modifier;
|
26
|
|
-import java.util.*;
|
|
26
|
+import java.util.Arrays;
|
|
27
|
+import java.util.Comparator;
|
|
28
|
+import java.util.Objects;
|
|
29
|
+import java.util.StringJoiner;
|
27
|
30
|
|
28
|
31
|
public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativeTranslator<Void> {
|
29
|
32
|
private static final JavaMethod BOOLEAN_PARSE = JavaMethod.getNativeStatic(JavaClass.BOOLEAN, "parseBoolean", "(Ljava/lang/String;)Z");
|
|
@@ -374,12 +377,12 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
|
374
|
377
|
BuiltinID builtin = expression.member.getBuiltin();
|
375
|
378
|
if (builtin == null) {
|
376
|
379
|
expression.target.accept(this);
|
377
|
|
-
|
|
380
|
+
|
378
|
381
|
JavaMethod methodInfo = context.getJavaMethod(expression.member);
|
379
|
382
|
for (int i = 0; i < expression.arguments.typeArguments.length; i++) {
|
380
|
383
|
if (methodInfo.typeParameterArguments[i]) {
|
381
|
384
|
StoredType arguments = expression.arguments.typeArguments[i];
|
382
|
|
-
|
|
385
|
+
|
383
|
386
|
}
|
384
|
387
|
}
|
385
|
388
|
for (Expression argument : expression.arguments.arguments) {
|
|
@@ -3982,13 +3985,14 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
|
3982
|
3985
|
if (methodInfo == null)
|
3983
|
3986
|
return false;
|
3984
|
3987
|
|
3985
|
|
- if (methodInfo.kind == JavaMethod.Kind.STATIC) {
|
|
3988
|
+ if (methodInfo.kind == JavaMethod.Kind.STATIC)
|
3986
|
3989
|
getJavaWriter().invokeStatic(methodInfo);
|
3987
|
|
- } else if (methodInfo.kind == JavaMethod.Kind.COMPILED) {
|
|
3990
|
+ else if (methodInfo.kind == JavaMethod.Kind.COMPILED)
|
3988
|
3991
|
Objects.requireNonNull(methodInfo.translation).translate(expression, this);
|
3989
|
|
- } else {
|
|
3992
|
+ else if (methodInfo.cls.kind == JavaClass.Kind.INTERFACE)
|
|
3993
|
+ getJavaWriter().invokeInterface(methodInfo);
|
|
3994
|
+ else
|
3990
|
3995
|
getJavaWriter().invokeVirtual(methodInfo);
|
3991
|
|
- }
|
3992
|
3996
|
if (methodInfo.genericResult)
|
3993
|
3997
|
getJavaWriter().checkCast(context.getInternalName(resultType));
|
3994
|
3998
|
|