public static void checkDuplicateParametersInRoutine(Routine routine, String parameterName, Parameter.Direction direction)
{
if (direction == Parameter.Direction.RETURN) {
if (routine.getReturnValue() != null) {
throw new DuplicateParameterNameException(routine.getName(), "return value");
}
}
else {
if (routine.getNamedParameter(parameterName) != null) {
throw new DuplicateParameterNameException(routine.getName(), parameterName);
}
}
}