final ArgumentListExpression args = new ArgumentListExpression();
final Parameter[] params = original.getParameters();
final Parameter[] newParams = new Parameter[params.length];
args.addExpression(new VariableExpression("this"));
args.addExpression(new ConstantExpression(original.getName()));
for (int i = 0; i < newParams.length; i++) {
final Parameter newParam = new Parameter(nonGeneric(params[i].getType()), params[i].getName());
newParam.setInitialExpression(params[i].getInitialExpression());
newParams[i] = newParam;
args.addExpression(new VariableExpression(newParam));
}
final MethodNode newMethod = owner.addMethod(findSuitablePrivateMethodName(owner, original),
Modifier.FINAL & Modifier.PRIVATE,
new ClassNode(Object.class),
newParams,
original.getExceptions(),
original.getCode());
newMethod.setGenericsTypes(original.getGenericsTypes());
final String submitMethodName = blocking ? "submitAndWait" : "submit";
original.setCode(new ExpressionStatement(
new MethodCallExpression(
new VariableExpression(actorNode), submitMethodName, args)
));
}