Program: 23098
Project: 23098
Buggy source:
private List<Base> evaluateFunction(ExecutionContext context,List<Base> focus,ExpressionNode exp) throws FHIRException {
switch (exp.getFunction()) {
case Empty:
    return funcEmpty(context,focus,exp);
case Not:
  return funcNot(context,focus,exp);
case Exists:
return funcExists(context,focus,exp);
case SubsetOf:
return funcSubsetOf(context,focus,exp);
case SupersetOf:
return funcSupersetOf(context,focus,exp);
case IsDistinct:
return funcIsDistinct(context,focus,exp);
case Distinct:
return funcDistinct(context,focus,exp);
case Count:
return funcCount(context,focus,exp);
case Where:
return funcWhere(context,focus,exp);
case Select:
return funcSelect(context,focus,exp);
case All:
return funcAll(context,focus,exp);
case Repeat:
return funcRepeat(context,focus,exp);
case Item:
return funcItem(context,focus,exp);
case As:
return funcAs(context,focus,exp);
case Is:
return funcIs(context,focus,exp);
case Single:
return funcSingle(context,focus,exp);
case First:
return funcFirst(context,focus,exp);
case Last:
return funcLast(context,focus,exp);
case Tail:
return funcTail(context,focus,exp);
case Skip:
return funcSkip(context,focus,exp);
case Take:
return funcTake(context,focus,exp);
case Iif:
return funcIif(context,focus,exp);
case ToInteger:
return funcToInteger(context,focus,exp);
case ToDecimal:
return funcToDecimal(context,focus,exp);
case ToString:
return funcToString(context,focus,exp);
case Substring:
return funcSubstring(context,focus,exp);
case StartsWith:
return funcStartsWith(context,focus,exp);
case EndsWith:
return funcEndsWith(context,focus,exp);
case Matches:
return funcMatches(context,focus,exp);
case ReplaceMatches:
return funcReplaceMatches(context,focus,exp);
case Contains:
return funcContains(context,focus,exp);
case Replace:
return funcReplace(context,focus,exp);
case Length:
return funcLength(context,focus,exp);
case Children:
return funcChildren(context,focus,exp);
case Descendants:
return funcDescendants(context,focus,exp);
case MemberOf:
return funcMemberOf(context,focus,exp);
case Trace:
return funcTrace(context,focus,exp);
case Today:
return funcToday(context,focus,exp);
case Now:
return funcNow(context,focus,exp);
case Resolve:
return funcResolve(context,focus,exp);
case Extension:
return funcExtension(context,focus,exp);
case HasValue:
return funcHasValue(context,focus,exp);
case AliasAs:
return funcAliasAs(context,focus,exp);
case Alias:
return funcAlias(context,focus,exp);
case HtmlChecks:
return funcHtmlChecks(context,focus,exp);
case Custom:
{
List<List<Base>> params=new ArrayList<List<Base>>();
for (ExpressionNode p : exp.getParameters()) params.add(execute(context,focus,p,true));
return hostServices.executeFunction(context.appInfo,exp.getName(),params);
}
default :
throw new Error("String_Node_Str");
}
}

Fixed version (ground truth):
private List<Base> evaluateFunction(ExecutionContext context,List<Base> focus,ExpressionNode exp) throws FHIRException {
switch (exp.getFunction()) {
case Empty:
    return funcEmpty(context,focus,exp);
case Not:
  return funcNot(context,focus,exp);
case Exists:
return funcExists(context,focus,exp);
case SubsetOf:
return funcSubsetOf(context,focus,exp);
case SupersetOf:
return funcSupersetOf(context,focus,exp);
case IsDistinct:
return funcIsDistinct(context,focus,exp);
case Distinct:
return funcDistinct(context,focus,exp);
case Count:
return funcCount(context,focus,exp);
case Where:
return funcWhere(context,focus,exp);
case Select:
return funcSelect(context,focus,exp);
case All:
return funcAll(context,focus,exp);
case Repeat:
return funcRepeat(context,focus,exp);
case Item:
return funcItem(context,focus,exp);
case As:
return funcAs(context,focus,exp);
case OfType:
return funcAs(context,focus,exp);
case Is:
return funcIs(context,focus,exp);
case Single:
return funcSingle(context,focus,exp);
case First:
return funcFirst(context,focus,exp);
case Last:
return funcLast(context,focus,exp);
case Tail:
return funcTail(context,focus,exp);
case Skip:
return funcSkip(context,focus,exp);
case Take:
return funcTake(context,focus,exp);
case Iif:
return funcIif(context,focus,exp);
case ToInteger:
return funcToInteger(context,focus,exp);
case ToDecimal:
return funcToDecimal(context,focus,exp);
case ToString:
return funcToString(context,focus,exp);
case Substring:
return funcSubstring(context,focus,exp);
case StartsWith:
return funcStartsWith(context,focus,exp);
case EndsWith:
return funcEndsWith(context,focus,exp);
case Matches:
return funcMatches(context,focus,exp);
case ReplaceMatches:
return funcReplaceMatches(context,focus,exp);
case Contains:
return funcContains(context,focus,exp);
case Replace:
return funcReplace(context,focus,exp);
case Length:
return funcLength(context,focus,exp);
case Children:
return funcChildren(context,focus,exp);
case Descendants:
return funcDescendants(context,focus,exp);
case MemberOf:
return funcMemberOf(context,focus,exp);
case Trace:
return funcTrace(context,focus,exp);
case Today:
return funcToday(context,focus,exp);
case Now:
return funcNow(context,focus,exp);
case Resolve:
return funcResolve(context,focus,exp);
case Extension:
return funcExtension(context,focus,exp);
case HasValue:
return funcHasValue(context,focus,exp);
case AliasAs:
return funcAliasAs(context,focus,exp);
case Alias:
return funcAlias(context,focus,exp);
case HtmlChecks:
return funcHtmlChecks(context,focus,exp);
case Custom:
{
List<List<Base>> params=new ArrayList<List<Base>>();
for (ExpressionNode p : exp.getParameters()) params.add(execute(context,focus,p,true));
return hostServices.executeFunction(context.appInfo,exp.getName(),params);
}
default :
throw new Error("String_Node_Str");
}
}