Program: 24061
Project: 24061
Buggy source:
public SearchParameter makeSearchParam(StructureDefinition p,String id,String rn,SearchParameterDefn spd) throws Exception {
  SearchParameter sp=new SearchParameter();
  sp.setId(id.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  sp.setUrl("String_Node_Str" + sp.getId());
  if (context.getSearchParameters().containsKey(sp.getUrl()))   throw new Exception("String_Node_Str" + sp.getUrl());
  context.getSearchParameters().put(sp.getUrl(),sp);
  sp.setName(spd.getCode());
  sp.setCode(spd.getCode());
  sp.setDate(genDate.getTime());
  sp.setPublisher(p.getPublisher());
  definitions.addNs(sp.getUrl(),"String_Node_Str" + sp.getName(),rn.toLowerCase() + "String_Node_Str");
  for (  StructureDefinitionContactComponent tc : p.getContact()) {
    SearchParameterContactComponent t=sp.addContact();
    t.setNameElement(tc.getNameElement().copy());
    for (    ContactPoint ts : tc.getTelecom())     t.getTelecom().add(ts.copy());
  }
  if (p.hasConstrainedType())   sp.setBase(p.getConstrainedType());
 else   sp.setBase(p.getName());
  if (!definitions.hasResource(sp.getBase()) && !sp.getBase().equals("String_Node_Str"))   throw new Exception("String_Node_Str" + sp.getBase());
  sp.setType(getSearchParamType(spd.getType()));
  sp.setDescription(spd.getDescription());
  for (  String s : spd.getExpressions())   ToolingExtensions.addStringExtension(sp,ToolingExtensions.EXT_SEARCH_EXPRESSION,s);
  String xpath=new XPathQueryGenerator(this.definitions,null,null).generateXpath(spd.getPaths());
  if (xpath != null) {
    if (xpath.contains("String_Node_Str"))     xpath=convertToXpath(xpath);
    sp.setXpath(xpath);
    sp.setXpathUsage(spd.getxPathUsage());
  }
  for (  String target : spd.getWorkingTargets()) {
    if ("String_Node_Str".equals(target) == true) {
      for (      String resourceName : definitions.sortedResourceNames())       sp.addTarget(resourceName);
    }
 else     sp.addTarget(target);
  }
  return sp;
}

Fixed version (ground truth):
public SearchParameter makeSearchParam(StructureDefinition p,String id,String rn,SearchParameterDefn spd) throws Exception {
  SearchParameter sp=new SearchParameter();
  sp.setId(id.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  sp.setUrl("String_Node_Str" + sp.getId());
  if (context.getSearchParameters().containsKey(sp.getUrl()))   throw new Exception("String_Node_Str" + sp.getUrl());
  context.getSearchParameters().put(sp.getUrl(),sp);
  sp.setName(spd.getCode());
  sp.setCode(spd.getCode());
  sp.setDate(genDate.getTime());
  sp.setPublisher(p.getPublisher());
  definitions.addNs(sp.getUrl(),"String_Node_Str" + sp.getName(),rn.toLowerCase() + "String_Node_Str");
  for (  StructureDefinitionContactComponent tc : p.getContact()) {
    SearchParameterContactComponent t=sp.addContact();
    t.setNameElement(tc.getNameElement().copy());
    for (    ContactPoint ts : tc.getTelecom())     t.getTelecom().add(ts.copy());
  }
  if (p.hasConstrainedType())   sp.setBase(p.getConstrainedType());
 else   sp.setBase(p.getName());
  if (!definitions.hasResource(sp.getBase()) && !sp.getBase().equals("String_Node_Str"))   throw new Exception("String_Node_Str" + sp.getBase());
  sp.setType(getSearchParamType(spd.getType()));
  sp.setDescription(spd.getDescription());
  if (!Utilities.noString(spd.getExpression()))   ToolingExtensions.addStringExtension(sp,ToolingExtensions.EXT_SEARCH_EXPRESSION,spd.getExpression());
  String xpath=new XPathQueryGenerator(this.definitions,null,null).generateXpath(spd.getPaths());
  if (xpath != null) {
    if (xpath.contains("String_Node_Str"))     xpath=convertToXpath(xpath);
    sp.setXpath(xpath);
    sp.setXpathUsage(spd.getxPathUsage());
  }
  for (  String target : spd.getWorkingTargets()) {
    if ("String_Node_Str".equals(target) == true) {
      for (      String resourceName : definitions.sortedResourceNames())       sp.addTarget(resourceName);
    }
 else     sp.addTarget(target);
  }
  return sp;
}