|
@@ -221,7 +221,11 @@ public abstract class JavaContext {
|
221
|
221
|
}
|
222
|
222
|
|
223
|
223
|
public String getMethodDescriptor(FunctionHeader header) {
|
224
|
|
- return getMethodDescriptor(header, false);
|
|
224
|
+ return getMethodDescriptor(header, false, "");
|
|
225
|
+ }
|
|
226
|
+
|
|
227
|
+ public String getMethodDescriptorExpansion(FunctionHeader header, StoredType expandedType) {
|
|
228
|
+ return getMethodDescriptor(header, false, getDescriptor(expandedType));
|
225
|
229
|
}
|
226
|
230
|
|
227
|
231
|
public String getMethodSignature(FunctionHeader header) {
|
|
@@ -229,7 +233,7 @@ public abstract class JavaContext {
|
229
|
233
|
}
|
230
|
234
|
|
231
|
235
|
public String getEnumConstructorDescriptor(FunctionHeader header) {
|
232
|
|
- return getMethodDescriptor(header, true);
|
|
236
|
+ return getMethodDescriptor(header, true, "");
|
233
|
237
|
}
|
234
|
238
|
|
235
|
239
|
public JavaSynthesizedFunctionInstance getFunction(FunctionTypeID type) {
|
|
@@ -339,14 +343,25 @@ public abstract class JavaContext {
|
339
|
343
|
return new JavaSynthesizedClass(range.cls, new TypeID[] { type.baseType.type });
|
340
|
344
|
}
|
341
|
345
|
}
|
342
|
|
-
|
343
|
|
- private String getMethodDescriptor(FunctionHeader header, boolean isEnumConstructor) {
|
|
346
|
+
|
|
347
|
+ /**
|
|
348
|
+ * @param header Function Header
|
|
349
|
+ * @param isEnumConstructor If this is an enum constructor, add String, int as parameters
|
|
350
|
+ * @param expandedType If this is for an expanded type, add the type at the beginning.
|
|
351
|
+ * Can be null or an empty string if this is not an expansion method header
|
|
352
|
+ * @return Method descriptor {@code (<LClass;*No.TypeParameters><LString;I if enum><expandedType><headerTypes>)<retType> }
|
|
353
|
+ */
|
|
354
|
+ private String getMethodDescriptor(FunctionHeader header, boolean isEnumConstructor, String expandedType) {
|
344
|
355
|
StringBuilder descBuilder = new StringBuilder("(");
|
345
|
356
|
for (int i = 0; i < header.getNumberOfTypeParameters(); i++)
|
346
|
357
|
descBuilder.append("Ljava/lang/Class;");
|
347
|
358
|
|
348
|
359
|
if (isEnumConstructor)
|
349
|
360
|
descBuilder.append("Ljava/lang/String;I");
|
|
361
|
+
|
|
362
|
+ //TODO: Put this earlier? We'd need to agree on one...
|
|
363
|
+ if(expandedType != null)
|
|
364
|
+ descBuilder.append(expandedType);
|
350
|
365
|
|
351
|
366
|
for (FunctionParameter parameter : header.parameters) {
|
352
|
367
|
descBuilder.append(getDescriptor(parameter.type));
|