methodParms.add(Parameter.of(parmType, "a" + i));
}
}
final DefParameters defParameters = DefParameters.fromParameters(methodParms);
final BlockBuilder methBody = builder.publicMethod(method.getReturnType(), method.getName())
.parameters(defParameters)
.throws_(method.getCheckedExceptions());
final List<Parameter> parms = defParameters.getParameters();
final Statement[] statementVars = new Statement[parms.size()];
for (int i = 0; i < parms.size(); i++) {
statementVars[i] = loadVariable(parms.get(i).getName());
}
if (!method.isPublic()) {
PrivateAccessUtil.addPrivateAccessStubs(privateAccessorType, builder, method, new Modifier[0]);
final Statement[] privateAccessStmts = new Statement[statementVars.length + 1];
privateAccessStmts[0] = Refs.get(proxyVar);
for (int i = 0; i < statementVars.length; i++) {
privateAccessStmts[i + 1] = statementVars[i];
}
if (method.getReturnType().isVoid()) {
methBody._(loadVariable("this").invoke(PrivateAccessUtil.getPrivateMethodName(method), privateAccessStmts));
}
else {
methBody._(loadVariable("this").invoke(PrivateAccessUtil.getPrivateMethodName(method), privateAccessStmts).returnValue());
}
}
else {
if (method.getReturnType().isVoid()) {
methBody._(loadVariable(proxyVar).invoke(method, statementVars));
}
else {
methBody._(loadVariable(proxyVar).invoke(method, statementVars).returnValue());
}
}
methBody.finish();
}
if (renderEqualsAndHash) {
// implement hashCode()
builder.publicMethod(int.class, "hashCode").body()