if (method == rebindCreateMethod) {
assert (x.getArgs().size() == 1);
JExpression arg = x.getArgs().get(0);
assert (arg instanceof JClassLiteral);
JClassLiteral classLiteral = (JClassLiteral) arg;
JClassType classType = program.rebind(classLiteral.getRefType());
/*
* Find the appropriate (noArg) constructor. In our AST, constructors
* are instance methods that should be qualified with a new expression.
*/
JMethod noArgCtor = null;
for (int i = 0; i < classType.methods.size(); ++i) {
JMethod ctor = classType.methods.get(i);
if (ctor.getName().equals(classType.getShortName())) {
if (ctor.params.size() == 0) {
noArgCtor = ctor;
}
}
}