ref.setArguments(arguments);
// need to create a new AnalyzeContextInfo to avoid memory leak
// cachedContextInfo will stay in memory
ref.analyze(new AnalyzeContextInfo(cachedContextInfo));
// Evaluate the function
final Sequence result = ref.eval(contextSequence);
ref.resetState(false);
return result;
}
}