/*
* Handle virtual overrides by finding the method that we would
* normally invoke and using its declaring class as the dispatch
* target.
*/
JMethod implementingMethod;
while ((implementingMethod = findOverloadUsingErasure(
implementingType, intfMethod)) == null) {
implementingType = implementingType.getSuperclass();
}
// implementingmethod and implementingType cannot be null here
/*
* Create a pseudo-method declaration for the interface method. This
* should look something like
*
* ReturnType method$ (ParamType, ParamType)
*
* This must be kept in sync with the WriteJsoImpl class.
*/
{
String decl = getBinaryOrPrimitiveName(intfMethod.getReturnType().getErasedType())
+ " " + intfMethod.getName() + "(";
for (JParameter param : intfMethod.getParameters()) {
decl += ",";
decl += getBinaryOrPrimitiveName(param.getType().getErasedType());
}
decl += ")";
com.google.gwt.dev.asm.commons.Method declaration = com.google.gwt.dev.asm.commons.Method.getMethod(decl);
addToMap(mangledNamesToDeclarations, mangledName, declaration);
}
/*
* Cook up the a pseudo-method declaration for the concrete type. This
* should look something like
*
* ReturnType method$ (JsoType, ParamType, ParamType)
*
* This must be kept in sync with the WriteJsoImpl class.
*/
{
String returnName = getBinaryOrPrimitiveName(implementingMethod.getReturnType().getErasedType());
String jsoName = getBinaryOrPrimitiveName(implementingType);
String decl = returnName + " " + intfMethod.getName() + "$ ("
+ jsoName;
for (JParameter param : implementingMethod.getParameters()) {
decl += ",";
decl += getBinaryOrPrimitiveName(param.getType().getErasedType());
}
decl += ")";