|
@@ -9,7 +9,6 @@ import org.openzen.zenscript.javashared.JavaClass;
|
9
|
9
|
import org.openzen.zenscript.javashared.JavaMethod;
|
10
|
10
|
import org.openzen.zenscript.javashared.JavaModifiers;
|
11
|
11
|
|
12
|
|
-import java.util.HashMap;
|
13
|
12
|
import java.util.Map;
|
14
|
13
|
@SuppressWarnings("Duplicates")
|
15
|
14
|
public class JavaForeachWriter {
|
|
@@ -92,10 +91,10 @@ public class JavaForeachWriter {
|
92
|
91
|
|
93
|
92
|
javaWriter.label(startLabel);
|
94
|
93
|
javaWriter.dup();
|
95
|
|
- javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR, "hasNext", "()Z", 0));
|
|
94
|
+ javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR.get(), "hasNext", "()Z", 0));
|
96
|
95
|
javaWriter.ifEQ(endLabel);
|
97
|
96
|
javaWriter.dup();
|
98
|
|
- javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR, "next", "()Ljava/lang/Object;", 0));
|
|
97
|
+ javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR.get(), "next", "()Ljava/lang/Object;", 0));
|
99
|
98
|
|
100
|
99
|
final JavaLocalVariableInfo keyVariable = javaWriter.getLocalVariable(variables[0].variable);
|
101
|
100
|
this.downCast(0, keyVariable.type);
|
|
@@ -110,10 +109,10 @@ public class JavaForeachWriter {
|
110
|
109
|
|
111
|
110
|
javaWriter.label(startLabel);
|
112
|
111
|
javaWriter.dup();
|
113
|
|
- javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR, "hasNext", "()Z", 0));
|
|
112
|
+ javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR.get(), "hasNext", "()Z", 0));
|
114
|
113
|
javaWriter.ifEQ(endLabel);
|
115
|
114
|
javaWriter.dup();
|
116
|
|
- javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR, "next", "()Ljava/lang/Object;", 0));
|
|
115
|
+ javaWriter.invokeInterface(JavaMethod.getVirtual(JavaClass.ITERATOR.get(), "next", "()Ljava/lang/Object;", 0));
|
117
|
116
|
javaWriter.checkCast(Type.getType(Map.Entry.class));
|
118
|
117
|
javaWriter.dup(false);
|
119
|
118
|
|