ThreadContext context = runtime.getCurrentContext();
try {
// Construct local variables based on parameter names passed in
String[] names = new String[paramNames.size()];
paramNames.toArray(names);
context.preBsfApply(names);
// Populate values for the parameter names
DynamicScope scope = context.getCurrentScope();
for (int i = 0, size = args.size(); i < size; i++) {
scope.setValue(i, JavaEmbedUtils.javaToRuby(runtime, args.get(i)), 0);