JExpression arg = x.getArgs().get(0);
assert (arg instanceof JClassLiteral);
JClassLiteral classLiteral = (JClassLiteral) arg;
JReferenceType sourceType = (JReferenceType) classLiteral.getRefType();
List<JClassType> allRebindResults = getAllPossibleRebindResults(sourceType);
JGwtCreate gwtCreate = new JGwtCreate(x.getSourceInfo(), sourceType,
allRebindResults, program.getTypeJavaLangObject(), currentClass);
if (allRebindResults.size() == 1) {
// Just replace with the instantiation expression.
ctx.replaceMe(gwtCreate.getInstantiationExpressions().get(0));
} else {
ctx.replaceMe(gwtCreate);
}
}