|
@@ -1,9 +1,7 @@
|
1
|
1
|
package org.openzen.zenscript.javabytecode.compiler;
|
2
|
2
|
|
3
|
3
|
import java.util.Arrays;
|
4
|
|
-import java.util.Collection;
|
5
|
4
|
import java.util.Comparator;
|
6
|
|
-import java.util.Map;
|
7
|
5
|
import java.util.StringJoiner;
|
8
|
6
|
import org.objectweb.asm.ClassWriter;
|
9
|
7
|
import org.objectweb.asm.Label;
|
|
@@ -25,152 +23,136 @@ import org.openzen.zenscript.javabytecode.*;
|
25
|
23
|
import java.io.FileOutputStream;
|
26
|
24
|
import java.io.IOException;
|
27
|
25
|
import org.openzen.zenscript.javashared.JavaClass;
|
|
26
|
+import org.openzen.zenscript.javashared.JavaField;
|
|
27
|
+import org.openzen.zenscript.javashared.JavaSynthesizedClassNamer;
|
28
|
28
|
|
29
|
29
|
public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
30
|
30
|
private static final int PUBLIC = Opcodes.ACC_PUBLIC;
|
31
|
31
|
private static final int STATIC = Opcodes.ACC_STATIC;
|
32
|
32
|
private static final int PUBLIC_STATIC = PUBLIC | STATIC;
|
33
|
33
|
|
34
|
|
- private static final JavaClass BOOLEAN = JavaCompileUtils.get(Boolean.class);
|
35
|
|
- private static final JavaMethodInfo BOOLEAN_PARSE = new JavaMethodInfo(BOOLEAN, "parseBoolean", "(Ljava/lang/String;)Z", PUBLIC_STATIC);
|
36
|
|
- private static final JavaMethodInfo BOOLEAN_TO_STRING = new JavaMethodInfo(BOOLEAN, "toString", "(Z)Ljava/lang/String;", PUBLIC_STATIC);
|
37
|
|
- private static final JavaClass BYTE = JavaCompileUtils.get(Byte.class);
|
38
|
|
- private static final JavaMethodInfo BYTE_PARSE = new JavaMethodInfo(BYTE, "parseByte", "(Ljava/lang/String;)B", PUBLIC_STATIC);
|
39
|
|
- private static final JavaMethodInfo BYTE_PARSE_WITH_BASE = new JavaMethodInfo(BYTE, "parseByte", "(Ljava/lang/String;I)B", PUBLIC_STATIC);
|
40
|
|
- private static final JavaFieldInfo BYTE_MIN_VALUE = new JavaFieldInfo(BYTE, "MIN_VALUE", "B");
|
41
|
|
- private static final JavaFieldInfo BYTE_MAX_VALUE = new JavaFieldInfo(BYTE, "MAX_VALUE", "B");
|
42
|
|
- private static final JavaMethodInfo BYTE_TO_STRING = new JavaMethodInfo(BYTE, "toString", "(B)Ljava/lang/String;", PUBLIC_STATIC);
|
43
|
|
- private static final JavaClass SHORT = JavaCompileUtils.get(Short.class);
|
44
|
|
- private static final JavaMethodInfo SHORT_PARSE = new JavaMethodInfo(SHORT, "parseShort", "(Ljava/lang/String;)S", PUBLIC_STATIC);
|
45
|
|
- private static final JavaMethodInfo SHORT_PARSE_WITH_BASE = new JavaMethodInfo(SHORT, "parseShort", "(Ljava/lang/String;I)S", PUBLIC_STATIC);
|
46
|
|
- private static final JavaFieldInfo SHORT_MIN_VALUE = new JavaFieldInfo(SHORT, "MIN_VALUE", "S");
|
47
|
|
- private static final JavaFieldInfo SHORT_MAX_VALUE = new JavaFieldInfo(SHORT, "MAX_VALUE", "S");
|
48
|
|
- private static final JavaMethodInfo SHORT_TO_STRING = new JavaMethodInfo(SHORT, "toString", "(S)Ljava/lang/String;", PUBLIC_STATIC);
|
49
|
|
- private static final JavaClass INTEGER = JavaCompileUtils.get(Integer.class);
|
50
|
|
- private static final JavaMethodInfo INTEGER_COMPARE_UNSIGNED = new JavaMethodInfo(INTEGER, "compareUnsigned", "(II)I", PUBLIC_STATIC);
|
51
|
|
- private static final JavaMethodInfo INTEGER_DIVIDE_UNSIGNED = new JavaMethodInfo(INTEGER, "divideUnsigned", "(II)I", PUBLIC_STATIC);
|
52
|
|
- private static final JavaMethodInfo INTEGER_REMAINDER_UNSIGNED = new JavaMethodInfo(INTEGER, "remainderUnsigned", "(II)I", PUBLIC_STATIC);
|
53
|
|
- private static final JavaMethodInfo INTEGER_NUMBER_OF_TRAILING_ZEROS = new JavaMethodInfo(INTEGER, "numberOfTrailingZeros", "(I)I", PUBLIC_STATIC);
|
54
|
|
- private static final JavaMethodInfo INTEGER_NUMBER_OF_LEADING_ZEROS = new JavaMethodInfo(INTEGER, "numberOfLeadingZeros", "(I)I", PUBLIC_STATIC);
|
55
|
|
- private static final JavaMethodInfo INTEGER_PARSE = new JavaMethodInfo(INTEGER, "parseInt", "(Ljava/lang/String;)I", PUBLIC_STATIC);
|
56
|
|
- private static final JavaMethodInfo INTEGER_PARSE_WITH_BASE = new JavaMethodInfo(INTEGER, "parseInt", "(Ljava/lang/String;I)I", PUBLIC_STATIC);
|
57
|
|
- private static final JavaMethodInfo INTEGER_PARSE_UNSIGNED = new JavaMethodInfo(INTEGER, "parseUnsignedInt", "(Ljava/lang/String;)I", PUBLIC_STATIC);
|
58
|
|
- private static final JavaMethodInfo INTEGER_PARSE_UNSIGNED_WITH_BASE = new JavaMethodInfo(INTEGER, "parseUnsignedInt", "(Ljava/lang/String;I)I", PUBLIC_STATIC);
|
59
|
|
- private static final JavaMethodInfo INTEGER_HIGHEST_ONE_BIT = new JavaMethodInfo(INTEGER, "highestOneBit", "(I)I", PUBLIC_STATIC);
|
60
|
|
- private static final JavaMethodInfo INTEGER_LOWEST_ONE_BIT = new JavaMethodInfo(INTEGER, "lowestOneBit", "(I)I", PUBLIC_STATIC);
|
61
|
|
- private static final JavaMethodInfo INTEGER_BIT_COUNT = new JavaMethodInfo(INTEGER, "bitCount", "(I)I", PUBLIC_STATIC);
|
62
|
|
- private static final JavaFieldInfo INTEGER_MIN_VALUE = new JavaFieldInfo(INTEGER, "MIN_VALUE", "I");
|
63
|
|
- private static final JavaFieldInfo INTEGER_MAX_VALUE = new JavaFieldInfo(INTEGER, "MAX_VALUE", "I");
|
64
|
|
- private static final JavaMethodInfo INTEGER_TO_STRING = new JavaMethodInfo(INTEGER, "toString", "(I)Ljava/lang/String;", PUBLIC_STATIC);
|
65
|
|
- private static final JavaMethodInfo INTEGER_TO_UNSIGNED_STRING = new JavaMethodInfo(INTEGER, "toUnsignedString", "(I)Ljava/lang/String;", PUBLIC_STATIC);
|
66
|
|
- private static final JavaClass LONG = JavaCompileUtils.get(Long.class);
|
67
|
|
- private static final JavaMethodInfo LONG_COMPARE = new JavaMethodInfo(LONG, "compare", "(JJ)I", PUBLIC_STATIC);
|
68
|
|
- private static final JavaMethodInfo LONG_COMPARE_UNSIGNED = new JavaMethodInfo(LONG, "compareUnsigned", "(JJ)I", PUBLIC_STATIC);
|
69
|
|
- private static final JavaMethodInfo LONG_DIVIDE_UNSIGNED = new JavaMethodInfo(LONG, "divideUnsigned", "(JJ)J", PUBLIC_STATIC);
|
70
|
|
- private static final JavaMethodInfo LONG_REMAINDER_UNSIGNED = new JavaMethodInfo(LONG, "remainderUnsigned", "(JJ)J", PUBLIC_STATIC);
|
71
|
|
- private static final JavaMethodInfo LONG_NUMBER_OF_TRAILING_ZEROS = new JavaMethodInfo(LONG, "numberOfTrailingZeros", "(J)I", PUBLIC_STATIC);
|
72
|
|
- private static final JavaMethodInfo LONG_NUMBER_OF_LEADING_ZEROS = new JavaMethodInfo(LONG, "numberOfLeadingZeros", "(J)I", PUBLIC_STATIC);
|
73
|
|
- private static final JavaMethodInfo LONG_PARSE = new JavaMethodInfo(LONG, "parseLong", "(Ljava/lang/String;)J", PUBLIC_STATIC);
|
74
|
|
- private static final JavaMethodInfo LONG_PARSE_WITH_BASE = new JavaMethodInfo(LONG, "parseLong", "(Ljava/lang/String;I)J", PUBLIC_STATIC);
|
75
|
|
- private static final JavaMethodInfo LONG_PARSE_UNSIGNED = new JavaMethodInfo(LONG, "parseUnsignedLong", "(Ljava/lang/String;)J", PUBLIC_STATIC);
|
76
|
|
- private static final JavaMethodInfo LONG_PARSE_UNSIGNED_WITH_BASE = new JavaMethodInfo(LONG, "parseUnsignedLong", "(Ljava/lang/String;I)J", PUBLIC_STATIC);
|
77
|
|
- private static final JavaMethodInfo LONG_HIGHEST_ONE_BIT = new JavaMethodInfo(LONG, "highestOneBit", "(J)J", PUBLIC_STATIC);
|
78
|
|
- private static final JavaMethodInfo LONG_LOWEST_ONE_BIT = new JavaMethodInfo(LONG, "lowestOneBit", "(J)J", PUBLIC_STATIC);
|
79
|
|
- private static final JavaMethodInfo LONG_BIT_COUNT = new JavaMethodInfo(LONG, "bitCount", "(J)I", PUBLIC_STATIC);
|
80
|
|
- private static final JavaFieldInfo LONG_MIN_VALUE = new JavaFieldInfo(LONG, "MIN_VALUE", "J");
|
81
|
|
- private static final JavaFieldInfo LONG_MAX_VALUE = new JavaFieldInfo(LONG, "MAX_VALUE", "J");
|
82
|
|
- private static final JavaMethodInfo LONG_TO_STRING = new JavaMethodInfo(LONG, "toString", "(J)Ljava/lang/String;", PUBLIC_STATIC);
|
83
|
|
- private static final JavaMethodInfo LONG_TO_UNSIGNED_STRING = new JavaMethodInfo(LONG, "toUnsignedString", "(J)Ljava/lang/String;", PUBLIC_STATIC);
|
84
|
|
- private static final JavaClass FLOAT = JavaCompileUtils.get(Float.class);
|
85
|
|
- private static final JavaMethodInfo FLOAT_COMPARE = new JavaMethodInfo(FLOAT, "compare", "(FF)I", PUBLIC_STATIC);
|
86
|
|
- private static final JavaMethodInfo FLOAT_PARSE = new JavaMethodInfo(FLOAT, "parseFloat", "(Ljava/lang/String;)F", PUBLIC_STATIC);
|
87
|
|
- private static final JavaMethodInfo FLOAT_FROM_BITS = new JavaMethodInfo(FLOAT, "intBitsToFloat", "(I)F", PUBLIC_STATIC);
|
88
|
|
- private static final JavaMethodInfo FLOAT_BITS = new JavaMethodInfo(FLOAT, "floatToRawIntBits", "(F)I", PUBLIC_STATIC);
|
89
|
|
- private static final JavaFieldInfo FLOAT_MIN_VALUE = new JavaFieldInfo(FLOAT, "MIN_VALUE", "F");
|
90
|
|
- private static final JavaFieldInfo FLOAT_MAX_VALUE = new JavaFieldInfo(FLOAT, "MAX_VALUE", "F");
|
91
|
|
- private static final JavaMethodInfo FLOAT_TO_STRING = new JavaMethodInfo(FLOAT, "toString", "(F)Ljava/lang/String;", PUBLIC_STATIC);
|
92
|
|
- private static final JavaClass DOUBLE = JavaCompileUtils.get(Double.class);
|
93
|
|
- private static final JavaMethodInfo DOUBLE_COMPARE = new JavaMethodInfo(DOUBLE, "compare", "(DD)I", PUBLIC_STATIC);
|
94
|
|
- private static final JavaMethodInfo DOUBLE_PARSE = new JavaMethodInfo(DOUBLE, "parseDouble", "(Ljava/lang/String;)D", PUBLIC_STATIC);
|
95
|
|
- private static final JavaMethodInfo DOUBLE_FROM_BITS = new JavaMethodInfo(DOUBLE, "longBitsToDouble", "(J)D", PUBLIC_STATIC);
|
96
|
|
- private static final JavaMethodInfo DOUBLE_BITS = new JavaMethodInfo(DOUBLE, "doubleToRawLongBits", "(D)J", PUBLIC_STATIC);
|
97
|
|
- private static final JavaFieldInfo DOUBLE_MIN_VALUE = new JavaFieldInfo(DOUBLE, "MIN_VALUE", "D");
|
98
|
|
- private static final JavaFieldInfo DOUBLE_MAX_VALUE = new JavaFieldInfo(DOUBLE, "MAX_VALUE", "D");
|
99
|
|
- private static final JavaMethodInfo DOUBLE_TO_STRING = new JavaMethodInfo(DOUBLE, "toString", "(D)Ljava/lang/String;", PUBLIC_STATIC);
|
100
|
|
- private static final JavaClass CHARACTER = JavaCompileUtils.get(Character.class);
|
101
|
|
- private static final JavaMethodInfo CHARACTER_TO_LOWER_CASE = new JavaMethodInfo(CHARACTER, "toLowerCase", "()C", PUBLIC);
|
102
|
|
- private static final JavaMethodInfo CHARACTER_TO_UPPER_CASE = new JavaMethodInfo(CHARACTER, "toUpperCase", "()C", PUBLIC);
|
103
|
|
- private static final JavaFieldInfo CHARACTER_MIN_VALUE = new JavaFieldInfo(CHARACTER, "MIN_VALUE", "C");
|
104
|
|
- private static final JavaFieldInfo CHARACTER_MAX_VALUE = new JavaFieldInfo(CHARACTER, "MAX_VALUE", "C");
|
105
|
|
- private static final JavaMethodInfo CHARACTER_TO_STRING = new JavaMethodInfo(CHARACTER, "toString", "(C)Ljava/lang/String;", PUBLIC_STATIC);
|
106
|
|
- private static final JavaClass STRING = JavaCompileUtils.get(String.class);
|
107
|
|
- private static final JavaMethodInfo STRING_COMPARETO = new JavaMethodInfo(STRING, "compareTo", "(Ljava/lang/String;)I", PUBLIC);
|
108
|
|
- private static final JavaMethodInfo STRING_CONCAT = new JavaMethodInfo(STRING, "concat", "(Ljava/lang/String;)Ljava/lang/String;", PUBLIC);
|
109
|
|
- private static final JavaMethodInfo STRING_CHAR_AT = new JavaMethodInfo(STRING, "charAt", "(I)C", PUBLIC);
|
110
|
|
- private static final JavaMethodInfo STRING_SUBSTRING = new JavaMethodInfo(STRING, "substring", "(II)Ljava/lang/String;", PUBLIC);
|
111
|
|
- private static final JavaMethodInfo STRING_TRIM = new JavaMethodInfo(STRING, "trim", "()Ljava/lang/String;", PUBLIC);
|
112
|
|
- private static final JavaMethodInfo STRING_TO_LOWER_CASE = new JavaMethodInfo(STRING, "toLowerCase", "()Ljava/lang/String;", PUBLIC);
|
113
|
|
- private static final JavaMethodInfo STRING_TO_UPPER_CASE = new JavaMethodInfo(STRING, "toUpperCase", "()Ljava/lang/String;", PUBLIC);
|
114
|
|
- private static final JavaMethodInfo STRING_LENGTH = new JavaMethodInfo(STRING, "length", "()I", PUBLIC);
|
115
|
|
- private static final JavaMethodInfo STRING_CHARACTERS = new JavaMethodInfo(STRING, "toCharArray", "()[C", PUBLIC);
|
116
|
|
- private static final JavaMethodInfo STRING_ISEMPTY = new JavaMethodInfo(STRING, "isEmpty", "()Z", PUBLIC);
|
117
|
|
- private static final JavaClass ENUM = JavaCompileUtils.get(Enum.class);
|
118
|
|
- private static final JavaMethodInfo ENUM_COMPARETO = new JavaMethodInfo(STRING, "compareTo", "(Ljava/lang/Enum;)I", PUBLIC);
|
119
|
|
- private static final JavaMethodInfo ENUM_NAME = new JavaMethodInfo(STRING, "name", "()Ljava/lang/String;", PUBLIC);
|
120
|
|
- private static final JavaMethodInfo ENUM_ORDINAL = new JavaMethodInfo(STRING, "ordinal", "()I", PUBLIC);
|
121
|
|
- private static final JavaClass MAP = JavaCompileUtils.get(Map.class);
|
122
|
|
- private static final JavaMethodInfo MAP_GET = new JavaMethodInfo(MAP, "get", "(Ljava/lang/Object;)Ljava/lang/Object;", PUBLIC);
|
123
|
|
- private static final JavaMethodInfo MAP_PUT = new JavaMethodInfo(MAP, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", PUBLIC);
|
124
|
|
- private static final JavaMethodInfo MAP_CONTAINS_KEY = new JavaMethodInfo(MAP, "containsKey", "(Ljava/lang/Object;)Z", PUBLIC);
|
125
|
|
- private static final JavaMethodInfo MAP_SIZE = new JavaMethodInfo(MAP, "size", "()I", PUBLIC);
|
126
|
|
- private static final JavaMethodInfo MAP_ISEMPTY = new JavaMethodInfo(MAP, "isEmpty", "()Z", PUBLIC);
|
127
|
|
- private static final JavaMethodInfo MAP_KEYS = new JavaMethodInfo(MAP, "keys", "()Ljava/lang/Object;", PUBLIC);
|
128
|
|
- private static final JavaMethodInfo MAP_VALUES = new JavaMethodInfo(MAP, "values", "()Ljava/lang/Object;", PUBLIC);
|
129
|
|
- private static final JavaClass ARRAYS = JavaCompileUtils.get(Arrays.class);
|
130
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_OBJECTS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([Ljava/lang/Object;II)[Ljava/lang/Object;", PUBLIC_STATIC);
|
131
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_BOOLS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([ZII)[Z", PUBLIC_STATIC);
|
132
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_BYTES = new JavaMethodInfo(ARRAYS, "copyOfRange", "([BII)[B", PUBLIC_STATIC);
|
133
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_SHORTS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([SII)[S", PUBLIC_STATIC);
|
134
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_INTS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([III)[I", PUBLIC_STATIC);
|
135
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_LONGS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([JII)[J", PUBLIC_STATIC);
|
136
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_FLOATS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([FII)[F", PUBLIC_STATIC);
|
137
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_DOUBLES = new JavaMethodInfo(ARRAYS, "copyOfRange", "([DII)[D", PUBLIC_STATIC);
|
138
|
|
- private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_CHARS = new JavaMethodInfo(ARRAYS, "copyOfRange", "([CII)[C", PUBLIC_STATIC);
|
139
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_OBJECTS = new JavaMethodInfo(ARRAYS, "equals", "([Ljava/lang/Object[Ljava/lang/Object)Z", PUBLIC_STATIC);
|
140
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_BOOLS = new JavaMethodInfo(ARRAYS, "equals", "([Z[Z)Z", PUBLIC_STATIC);
|
141
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_BYTES = new JavaMethodInfo(ARRAYS, "equals", "([B[B)Z", PUBLIC_STATIC);
|
142
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_SHORTS = new JavaMethodInfo(ARRAYS, "equals", "([S[S)Z", PUBLIC_STATIC);
|
143
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_INTS = new JavaMethodInfo(ARRAYS, "equals", "([I[I)Z", PUBLIC_STATIC);
|
144
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_LONGS = new JavaMethodInfo(ARRAYS, "equals", "([L[L)Z", PUBLIC_STATIC);
|
145
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_FLOATS = new JavaMethodInfo(ARRAYS, "equals", "([F[F)Z", PUBLIC_STATIC);
|
146
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_DOUBLES = new JavaMethodInfo(ARRAYS, "equals", "([D[D)Z", PUBLIC_STATIC);
|
147
|
|
- private static final JavaMethodInfo ARRAYS_EQUALS_CHARS = new JavaMethodInfo(ARRAYS, "equals", "([C[C)Z", PUBLIC_STATIC);
|
148
|
|
- private static final JavaMethodInfo ARRAYS_DEEPHASHCODE = new JavaMethodInfo(ARRAYS, "deepHashCode", "([Ljava/lang/Object;)", PUBLIC_STATIC);
|
149
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_BOOLS = new JavaMethodInfo(ARRAYS, "hashCode", "([Z)I", PUBLIC_STATIC);
|
150
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_BYTES = new JavaMethodInfo(ARRAYS, "hashCode", "([B)I", PUBLIC_STATIC);
|
151
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_SHORTS = new JavaMethodInfo(ARRAYS, "hashCode", "([S)I", PUBLIC_STATIC);
|
152
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_INTS = new JavaMethodInfo(ARRAYS, "hashCode", "([I)I", PUBLIC_STATIC);
|
153
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_LONGS = new JavaMethodInfo(ARRAYS, "hashCode", "([L)I", PUBLIC_STATIC);
|
154
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_FLOATS = new JavaMethodInfo(ARRAYS, "hashCode", "([F)I", PUBLIC_STATIC);
|
155
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_DOUBLES = new JavaMethodInfo(ARRAYS, "hashCode", "([D)I", PUBLIC_STATIC);
|
156
|
|
- private static final JavaMethodInfo ARRAYS_HASHCODE_CHARS = new JavaMethodInfo(ARRAYS, "hashCode", "([C)I", PUBLIC_STATIC);
|
157
|
|
- private static final JavaClass OBJECT = JavaCompileUtils.get(Object.class);
|
158
|
|
- private static final JavaMethodInfo OBJECT_HASHCODE = new JavaMethodInfo(OBJECT, "hashCode", "()I", PUBLIC);
|
159
|
|
- private static final JavaClass COLLECTION = JavaCompileUtils.get(Collection.class);
|
160
|
|
- private static final JavaMethodInfo COLLECTION_SIZE = new JavaMethodInfo(COLLECTION, "size", "()I", PUBLIC);
|
161
|
|
- private static final JavaMethodInfo COLLECTION_TOARRAY = new JavaMethodInfo(COLLECTION, "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", PUBLIC);
|
|
34
|
+ private static final JavaMethodInfo BOOLEAN_PARSE = new JavaMethodInfo(JavaClass.BOOLEAN, "parseBoolean", "(Ljava/lang/String;)Z", PUBLIC_STATIC);
|
|
35
|
+ private static final JavaMethodInfo BOOLEAN_TO_STRING = new JavaMethodInfo(JavaClass.BOOLEAN, "toString", "(Z)Ljava/lang/String;", PUBLIC_STATIC);
|
|
36
|
+ private static final JavaMethodInfo BYTE_PARSE = new JavaMethodInfo(JavaClass.BYTE, "parseByte", "(Ljava/lang/String;)B", PUBLIC_STATIC);
|
|
37
|
+ private static final JavaMethodInfo BYTE_PARSE_WITH_BASE = new JavaMethodInfo(JavaClass.BYTE, "parseByte", "(Ljava/lang/String;I)B", PUBLIC_STATIC);
|
|
38
|
+ private static final JavaField BYTE_MIN_VALUE = new JavaField(JavaClass.BYTE, "MIN_VALUE", "B");
|
|
39
|
+ private static final JavaField BYTE_MAX_VALUE = new JavaField(JavaClass.BYTE, "MAX_VALUE", "B");
|
|
40
|
+ private static final JavaMethodInfo BYTE_TO_STRING = new JavaMethodInfo(JavaClass.BYTE, "toString", "(B)Ljava/lang/String;", PUBLIC_STATIC);
|
|
41
|
+ private static final JavaMethodInfo SHORT_PARSE = new JavaMethodInfo(JavaClass.SHORT, "parseShort", "(Ljava/lang/String;)S", PUBLIC_STATIC);
|
|
42
|
+ private static final JavaMethodInfo SHORT_PARSE_WITH_BASE = new JavaMethodInfo(JavaClass.SHORT, "parseShort", "(Ljava/lang/String;I)S", PUBLIC_STATIC);
|
|
43
|
+ private static final JavaField SHORT_MIN_VALUE = new JavaField(JavaClass.SHORT, "MIN_VALUE", "S");
|
|
44
|
+ private static final JavaField SHORT_MAX_VALUE = new JavaField(JavaClass.SHORT, "MAX_VALUE", "S");
|
|
45
|
+ private static final JavaMethodInfo SHORT_TO_STRING = new JavaMethodInfo(JavaClass.SHORT, "toString", "(S)Ljava/lang/String;", PUBLIC_STATIC);
|
|
46
|
+ private static final JavaMethodInfo INTEGER_COMPARE_UNSIGNED = new JavaMethodInfo(JavaClass.INTEGER, "compareUnsigned", "(II)I", PUBLIC_STATIC);
|
|
47
|
+ private static final JavaMethodInfo INTEGER_DIVIDE_UNSIGNED = new JavaMethodInfo(JavaClass.INTEGER, "divideUnsigned", "(II)I", PUBLIC_STATIC);
|
|
48
|
+ private static final JavaMethodInfo INTEGER_REMAINDER_UNSIGNED = new JavaMethodInfo(JavaClass.INTEGER, "remainderUnsigned", "(II)I", PUBLIC_STATIC);
|
|
49
|
+ private static final JavaMethodInfo INTEGER_NUMBER_OF_TRAILING_ZEROS = new JavaMethodInfo(JavaClass.INTEGER, "numberOfTrailingZeros", "(I)I", PUBLIC_STATIC);
|
|
50
|
+ private static final JavaMethodInfo INTEGER_NUMBER_OF_LEADING_ZEROS = new JavaMethodInfo(JavaClass.INTEGER, "numberOfLeadingZeros", "(I)I", PUBLIC_STATIC);
|
|
51
|
+ private static final JavaMethodInfo INTEGER_PARSE = new JavaMethodInfo(JavaClass.INTEGER, "parseInt", "(Ljava/lang/String;)I", PUBLIC_STATIC);
|
|
52
|
+ private static final JavaMethodInfo INTEGER_PARSE_WITH_BASE = new JavaMethodInfo(JavaClass.INTEGER, "parseInt", "(Ljava/lang/String;I)I", PUBLIC_STATIC);
|
|
53
|
+ private static final JavaMethodInfo INTEGER_PARSE_UNSIGNED = new JavaMethodInfo(JavaClass.INTEGER, "parseUnsignedInt", "(Ljava/lang/String;)I", PUBLIC_STATIC);
|
|
54
|
+ private static final JavaMethodInfo INTEGER_PARSE_UNSIGNED_WITH_BASE = new JavaMethodInfo(JavaClass.INTEGER, "parseUnsignedInt", "(Ljava/lang/String;I)I", PUBLIC_STATIC);
|
|
55
|
+ private static final JavaMethodInfo INTEGER_HIGHEST_ONE_BIT = new JavaMethodInfo(JavaClass.INTEGER, "highestOneBit", "(I)I", PUBLIC_STATIC);
|
|
56
|
+ private static final JavaMethodInfo INTEGER_LOWEST_ONE_BIT = new JavaMethodInfo(JavaClass.INTEGER, "lowestOneBit", "(I)I", PUBLIC_STATIC);
|
|
57
|
+ private static final JavaMethodInfo INTEGER_BIT_COUNT = new JavaMethodInfo(JavaClass.INTEGER, "bitCount", "(I)I", PUBLIC_STATIC);
|
|
58
|
+ private static final JavaField INTEGER_MIN_VALUE = new JavaField(JavaClass.INTEGER, "MIN_VALUE", "I");
|
|
59
|
+ private static final JavaField INTEGER_MAX_VALUE = new JavaField(JavaClass.INTEGER, "MAX_VALUE", "I");
|
|
60
|
+ private static final JavaMethodInfo INTEGER_TO_STRING = new JavaMethodInfo(JavaClass.INTEGER, "toString", "(I)Ljava/lang/String;", PUBLIC_STATIC);
|
|
61
|
+ private static final JavaMethodInfo INTEGER_TO_UNSIGNED_STRING = new JavaMethodInfo(JavaClass.INTEGER, "toUnsignedString", "(I)Ljava/lang/String;", PUBLIC_STATIC);
|
|
62
|
+ private static final JavaMethodInfo LONG_COMPARE = new JavaMethodInfo(JavaClass.LONG, "compare", "(JJ)I", PUBLIC_STATIC);
|
|
63
|
+ private static final JavaMethodInfo LONG_COMPARE_UNSIGNED = new JavaMethodInfo(JavaClass.LONG, "compareUnsigned", "(JJ)I", PUBLIC_STATIC);
|
|
64
|
+ private static final JavaMethodInfo LONG_DIVIDE_UNSIGNED = new JavaMethodInfo(JavaClass.LONG, "divideUnsigned", "(JJ)J", PUBLIC_STATIC);
|
|
65
|
+ private static final JavaMethodInfo LONG_REMAINDER_UNSIGNED = new JavaMethodInfo(JavaClass.LONG, "remainderUnsigned", "(JJ)J", PUBLIC_STATIC);
|
|
66
|
+ private static final JavaMethodInfo LONG_NUMBER_OF_TRAILING_ZEROS = new JavaMethodInfo(JavaClass.LONG, "numberOfTrailingZeros", "(J)I", PUBLIC_STATIC);
|
|
67
|
+ private static final JavaMethodInfo LONG_NUMBER_OF_LEADING_ZEROS = new JavaMethodInfo(JavaClass.LONG, "numberOfLeadingZeros", "(J)I", PUBLIC_STATIC);
|
|
68
|
+ private static final JavaMethodInfo LONG_PARSE = new JavaMethodInfo(JavaClass.LONG, "parseLong", "(Ljava/lang/String;)J", PUBLIC_STATIC);
|
|
69
|
+ private static final JavaMethodInfo LONG_PARSE_WITH_BASE = new JavaMethodInfo(JavaClass.LONG, "parseLong", "(Ljava/lang/String;I)J", PUBLIC_STATIC);
|
|
70
|
+ private static final JavaMethodInfo LONG_PARSE_UNSIGNED = new JavaMethodInfo(JavaClass.LONG, "parseUnsignedLong", "(Ljava/lang/String;)J", PUBLIC_STATIC);
|
|
71
|
+ private static final JavaMethodInfo LONG_PARSE_UNSIGNED_WITH_BASE = new JavaMethodInfo(JavaClass.LONG, "parseUnsignedLong", "(Ljava/lang/String;I)J", PUBLIC_STATIC);
|
|
72
|
+ private static final JavaMethodInfo LONG_HIGHEST_ONE_BIT = new JavaMethodInfo(JavaClass.LONG, "highestOneBit", "(J)J", PUBLIC_STATIC);
|
|
73
|
+ private static final JavaMethodInfo LONG_LOWEST_ONE_BIT = new JavaMethodInfo(JavaClass.LONG, "lowestOneBit", "(J)J", PUBLIC_STATIC);
|
|
74
|
+ private static final JavaMethodInfo LONG_BIT_COUNT = new JavaMethodInfo(JavaClass.LONG, "bitCount", "(J)I", PUBLIC_STATIC);
|
|
75
|
+ private static final JavaField LONG_MIN_VALUE = new JavaField(JavaClass.LONG, "MIN_VALUE", "J");
|
|
76
|
+ private static final JavaField LONG_MAX_VALUE = new JavaField(JavaClass.LONG, "MAX_VALUE", "J");
|
|
77
|
+ private static final JavaMethodInfo LONG_TO_STRING = new JavaMethodInfo(JavaClass.LONG, "toString", "(J)Ljava/lang/String;", PUBLIC_STATIC);
|
|
78
|
+ private static final JavaMethodInfo LONG_TO_UNSIGNED_STRING = new JavaMethodInfo(JavaClass.LONG, "toUnsignedString", "(J)Ljava/lang/String;", PUBLIC_STATIC);
|
|
79
|
+ private static final JavaMethodInfo FLOAT_COMPARE = new JavaMethodInfo(JavaClass.FLOAT, "compare", "(FF)I", PUBLIC_STATIC);
|
|
80
|
+ private static final JavaMethodInfo FLOAT_PARSE = new JavaMethodInfo(JavaClass.FLOAT, "parseFloat", "(Ljava/lang/String;)F", PUBLIC_STATIC);
|
|
81
|
+ private static final JavaMethodInfo FLOAT_FROM_BITS = new JavaMethodInfo(JavaClass.FLOAT, "intBitsToFloat", "(I)F", PUBLIC_STATIC);
|
|
82
|
+ private static final JavaMethodInfo FLOAT_BITS = new JavaMethodInfo(JavaClass.FLOAT, "floatToRawIntBits", "(F)I", PUBLIC_STATIC);
|
|
83
|
+ private static final JavaField FLOAT_MIN_VALUE = new JavaField(JavaClass.FLOAT, "MIN_VALUE", "F");
|
|
84
|
+ private static final JavaField FLOAT_MAX_VALUE = new JavaField(JavaClass.FLOAT, "MAX_VALUE", "F");
|
|
85
|
+ private static final JavaMethodInfo FLOAT_TO_STRING = new JavaMethodInfo(JavaClass.FLOAT, "toString", "(F)Ljava/lang/String;", PUBLIC_STATIC);
|
|
86
|
+ private static final JavaMethodInfo DOUBLE_COMPARE = new JavaMethodInfo(JavaClass.DOUBLE, "compare", "(DD)I", PUBLIC_STATIC);
|
|
87
|
+ private static final JavaMethodInfo DOUBLE_PARSE = new JavaMethodInfo(JavaClass.DOUBLE, "parseDouble", "(Ljava/lang/String;)D", PUBLIC_STATIC);
|
|
88
|
+ private static final JavaMethodInfo DOUBLE_FROM_BITS = new JavaMethodInfo(JavaClass.DOUBLE, "longBitsToDouble", "(J)D", PUBLIC_STATIC);
|
|
89
|
+ private static final JavaMethodInfo DOUBLE_BITS = new JavaMethodInfo(JavaClass.DOUBLE, "doubleToRawLongBits", "(D)J", PUBLIC_STATIC);
|
|
90
|
+ private static final JavaField DOUBLE_MIN_VALUE = new JavaField(JavaClass.DOUBLE, "MIN_VALUE", "D");
|
|
91
|
+ private static final JavaField DOUBLE_MAX_VALUE = new JavaField(JavaClass.DOUBLE, "MAX_VALUE", "D");
|
|
92
|
+ private static final JavaMethodInfo DOUBLE_TO_STRING = new JavaMethodInfo(JavaClass.DOUBLE, "toString", "(D)Ljava/lang/String;", PUBLIC_STATIC);
|
|
93
|
+ private static final JavaMethodInfo CHARACTER_TO_LOWER_CASE = new JavaMethodInfo(JavaClass.CHARACTER, "toLowerCase", "()C", PUBLIC);
|
|
94
|
+ private static final JavaMethodInfo CHARACTER_TO_UPPER_CASE = new JavaMethodInfo(JavaClass.CHARACTER, "toUpperCase", "()C", PUBLIC);
|
|
95
|
+ private static final JavaField CHARACTER_MIN_VALUE = new JavaField(JavaClass.CHARACTER, "MIN_VALUE", "C");
|
|
96
|
+ private static final JavaField CHARACTER_MAX_VALUE = new JavaField(JavaClass.CHARACTER, "MAX_VALUE", "C");
|
|
97
|
+ private static final JavaMethodInfo CHARACTER_TO_STRING = new JavaMethodInfo(JavaClass.CHARACTER, "toString", "(C)Ljava/lang/String;", PUBLIC_STATIC);
|
|
98
|
+ private static final JavaMethodInfo STRING_COMPARETO = new JavaMethodInfo(JavaClass.STRING, "compareTo", "(Ljava/lang/String;)I", PUBLIC);
|
|
99
|
+ private static final JavaMethodInfo STRING_CONCAT = new JavaMethodInfo(JavaClass.STRING, "concat", "(Ljava/lang/String;)Ljava/lang/String;", PUBLIC);
|
|
100
|
+ private static final JavaMethodInfo STRING_CHAR_AT = new JavaMethodInfo(JavaClass.STRING, "charAt", "(I)C", PUBLIC);
|
|
101
|
+ private static final JavaMethodInfo STRING_SUBSTRING = new JavaMethodInfo(JavaClass.STRING, "substring", "(II)Ljava/lang/String;", PUBLIC);
|
|
102
|
+ private static final JavaMethodInfo STRING_TRIM = new JavaMethodInfo(JavaClass.STRING, "trim", "()Ljava/lang/String;", PUBLIC);
|
|
103
|
+ private static final JavaMethodInfo STRING_TO_LOWER_CASE = new JavaMethodInfo(JavaClass.STRING, "toLowerCase", "()Ljava/lang/String;", PUBLIC);
|
|
104
|
+ private static final JavaMethodInfo STRING_TO_UPPER_CASE = new JavaMethodInfo(JavaClass.STRING, "toUpperCase", "()Ljava/lang/String;", PUBLIC);
|
|
105
|
+ private static final JavaMethodInfo STRING_LENGTH = new JavaMethodInfo(JavaClass.STRING, "length", "()I", PUBLIC);
|
|
106
|
+ private static final JavaMethodInfo STRING_CHARACTERS = new JavaMethodInfo(JavaClass.STRING, "toCharArray", "()[C", PUBLIC);
|
|
107
|
+ private static final JavaMethodInfo STRING_ISEMPTY = new JavaMethodInfo(JavaClass.STRING, "isEmpty", "()Z", PUBLIC);
|
|
108
|
+ private static final JavaMethodInfo ENUM_COMPARETO = new JavaMethodInfo(JavaClass.ENUM, "compareTo", "(Ljava/lang/Enum;)I", PUBLIC);
|
|
109
|
+ private static final JavaMethodInfo ENUM_NAME = new JavaMethodInfo(JavaClass.ENUM, "name", "()Ljava/lang/String;", PUBLIC);
|
|
110
|
+ private static final JavaMethodInfo ENUM_ORDINAL = new JavaMethodInfo(JavaClass.ENUM, "ordinal", "()I", PUBLIC);
|
|
111
|
+ private static final JavaMethodInfo MAP_GET = new JavaMethodInfo(JavaClass.MAP, "get", "(Ljava/lang/Object;)Ljava/lang/Object;", PUBLIC);
|
|
112
|
+ private static final JavaMethodInfo MAP_PUT = new JavaMethodInfo(JavaClass.MAP, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", PUBLIC);
|
|
113
|
+ private static final JavaMethodInfo MAP_CONTAINS_KEY = new JavaMethodInfo(JavaClass.MAP, "containsKey", "(Ljava/lang/Object;)Z", PUBLIC);
|
|
114
|
+ private static final JavaMethodInfo MAP_SIZE = new JavaMethodInfo(JavaClass.MAP, "size", "()I", PUBLIC);
|
|
115
|
+ private static final JavaMethodInfo MAP_ISEMPTY = new JavaMethodInfo(JavaClass.MAP, "isEmpty", "()Z", PUBLIC);
|
|
116
|
+ private static final JavaMethodInfo MAP_KEYS = new JavaMethodInfo(JavaClass.MAP, "keys", "()Ljava/lang/Object;", PUBLIC);
|
|
117
|
+ private static final JavaMethodInfo MAP_VALUES = new JavaMethodInfo(JavaClass.MAP, "values", "()Ljava/lang/Object;", PUBLIC);
|
|
118
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_OBJECTS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([Ljava/lang/Object;II)[Ljava/lang/Object;", PUBLIC_STATIC);
|
|
119
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_BOOLS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([ZII)[Z", PUBLIC_STATIC);
|
|
120
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_BYTES = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([BII)[B", PUBLIC_STATIC);
|
|
121
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_SHORTS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([SII)[S", PUBLIC_STATIC);
|
|
122
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_INTS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([III)[I", PUBLIC_STATIC);
|
|
123
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_LONGS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([JII)[J", PUBLIC_STATIC);
|
|
124
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_FLOATS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([FII)[F", PUBLIC_STATIC);
|
|
125
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_DOUBLES = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([DII)[D", PUBLIC_STATIC);
|
|
126
|
+ private static final JavaMethodInfo ARRAYS_COPY_OF_RANGE_CHARS = new JavaMethodInfo(JavaClass.ARRAYS, "copyOfRange", "([CII)[C", PUBLIC_STATIC);
|
|
127
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_OBJECTS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([Ljava/lang/Object[Ljava/lang/Object)Z", PUBLIC_STATIC);
|
|
128
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_BOOLS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([Z[Z)Z", PUBLIC_STATIC);
|
|
129
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_BYTES = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([B[B)Z", PUBLIC_STATIC);
|
|
130
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_SHORTS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([S[S)Z", PUBLIC_STATIC);
|
|
131
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_INTS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([I[I)Z", PUBLIC_STATIC);
|
|
132
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_LONGS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([L[L)Z", PUBLIC_STATIC);
|
|
133
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_FLOATS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([F[F)Z", PUBLIC_STATIC);
|
|
134
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_DOUBLES = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([D[D)Z", PUBLIC_STATIC);
|
|
135
|
+ private static final JavaMethodInfo ARRAYS_EQUALS_CHARS = new JavaMethodInfo(JavaClass.ARRAYS, "equals", "([C[C)Z", PUBLIC_STATIC);
|
|
136
|
+ private static final JavaMethodInfo ARRAYS_DEEPHASHCODE = new JavaMethodInfo(JavaClass.ARRAYS, "deepHashCode", "([Ljava/lang/Object;)", PUBLIC_STATIC);
|
|
137
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_BOOLS = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([Z)I", PUBLIC_STATIC);
|
|
138
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_BYTES = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([B)I", PUBLIC_STATIC);
|
|
139
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_SHORTS = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([S)I", PUBLIC_STATIC);
|
|
140
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_INTS = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([I)I", PUBLIC_STATIC);
|
|
141
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_LONGS = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([L)I", PUBLIC_STATIC);
|
|
142
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_FLOATS = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([F)I", PUBLIC_STATIC);
|
|
143
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_DOUBLES = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([D)I", PUBLIC_STATIC);
|
|
144
|
+ private static final JavaMethodInfo ARRAYS_HASHCODE_CHARS = new JavaMethodInfo(JavaClass.ARRAYS, "hashCode", "([C)I", PUBLIC_STATIC);
|
|
145
|
+ private static final JavaMethodInfo OBJECT_HASHCODE = new JavaMethodInfo(JavaClass.OBJECT, "hashCode", "()I", PUBLIC);
|
|
146
|
+ private static final JavaMethodInfo COLLECTION_SIZE = new JavaMethodInfo(JavaClass.COLLECTION, "size", "()I", PUBLIC);
|
|
147
|
+ private static final JavaMethodInfo COLLECTION_TOARRAY = new JavaMethodInfo(JavaClass.COLLECTION, "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", PUBLIC);
|
162
|
148
|
|
163
|
149
|
private final JavaWriter javaWriter;
|
164
|
150
|
private final JavaCapturedExpressionVisitor capturedExpressionVisitor = new JavaCapturedExpressionVisitor(this);
|
|
151
|
+ private final JavaContext context;
|
165
|
152
|
|
166
|
|
- public JavaExpressionVisitor(JavaWriter javaWriter) {
|
|
153
|
+ public JavaExpressionVisitor(JavaContext context, JavaWriter javaWriter) {
|
167
|
154
|
this.javaWriter = javaWriter;
|
168
|
|
- }
|
169
|
|
-
|
170
|
|
- private static Class<?> getForEquals(ITypeID id) {
|
171
|
|
- if (CompilerUtils.isPrimitive(id))
|
172
|
|
- return id.accept(JavaTypeClassVisitor.INSTANCE);
|
173
|
|
- return Object.class;
|
|
155
|
+ this.context = context;
|
174
|
156
|
}
|
175
|
157
|
|
176
|
158
|
@Override
|
|
@@ -201,7 +183,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
201
|
183
|
@Override
|
202
|
184
|
public Void visitArray(ArrayExpression expression) {
|
203
|
185
|
javaWriter.constant(expression.expressions.length);
|
204
|
|
- Type type = Type.getType(expression.type.accept(JavaTypeClassVisitor.INSTANCE).getComponentType());
|
|
186
|
+ Type type = context.getType(((ArrayTypeID)expression.type).elementType);
|
205
|
187
|
javaWriter.newArray(type);
|
206
|
188
|
for (int i = 0; i < expression.expressions.length; i++) {
|
207
|
189
|
javaWriter.dup();
|
|
@@ -659,8 +641,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
659
|
641
|
javaWriter.invokeVirtual(MAP_GET);
|
660
|
642
|
|
661
|
643
|
AssocTypeID type = (AssocTypeID) expression.target.type;
|
662
|
|
- Type cls = type.valueType.accept(JavaTypeVisitor.INSTANCE);
|
663
|
|
- javaWriter.checkCast(cls.getInternalName());
|
|
644
|
+ javaWriter.checkCast(context.getInternalName(type.valueType));
|
664
|
645
|
break;
|
665
|
646
|
}
|
666
|
647
|
case ASSOC_INDEXSET:
|
|
@@ -716,12 +697,12 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
716
|
697
|
throw new UnsupportedOperationException("Not yet supported!");
|
717
|
698
|
case ARRAY_INDEXGET: {
|
718
|
699
|
ArrayTypeID type = (ArrayTypeID) expression.target.type;
|
719
|
|
- javaWriter.arrayLoad(type.elementType.accept(JavaTypeVisitor.INSTANCE));
|
|
700
|
+ javaWriter.arrayLoad(context.getType(type.elementType));
|
720
|
701
|
break;
|
721
|
702
|
}
|
722
|
703
|
case ARRAY_INDEXSET: {
|
723
|
704
|
ArrayTypeID type = (ArrayTypeID) expression.target.type;
|
724
|
|
- javaWriter.arrayStore(type.elementType.accept(JavaTypeVisitor.INSTANCE));
|
|
705
|
+ javaWriter.arrayStore(context.getType(type.elementType));
|
725
|
706
|
break;
|
726
|
707
|
}
|
727
|
708
|
case ARRAY_INDEXGETRANGE: {
|
|
@@ -782,7 +763,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
782
|
763
|
}
|
783
|
764
|
} else {
|
784
|
765
|
javaWriter.invokeStatic(ARRAYS_COPY_OF_RANGE_OBJECTS);
|
785
|
|
- javaWriter.checkCast("[" + type.elementType.accept(JavaTypeVisitor.INSTANCE).getDescriptor());
|
|
766
|
+ javaWriter.checkCast(context.getDescriptor(type));
|
786
|
767
|
}
|
787
|
768
|
break;
|
788
|
769
|
}
|
|
@@ -840,9 +821,9 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
840
|
821
|
case FUNCTION_CALL:
|
841
|
822
|
javaWriter.invokeInterface(
|
842
|
823
|
new JavaMethodInfo(
|
843
|
|
- JavaClass.fromInternalName(expression.target.type.accept(JavaTypeVisitor.INSTANCE).getInternalName(), JavaClass.Kind.INTERFACE),
|
|
824
|
+ JavaClass.fromInternalName(context.getInternalName(expression.target.type), JavaClass.Kind.INTERFACE),
|
844
|
825
|
"accept",
|
845
|
|
- CompilerUtils.calcSign(expression.instancedHeader, false),
|
|
826
|
+ context.getMethodSignature(expression.instancedHeader),
|
846
|
827
|
Opcodes.ACC_PUBLIC));
|
847
|
828
|
break;
|
848
|
829
|
case AUTOOP_NOTEQUALS:
|
|
@@ -1313,7 +1294,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1313
|
1294
|
javaWriter.pop();
|
1314
|
1295
|
javaWriter.newObject(NullPointerException.class);
|
1315
|
1296
|
javaWriter.dup();
|
1316
|
|
- javaWriter.constant("Tried to convert a null value to nonnull type " + expression.type.accept(JavaTypeClassVisitor.INSTANCE).getSimpleName());
|
|
1297
|
+ javaWriter.constant("Tried to convert a null value to nonnull type " + context.getType(expression.type).getClassName());
|
1317
|
1298
|
javaWriter.invokeSpecial(NullPointerException.class, "<init>", "(Ljava/lang/String;)V");
|
1318
|
1299
|
javaWriter.aThrow();
|
1319
|
1300
|
javaWriter.label(end);
|
|
@@ -1520,13 +1501,6 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1520
|
1501
|
|
1521
|
1502
|
@Override
|
1522
|
1503
|
public Void visitConstructorThisCall(ConstructorThisCallExpression expression) {
|
1523
|
|
- Type type = expression.objectType.accept(JavaTypeVisitor.INSTANCE);
|
1524
|
|
- try {
|
1525
|
|
- type.getInternalName();
|
1526
|
|
- } catch (NullPointerException ex) {
|
1527
|
|
- ex.printStackTrace();
|
1528
|
|
- }
|
1529
|
|
-
|
1530
|
1504
|
javaWriter.loadObject(0);
|
1531
|
1505
|
if (javaWriter.method.javaClass.isEnum()) {
|
1532
|
1506
|
javaWriter.loadObject(1);
|
|
@@ -1536,8 +1510,10 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1536
|
1510
|
for (Expression argument : expression.arguments.arguments) {
|
1537
|
1511
|
argument.accept(this);
|
1538
|
1512
|
}
|
1539
|
|
- String internalName = type.getInternalName();
|
1540
|
|
- javaWriter.invokeSpecial(internalName, "<init>", CompilerUtils.calcDesc(expression.constructor.getHeader(), javaWriter.method.javaClass.isEnum()));
|
|
1513
|
+ String internalName = context.getInternalName(expression.objectType);
|
|
1514
|
+ javaWriter.invokeSpecial(internalName, "<init>", javaWriter.method.javaClass.isEnum()
|
|
1515
|
+ ? context.getEnumConstructorDescriptor(expression.constructor.getHeader())
|
|
1516
|
+ : context.getMethodDescriptor(expression.constructor.getHeader()));
|
1541
|
1517
|
return null;
|
1542
|
1518
|
}
|
1543
|
1519
|
|
|
@@ -1548,38 +1524,37 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1548
|
1524
|
argument.accept(this);
|
1549
|
1525
|
}
|
1550
|
1526
|
//No super calls in enums possible, and that's already handled in the enum constructor itself.
|
1551
|
|
- javaWriter.invokeSpecial(expression.objectType.accept(JavaTypeClassVisitor.INSTANCE), "<init>", CompilerUtils.calcDesc(expression.constructor.getHeader(), false));
|
1552
|
|
-
|
1553
|
|
- CompilerUtils.writeDefaultFieldInitializers(javaWriter, javaWriter.forDefinition, false);
|
|
1527
|
+ javaWriter.invokeSpecial(
|
|
1528
|
+ context.getInternalName(expression.objectType),
|
|
1529
|
+ "<init>",
|
|
1530
|
+ context.getMethodDescriptor(expression.constructor.getHeader()));
|
|
1531
|
+
|
|
1532
|
+ CompilerUtils.writeDefaultFieldInitializers(context, javaWriter, javaWriter.forDefinition, false);
|
1554
|
1533
|
return null;
|
1555
|
1534
|
}
|
1556
|
1535
|
|
1557
|
1536
|
@Override
|
1558
|
1537
|
public Void visitEnumConstant(EnumConstantExpression expression) {
|
1559
|
|
- final Type type = expression.type.accept(JavaTypeVisitor.INSTANCE);
|
1560
|
|
- javaWriter.getStaticField(type.getInternalName(), expression.value.name, type.getDescriptor());
|
|
1538
|
+ javaWriter.getStaticField(context.getInternalName(expression.type), expression.value.name, context.getDescriptor(expression.type));
|
1561
|
1539
|
return null;
|
1562
|
1540
|
}
|
1563
|
1541
|
|
1564
|
1542
|
@Override
|
1565
|
1543
|
public Void visitFunction(FunctionExpression expression) {
|
1566
|
|
- CompilerUtils.tagMethodParameters(expression.header, false);
|
|
1544
|
+ CompilerUtils.tagMethodParameters(context, expression.header, false);
|
1567
|
1545
|
|
1568
|
1546
|
if (expression.header.parameters.length == 0 && expression.body instanceof ReturnStatement && expression.body.hasTag(MatchExpression.class) && expression.closure.captures.isEmpty()) {
|
1569
|
1547
|
((ReturnStatement) expression.body).value.accept(this);
|
1570
|
1548
|
return null;
|
1571
|
1549
|
}
|
1572
|
|
- final String signature = CompilerUtils.calcSign(expression.header, false);
|
1573
|
|
- //final String name = CompilerUtils.getLambdaInterface(expression.header);
|
|
1550
|
+ final String signature = context.getMethodSignature(expression.header);
|
1574
|
1551
|
final String name = CompilerUtils.getLambdaCounter();
|
1575
|
1552
|
|
1576
|
1553
|
final JavaMethodInfo methodInfo = new JavaMethodInfo(javaWriter.method.javaClass, "accept", signature, Opcodes.ACC_PUBLIC);
|
1577
|
1554
|
final ClassWriter lambdaCW = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
|
1578
|
|
- lambdaCW.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, name, null, "java/lang/Object", new String[]{CompilerUtils.getLambdaInterface(expression.header)});
|
|
1555
|
+ lambdaCW.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, name, null, "java/lang/Object", new String[]{JavaSynthesizedClassNamer.createFunctionName(new FunctionTypeID(null, expression.header)).cls.internalName});
|
1579
|
1556
|
final JavaWriter functionWriter = new JavaWriter(lambdaCW, methodInfo, null, signature, null, "java/lang/Override");
|
1580
|
|
-
|
1581
|
|
-
|
1582
|
|
-
|
|
1557
|
+
|
1583
|
1558
|
javaWriter.newObject(name);
|
1584
|
1559
|
javaWriter.dup();
|
1585
|
1560
|
|
|
@@ -1595,9 +1570,9 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1595
|
1570
|
int i = 0;
|
1596
|
1571
|
for (CapturedExpression capture : expression.closure.captures) {
|
1597
|
1572
|
constructorWriter.dup();
|
1598
|
|
- final Type type = capture.type.accept(JavaTypeVisitor.INSTANCE);
|
|
1573
|
+ Type type = context.getType(capture.type);
|
1599
|
1574
|
lambdaCW.visitField(Opcodes.ACC_FINAL | Opcodes.ACC_PRIVATE, "captured" + ++i, type.getDescriptor(), null, null).visitEnd();
|
1600
|
|
-
|
|
1575
|
+
|
1601
|
1576
|
capture.accept(this);
|
1602
|
1577
|
|
1603
|
1578
|
constructorWriter.load(type, i);
|
|
@@ -1612,30 +1587,24 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1612
|
1587
|
constructorWriter.end();
|
1613
|
1588
|
|
1614
|
1589
|
|
1615
|
|
-
|
1616
|
1590
|
functionWriter.start();
|
1617
|
1591
|
|
1618
|
1592
|
|
1619
|
|
- final JavaStatementVisitor CSV = new JavaStatementVisitor(new JavaExpressionVisitor(functionWriter) {
|
1620
|
|
- //@Override
|
|
1593
|
+ final JavaStatementVisitor CSV = new JavaStatementVisitor(context, new JavaExpressionVisitor(context, functionWriter) {
|
|
1594
|
+ @Override
|
1621
|
1595
|
public Void visitGetLocalVariable(GetLocalVariableExpression varExpression) {
|
1622
|
1596
|
final int position = calculateMemberPosition(varExpression, expression) ;
|
1623
|
1597
|
if (position < 0)
|
1624
|
1598
|
throw new CompileException(varExpression.position, CompileExceptionCode.INTERNAL_ERROR, "Captured Statement error");
|
1625
|
1599
|
functionWriter.loadObject(0);
|
1626
|
|
- functionWriter.getField(name, "captured" + position, varExpression.variable.type.accept(JavaTypeVisitor.INSTANCE).getDescriptor());
|
|
1600
|
+ functionWriter.getField(name, "captured" + position, context.getDescriptor(varExpression.variable.type));
|
1627
|
1601
|
return null;
|
1628
|
1602
|
}
|
1629
|
1603
|
});
|
1630
|
|
-
|
1631
|
|
-
|
|
1604
|
+
|
1632
|
1605
|
expression.body.accept(CSV);
|
1633
|
|
-
|
1634
|
|
-
|
|
1606
|
+
|
1635
|
1607
|
functionWriter.ret();
|
1636
|
|
-
|
1637
|
|
-
|
1638
|
|
-
|
1639
|
1608
|
functionWriter.end();
|
1640
|
1609
|
lambdaCW.visitEnd();
|
1641
|
1610
|
|
|
@@ -1665,9 +1634,8 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1665
|
1634
|
|
1666
|
1635
|
private String calcFunctionSignature(LambdaClosure closure) {
|
1667
|
1636
|
StringJoiner joiner = new StringJoiner("", "(", ")V");
|
1668
|
|
-
|
1669
|
1637
|
for (CapturedExpression capture : closure.captures) {
|
1670
|
|
- String descriptor = capture.type.accept(JavaTypeVisitor.INSTANCE).getDescriptor();
|
|
1638
|
+ String descriptor = context.getDescriptor(capture.type);
|
1671
|
1639
|
joiner.add(descriptor);
|
1672
|
1640
|
}
|
1673
|
1641
|
return joiner.toString();
|
|
@@ -1691,7 +1659,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1691
|
1659
|
parameter = new JavaParameterInfo(1, Type.INT_TYPE);
|
1692
|
1660
|
}
|
1693
|
1661
|
|
1694
|
|
- javaWriter.load(expression.parameter.type.accept(JavaTypeVisitor.INSTANCE), parameter.index);
|
|
1662
|
+ javaWriter.load(context.getType(expression.parameter.type), parameter.index);
|
1695
|
1663
|
return null;
|
1696
|
1664
|
}
|
1697
|
1665
|
|
|
@@ -1798,7 +1766,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1798
|
1766
|
case ASSOC_KEYS: {
|
1799
|
1767
|
AssocTypeID type = (AssocTypeID) expression.target.type;
|
1800
|
1768
|
ArrayTypeID result = new ArrayTypeID(null, type.keyType, 1);
|
1801
|
|
- Type resultType = result.accept(JavaTypeVisitor.INSTANCE);
|
|
1769
|
+ Type resultType = context.getType(result);
|
1802
|
1770
|
|
1803
|
1771
|
javaWriter.invokeVirtual(MAP_KEYS);
|
1804
|
1772
|
javaWriter.dup();
|
|
@@ -1811,7 +1779,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1811
|
1779
|
case ASSOC_VALUES: {
|
1812
|
1780
|
AssocTypeID type = (AssocTypeID) expression.target.type;
|
1813
|
1781
|
ArrayTypeID result = new ArrayTypeID(null, type.valueType, 1);
|
1814
|
|
- Type resultType = result.accept(JavaTypeVisitor.INSTANCE);
|
|
1782
|
+ Type resultType = context.getType(result);
|
1815
|
1783
|
|
1816
|
1784
|
javaWriter.invokeVirtual(MAP_VALUES);
|
1817
|
1785
|
javaWriter.dup();
|
|
@@ -1922,14 +1890,14 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1922
|
1890
|
@Override
|
1923
|
1891
|
public Void visitInterfaceCast(InterfaceCastExpression expression) {
|
1924
|
1892
|
expression.value.accept(this);
|
1925
|
|
- javaWriter.checkCast(expression.type.accept(JavaTypeVisitor.INSTANCE));
|
|
1893
|
+ javaWriter.checkCast(context.getDescriptor(expression.type));
|
1926
|
1894
|
return null;
|
1927
|
1895
|
}
|
1928
|
1896
|
|
1929
|
1897
|
@Override
|
1930
|
1898
|
public Void visitIs(IsExpression expression) {
|
1931
|
1899
|
expression.value.accept(this);
|
1932
|
|
- javaWriter.instanceOf(expression.isType.accept(JavaTypeVisitor.INSTANCE));
|
|
1900
|
+ javaWriter.instanceOf(context.getDescriptor(expression.isType));
|
1933
|
1901
|
return null;
|
1934
|
1902
|
}
|
1935
|
1903
|
|
|
@@ -1940,9 +1908,9 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1940
|
1908
|
|
1941
|
1909
|
@Override
|
1942
|
1910
|
public Void visitMap(MapExpression expression) {
|
1943
|
|
- javaWriter.newObject(expression.type.accept(JavaTypeClassVisitor.INSTANCE));
|
|
1911
|
+ javaWriter.newObject("java/util/HashMap");
|
1944
|
1912
|
javaWriter.dup();
|
1945
|
|
- javaWriter.invokeSpecial("java/util/Map", "<init>", "()V");
|
|
1913
|
+ javaWriter.invokeSpecial("java/util/HashMap", "<init>", "()V");
|
1946
|
1914
|
for (int i = 0; i < expression.keys.length; i++) {
|
1947
|
1915
|
javaWriter.dup();
|
1948
|
1916
|
expression.keys[i].accept(this);
|
|
@@ -1963,7 +1931,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
1963
|
1931
|
javaWriter.label(start);
|
1964
|
1932
|
expression.value.accept(this);
|
1965
|
1933
|
if (expression.value.type == BasicTypeID.STRING)
|
1966
|
|
- javaWriter.invokeVirtual(new JavaMethodInfo(OBJECT, "hashCode", "()I", 0));
|
|
1934
|
+ javaWriter.invokeVirtual(new JavaMethodInfo(JavaClass.OBJECT, "hashCode", "()I", 0));
|
1967
|
1935
|
|
1968
|
1936
|
final boolean hasNoDefault = hasNoDefault(expression);
|
1969
|
1937
|
|
|
@@ -2014,18 +1982,20 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2014
|
1982
|
|
2015
|
1983
|
@Override
|
2016
|
1984
|
public Void visitNew(NewExpression expression) {
|
|
1985
|
+ // TODO: this code is incorrect!
|
|
1986
|
+
|
2017
|
1987
|
final String type;
|
2018
|
1988
|
if (expression.type instanceof DefinitionTypeID)
|
2019
|
1989
|
type = ((DefinitionTypeID) expression.type).definition.name;
|
2020
|
1990
|
else
|
2021
|
|
- type = Type.getDescriptor(expression.type.accept(JavaTypeClassVisitor.INSTANCE));
|
|
1991
|
+ type = context.getDescriptor(expression.type);
|
2022
|
1992
|
|
2023
|
1993
|
javaWriter.newObject(type);
|
2024
|
1994
|
javaWriter.dup();
|
2025
|
1995
|
StringBuilder signatureBuilder = new StringBuilder("(");
|
2026
|
1996
|
for (Expression argument : expression.arguments.arguments) {
|
2027
|
1997
|
argument.accept(this);
|
2028
|
|
- signatureBuilder.append(Type.getDescriptor(argument.type.accept(JavaTypeClassVisitor.INSTANCE)));
|
|
1998
|
+ signatureBuilder.append(context.getDescriptor(argument.type));
|
2029
|
1999
|
}
|
2030
|
2000
|
signatureBuilder.append(")V");
|
2031
|
2001
|
javaWriter.invokeSpecial(type, "<init>", signatureBuilder.toString());
|
|
@@ -2073,7 +2043,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2073
|
2043
|
@Override
|
2074
|
2044
|
public Void visitPostCall(PostCallExpression expression) {
|
2075
|
2045
|
expression.target.accept(this);
|
2076
|
|
- javaWriter.dup(expression.type.accept(new JavaTypeVisitor()));
|
|
2046
|
+ javaWriter.dup(context.getType(expression.type));
|
2077
|
2047
|
if (!checkAndExecuteByteCodeImplementation(expression.member) && !checkAndExecuteMethodInfo(expression.member))
|
2078
|
2048
|
throw new IllegalStateException("Call target has no method info!");
|
2079
|
2049
|
|
|
@@ -2083,7 +2053,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2083
|
2053
|
@Override
|
2084
|
2054
|
public Void visitRange(RangeExpression expression) {
|
2085
|
2055
|
// TODO: there are other kinds of ranges also; there should be a Range<T, T> type with creation of synthetic types
|
2086
|
|
- if (expression.from.type.accept(JavaTypeClassVisitor.INSTANCE) != int.class)
|
|
2056
|
+ if (!context.getDescriptor(expression.from.type).equals("I"))
|
2087
|
2057
|
throw new CompileException(expression.position, CompileExceptionCode.INTERNAL_ERROR, "Only integer ranges supported");
|
2088
|
2058
|
|
2089
|
2059
|
javaWriter.newObject(IntRange.class);
|
|
@@ -2131,7 +2101,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2131
|
2101
|
public Void visitSetFunctionParameter(SetFunctionParameterExpression expression) {
|
2132
|
2102
|
expression.value.accept(this);
|
2133
|
2103
|
JavaParameterInfo parameter = expression.parameter.getTag(JavaParameterInfo.class);
|
2134
|
|
- javaWriter.store(expression.type.accept(JavaTypeVisitor.INSTANCE), parameter.index);
|
|
2104
|
+ javaWriter.store(context.getType(expression.type), parameter.index);
|
2135
|
2105
|
return null;
|
2136
|
2106
|
}
|
2137
|
2107
|
|
|
@@ -2337,7 +2307,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2337
|
2307
|
|
2338
|
2308
|
//Will return true if a JavaFieldInfo.class tag exists, and will compile that tag
|
2339
|
2309
|
public boolean checkAndPutFieldInfo(FieldMemberRef field, boolean isStatic) {
|
2340
|
|
- JavaFieldInfo fieldInfo = field.getTag(JavaFieldInfo.class);
|
|
2310
|
+ JavaField fieldInfo = field.getTag(JavaField.class);
|
2341
|
2311
|
if (fieldInfo == null)
|
2342
|
2312
|
return false;
|
2343
|
2313
|
//TODO Remove isStatic
|
|
@@ -2350,7 +2320,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2350
|
2320
|
}
|
2351
|
2321
|
|
2352
|
2322
|
public boolean checkAndGetFieldInfo(ConstMemberRef field, boolean isStatic) {
|
2353
|
|
- JavaFieldInfo fieldInfo = field.getTag(JavaFieldInfo.class);
|
|
2323
|
+ JavaField fieldInfo = field.getTag(JavaField.class);
|
2354
|
2324
|
if (fieldInfo == null)
|
2355
|
2325
|
return false;
|
2356
|
2326
|
|
|
@@ -2359,7 +2329,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
|
2359
|
2329
|
}
|
2360
|
2330
|
|
2361
|
2331
|
public boolean checkAndGetFieldInfo(FieldMemberRef field, boolean isStatic) {
|
2362
|
|
- JavaFieldInfo fieldInfo = field.getTag(JavaFieldInfo.class);
|
|
2332
|
+ JavaField fieldInfo = field.getTag(JavaField.class);
|
2363
|
2333
|
if (fieldInfo == null)
|
2364
|
2334
|
return false;
|
2365
|
2335
|
|