}
//the type must be the same, or the type of the value can be implicitly converted
//to that of the reference
for (int i = 0; i < params.size(); i++) {
Reference param = params.get(i);
Object value = values.get(i);
//TODO: why is the list check in here
if(value != null && !(value instanceof List)) {
try {
String targetTypeName = DataTypeManager.getDataTypeName(param.getType());
Expression expr = ResolverUtil.convertExpression(new Constant(value), targetTypeName, metadata);
value = Evaluator.evaluate(expr);
} catch (ExpressionEvaluationException e) {
String msg = QueryPlugin.Util.getString("QueryUtil.Error_executing_conversion_function_to_convert_value", new Integer(i + 1), value, DataTypeManager.getDataTypeName(param.getType())); //$NON-NLS-1$
throw new QueryResolverException(msg);
} catch (QueryResolverException e) {
String msg = QueryPlugin.Util.getString("QueryUtil.Error_executing_conversion_function_to_convert_value", new Integer(i + 1), value, DataTypeManager.getDataTypeName(param.getType())); //$NON-NLS-1$
throw new QueryResolverException(msg);
}
}
if (param.getConstraint() != null) {
param.getConstraint().validate(value);
}
//bind variable
result.setGlobalValue(param.getContextSymbol(), value);
}
context.setVariableContext(result);
}