@Inject
IJvmModelAssociations jvmModelAssociations;
@Override
protected Object invokeOperation(JvmOperation operation, Object receiver, List<Object> argumentValues, IEvaluationContext c, CancelIndicator indicator) {
XMethodDeclaration m = getMethodDeclaration(operation);
if (m != null) {
IEvaluationContext context = c.fork();
int index = 0;
for (JvmFormalParameter p : m.getParameters()) {
context.newValue(QualifiedName.create(p.getName()), argumentValues.get(index));
index++;
}
IEvaluationResult result = evaluate(m.getBody(), context, indicator);
if (result.getException() != null) {
result.getException().printStackTrace();
throw new EvaluationException(result.getException());
}
return result.getResult();