}
}
// TODO (cromwellian): Move to GwtAstBuilder eventually
if (method.getSpecialization() != null) {
Specialization specialization = method.getSpecialization();
List<JType> resolvedParams = new ArrayList<JType>();
if (specialization.getParams() == null) {
logger.log(Type.WARN, "Forgot to specify params= attribute on "
+ "method " + method.getSignature());
method.removeSpecialization();
} else {
for (JType param : specialization.getParams()) {
resolvedParams.add(translate(param));
}
}
JType resolvedReturn = null;
if (specialization.getReturns() != null) {
resolvedReturn = translate(specialization.getReturns());
}
JMethod targetMethod = program.typeOracle
.getMethodBySignature((JClassType) method.getEnclosingType()
, specialization.getTargetSignature(method));
if (targetMethod != null) {
flowInto(targetMethod);
specialization.resolve(resolvedParams, resolvedReturn,
targetMethod);
} else {
if (specialization.getTarget() == null ||
"".equals(specialization.getTarget())) {
logger.log(Type.WARN, "Unable to locate @SpecializeMethod target, "
+ " forgot to specify target= attribute on method " +
method.getSignature());
} else {
logger.log(Type.WARN, "Unable to locate @SpecializeMethod target "
+ specialization.getTargetSignature(method) + " for method " +
method.getSignature());
}
method.removeSpecialization();
}
}