Program: 112239
Project: 112239
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest,BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException {
  SearchParameterMap retVal=new SearchParameterMap();
  for (  String next : theRequest.getParameters().keySet()) {
    String qualifier=null;
    String qualifiedParamName=next;
    String unqualifiedParamName=next;
    RuntimeSearchParam param=myNameToParam.get(next);
    if (param == null) {
      int colonIndex=next.indexOf(':');
      int dotIndex=next.indexOf('.');
      if (colonIndex != -1 || dotIndex != -1) {
        int index;
        if (colonIndex != -1 && dotIndex != -1) {
          index=Math.min(colonIndex,dotIndex);
        }
 else {
          index=(colonIndex != -1) ? colonIndex : dotIndex;
        }
        qualifier=next.substring(index);
        next=next.substring(0,index);
        unqualifiedParamName=next;
        param=myNameToParam.get(next);
      }
    }
    if (param != null) {
      for (      String nextValue : theRequest.getParameters().get(qualifiedParamName)) {
        QualifiedParamList paramList=QualifiedParamList.splitQueryStringByCommasIgnoreEscape(qualifier,nextValue);
        FhirContext ctx=theRequest.getServer().getFhirContext();
switch (param.getParamType()) {
case COMPOSITE:
          Class<? extends IQueryParameterType> left=toParamType(param.getCompositeOf().get(0));
        Class<? extends IQueryParameterType> right=toParamType(param.getCompositeOf().get(0));
      @SuppressWarnings({"String_Node_Str"}) CompositeOrListParam compositeOrListParam=new CompositeOrListParam(left,right);
    compositeOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
  retVal.add(next,compositeOrListParam);
break;
case DATE:
DateOrListParam dateOrListParam=new DateOrListParam();
dateOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,dateOrListParam);
break;
case NUMBER:
NumberOrListParam numberOrListParam=new NumberOrListParam();
numberOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,numberOrListParam);
break;
case QUANTITY:
QuantityOrListParam quantityOrListParam=new QuantityOrListParam();
quantityOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,quantityOrListParam);
break;
case REFERENCE:
ReferenceOrListParam referenceOrListParam=new ReferenceOrListParam();
referenceOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,referenceOrListParam);
break;
case STRING:
StringOrListParam stringOrListParam=new StringOrListParam();
stringOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,stringOrListParam);
break;
case TOKEN:
TokenOrListParam tokenOrListParam=new TokenOrListParam();
tokenOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,tokenOrListParam);
break;
case URI:
UriOrListParam uriOrListParam=new UriOrListParam();
uriOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,uriOrListParam);
break;
}
}
}
}
return retVal;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest,BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException {
  SearchParameterMap retVal=new SearchParameterMap();
  for (  String next : theRequest.getParameters().keySet()) {
    String qualifier=null;
    String qualifiedParamName=next;
    String unqualifiedParamName=next;
    RuntimeSearchParam param=myNameToParam.get(next);
    if (param == null) {
      int colonIndex=next.indexOf(':');
      int dotIndex=next.indexOf('.');
      if (colonIndex != -1 || dotIndex != -1) {
        int index;
        if (colonIndex != -1 && dotIndex != -1) {
          index=Math.min(colonIndex,dotIndex);
        }
 else {
          index=(colonIndex != -1) ? colonIndex : dotIndex;
        }
        qualifier=next.substring(index);
        next=next.substring(0,index);
        unqualifiedParamName=next;
        param=myNameToParam.get(next);
      }
    }
    if (param != null) {
      for (      String nextValue : theRequest.getParameters().get(qualifiedParamName)) {
        QualifiedParamList paramList=QualifiedParamList.splitQueryStringByCommasIgnoreEscape(qualifier,nextValue);
        FhirContext ctx=theRequest.getServer().getFhirContext();
switch (param.getParamType()) {
case COMPOSITE:
          Class<? extends IQueryParameterType> left=toParamType(param.getCompositeOf().get(0));
        Class<? extends IQueryParameterType> right=toParamType(param.getCompositeOf().get(0));
      @SuppressWarnings({"String_Node_Str"}) CompositeOrListParam compositeOrListParam=new CompositeOrListParam(left,right);
    compositeOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
  retVal.add(next,compositeOrListParam);
break;
case DATE:
DateOrListParam dateOrListParam=new DateOrListParam();
dateOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,dateOrListParam);
break;
case NUMBER:
NumberOrListParam numberOrListParam=new NumberOrListParam();
numberOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,numberOrListParam);
break;
case QUANTITY:
QuantityOrListParam quantityOrListParam=new QuantityOrListParam();
quantityOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,quantityOrListParam);
break;
case REFERENCE:
ReferenceOrListParam referenceOrListParam=new ReferenceOrListParam();
referenceOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,referenceOrListParam);
break;
case STRING:
StringOrListParam stringOrListParam=new StringOrListParam();
stringOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,stringOrListParam);
break;
case TOKEN:
TokenOrListParam tokenOrListParam=new TokenOrListParam();
tokenOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,tokenOrListParam);
break;
case URI:
UriOrListParam uriOrListParam=new UriOrListParam();
uriOrListParam.setValuesAsQueryTokens(ctx,unqualifiedParamName,paramList);
retVal.add(next,uriOrListParam);
break;
case HAS:
break;
}
}
}
}
return retVal;
}