Program: 23097
Project: 23097
Buggy source:
private boolean checkParameters(FHIRLexer lexer,SourceLocation location,ExpressionNode exp,FunctionDetails details) throws FHIRLexerException {
switch (exp.getFunction()) {
case Empty:
    return checkParamCount(lexer,location,exp,0);
case Not:
  return checkParamCount(lexer,location,exp,0);
case Exists:
return checkParamCount(lexer,location,exp,0);
case SubsetOf:
return checkParamCount(lexer,location,exp,1);
case SupersetOf:
return checkParamCount(lexer,location,exp,1);
case IsDistinct:
return checkParamCount(lexer,location,exp,0);
case Distinct:
return checkParamCount(lexer,location,exp,0);
case Count:
return checkParamCount(lexer,location,exp,0);
case Where:
return checkParamCount(lexer,location,exp,1);
case Select:
return checkParamCount(lexer,location,exp,1);
case All:
return checkParamCount(lexer,location,exp,0,1);
case Repeat:
return checkParamCount(lexer,location,exp,1);
case Item:
return checkParamCount(lexer,location,exp,1);
case As:
return checkParamCount(lexer,location,exp,1);
case Is:
return checkParamCount(lexer,location,exp,1);
case Single:
return checkParamCount(lexer,location,exp,0);
case First:
return checkParamCount(lexer,location,exp,0);
case Last:
return checkParamCount(lexer,location,exp,0);
case Tail:
return checkParamCount(lexer,location,exp,0);
case Skip:
return checkParamCount(lexer,location,exp,1);
case Take:
return checkParamCount(lexer,location,exp,1);
case Iif:
return checkParamCount(lexer,location,exp,2,3);
case ToInteger:
return checkParamCount(lexer,location,exp,0);
case ToDecimal:
return checkParamCount(lexer,location,exp,0);
case ToString:
return checkParamCount(lexer,location,exp,0);
case Substring:
return checkParamCount(lexer,location,exp,1,2);
case StartsWith:
return checkParamCount(lexer,location,exp,1);
case EndsWith:
return checkParamCount(lexer,location,exp,1);
case Matches:
return checkParamCount(lexer,location,exp,1);
case ReplaceMatches:
return checkParamCount(lexer,location,exp,2);
case Contains:
return checkParamCount(lexer,location,exp,1);
case Replace:
return checkParamCount(lexer,location,exp,2);
case Length:
return checkParamCount(lexer,location,exp,0);
case Children:
return checkParamCount(lexer,location,exp,0);
case Descendants:
return checkParamCount(lexer,location,exp,0);
case MemberOf:
return checkParamCount(lexer,location,exp,1);
case Trace:
return checkParamCount(lexer,location,exp,1);
case Today:
return checkParamCount(lexer,location,exp,0);
case Now:
return checkParamCount(lexer,location,exp,0);
case Resolve:
return checkParamCount(lexer,location,exp,0);
case Extension:
return checkParamCount(lexer,location,exp,1);
case HasValue:
return checkParamCount(lexer,location,exp,0);
case Alias:
return checkParamCount(lexer,location,exp,1);
case AliasAs:
return checkParamCount(lexer,location,exp,1);
case HtmlChecks:
return checkParamCount(lexer,location,exp,0);
case Custom:
return checkParamCount(lexer,location,exp,details.getMinParameters(),details.getMaxParameters());
}
return false;
}

Fixed version (ground truth):
private boolean checkParameters(FHIRLexer lexer,SourceLocation location,ExpressionNode exp,FunctionDetails details) throws FHIRLexerException {
switch (exp.getFunction()) {
case Empty:
    return checkParamCount(lexer,location,exp,0);
case Not:
  return checkParamCount(lexer,location,exp,0);
case Exists:
return checkParamCount(lexer,location,exp,0);
case SubsetOf:
return checkParamCount(lexer,location,exp,1);
case SupersetOf:
return checkParamCount(lexer,location,exp,1);
case IsDistinct:
return checkParamCount(lexer,location,exp,0);
case Distinct:
return checkParamCount(lexer,location,exp,0);
case Count:
return checkParamCount(lexer,location,exp,0);
case Where:
return checkParamCount(lexer,location,exp,1);
case Select:
return checkParamCount(lexer,location,exp,1);
case All:
return checkParamCount(lexer,location,exp,0,1);
case Repeat:
return checkParamCount(lexer,location,exp,1);
case Item:
return checkParamCount(lexer,location,exp,1);
case As:
return checkParamCount(lexer,location,exp,1);
case OfType:
return checkParamCount(lexer,location,exp,1);
case Is:
return checkParamCount(lexer,location,exp,1);
case Single:
return checkParamCount(lexer,location,exp,0);
case First:
return checkParamCount(lexer,location,exp,0);
case Last:
return checkParamCount(lexer,location,exp,0);
case Tail:
return checkParamCount(lexer,location,exp,0);
case Skip:
return checkParamCount(lexer,location,exp,1);
case Take:
return checkParamCount(lexer,location,exp,1);
case Iif:
return checkParamCount(lexer,location,exp,2,3);
case ToInteger:
return checkParamCount(lexer,location,exp,0);
case ToDecimal:
return checkParamCount(lexer,location,exp,0);
case ToString:
return checkParamCount(lexer,location,exp,0);
case Substring:
return checkParamCount(lexer,location,exp,1,2);
case StartsWith:
return checkParamCount(lexer,location,exp,1);
case EndsWith:
return checkParamCount(lexer,location,exp,1);
case Matches:
return checkParamCount(lexer,location,exp,1);
case ReplaceMatches:
return checkParamCount(lexer,location,exp,2);
case Contains:
return checkParamCount(lexer,location,exp,1);
case Replace:
return checkParamCount(lexer,location,exp,2);
case Length:
return checkParamCount(lexer,location,exp,0);
case Children:
return checkParamCount(lexer,location,exp,0);
case Descendants:
return checkParamCount(lexer,location,exp,0);
case MemberOf:
return checkParamCount(lexer,location,exp,1);
case Trace:
return checkParamCount(lexer,location,exp,1);
case Today:
return checkParamCount(lexer,location,exp,0);
case Now:
return checkParamCount(lexer,location,exp,0);
case Resolve:
return checkParamCount(lexer,location,exp,0);
case Extension:
return checkParamCount(lexer,location,exp,1);
case HasValue:
return checkParamCount(lexer,location,exp,0);
case Alias:
return checkParamCount(lexer,location,exp,1);
case AliasAs:
return checkParamCount(lexer,location,exp,1);
case HtmlChecks:
return checkParamCount(lexer,location,exp,0);
case Custom:
return checkParamCount(lexer,location,exp,details.getMinParameters(),details.getMaxParameters());
}
return false;
}