new VariableExpression("super"),
forwarderMethod.getName(),
args
);
superCall.setImplicitThis(false);
CastExpression proxyReceiver = new CastExpression(Traits.GENERATED_PROXY_CLASSNODE, new VariableExpression("this"));
MethodCallExpression getProxy = new MethodCallExpression(proxyReceiver, "getProxyTarget", ArgumentListExpression.EMPTY_ARGUMENTS);
getProxy.setImplicitThis(true);
StaticMethodCallExpression proxyCall = new StaticMethodCallExpression(
ClassHelper.make(InvokerHelper.class),
"invokeMethod",
new ArgumentListExpression(getProxy, new ConstantExpression(forwarderMethod.getName()), new ArrayExpression(ClassHelper.OBJECT_TYPE, args.getExpressions()))
);
IfStatement stmt = new IfStatement(
new BooleanExpression(instanceOfExpr),
new ExpressionStatement(new CastExpression(returnType,proxyCall)),
new ExpressionStatement(superCall)
);
return stmt;
}