nus-yam/ex-repair huggingface dataset:
Program: 23336
Project: 23336
Buggy source:
public org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  if (advisor.ignoreEntry(src))   return null;
  org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt=new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())   tgt.addLink(convertBundleLinkComponent(t));
  tgt.setFullUrl(src.getFullUrl());
  org.hl7.fhir.dstu2.model.Resource res=advisor.convert(src.getResource());
  if (res == null)   res=convertResource(src.getResource());
  tgt.setResource(res);
  tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
  tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
  tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  if (advisor.ignoreEntry(src))   return null;
  org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt=new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())   tgt.addLink(convertBundleLinkComponent(t));
  tgt.setFullUrl(src.getFullUrl());
  org.hl7.fhir.dstu2.model.Resource res=advisor.convert(src.getResource());
  if (res == null)   res=convertResource(src.getResource());
  tgt.setResource(res);
  if (src.hasSearch())   tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
  if (src.hasRequest())   tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
  if (src.hasResponse())   tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
  return tgt;
}
Program: 23337
Project: 23337
Buggy source:
public void copyResource(org.hl7.fhir.dstu3.model.Resource src,org.hl7.fhir.dstu2.model.Resource tgt) throws FHIRException {
  tgt.setId(src.getId());
  tgt.setMeta(convertMeta(src.getMeta()));
  tgt.setImplicitRules(src.getImplicitRules());
  tgt.setLanguage(src.getLanguage());
}

Fixed version (ground truth):
public void copyResource(org.hl7.fhir.dstu3.model.Resource src,org.hl7.fhir.dstu2.model.Resource tgt) throws FHIRException {
  tgt.setId(src.getId());
  if (src.hasMeta())   tgt.setMeta(convertMeta(src.getMeta()));
  if (src.hasImplicitRules())   tgt.setImplicitRules(src.getImplicitRules());
  if (src.hasLanguage())   tgt.setLanguage(src.getLanguage());
}
Program: 23338
Project: 23338
Buggy source:
public org.hl7.fhir.dstu2.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Identifier tgt=new org.hl7.fhir.dstu2.model.Identifier();
  copyElement(src,tgt);
  tgt.setUse(convertIdentifierUse(src.getUse()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setSystem(src.getSystem());
  tgt.setValue(src.getValue());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setAssigner(convertReference(src.getAssigner()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Identifier tgt=new org.hl7.fhir.dstu2.model.Identifier();
  copyElement(src,tgt);
  if (src.hasUse())   tgt.setUse(convertIdentifierUse(src.getUse()));
  if (src.hasType())   tgt.setType(convertCodeableConcept(src.getType()));
  if (src.hasSystem())   tgt.setSystem(src.getSystem());
  if (src.hasValue())   tgt.setValue(src.getValue());
  if (src.hasPeriod())   tgt.setPeriod(convertPeriod(src.getPeriod()));
  if (src.hasAssigner())   tgt.setAssigner(convertReference(src.getAssigner()));
  return tgt;
}
Program: 23339
Project: 23339
Buggy source:
public org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Bundle tgt=new org.hl7.fhir.dstu2.model.Bundle();
  copyResource(src,tgt);
  tgt.setType(convertBundleType(src.getType()));
  if (src.hasTotal())   tgt.setTotal(src.getTotal());
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())   tgt.addLink(convertBundleLinkComponent(t));
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry())   tgt.addEntry(convertBundleEntryComponent(t));
  tgt.setSignature(convertSignature(src.getSignature()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Bundle tgt=new org.hl7.fhir.dstu2.model.Bundle();
  copyResource(src,tgt);
  tgt.setType(convertBundleType(src.getType()));
  if (src.hasTotal())   tgt.setTotal(src.getTotal());
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())   tgt.addLink(convertBundleLinkComponent(t));
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry())   tgt.addEntry(convertBundleEntryComponent(t));
  if (src.hasSignature())   tgt.setSignature(convertSignature(src.getSignature()));
  return tgt;
}
Program: 23340
Project: 23340
Buggy source:
private static void copyResource(org.hl7.fhir.dstu3.model.Resource src,org.hl7.fhir.dstu2016may.model.Resource tgt) throws FHIRException {
  if (src.hasId())   tgt.setId(src.getId());
  tgt.setMeta(convertMeta(src.getMeta()));
  if (src.hasImplicitRules())   tgt.setImplicitRules(src.getImplicitRules());
  if (src.hasLanguage())   tgt.setLanguage(src.getLanguage());
}

Fixed version (ground truth):
private static void copyResource(org.hl7.fhir.dstu3.model.Resource src,org.hl7.fhir.dstu2016may.model.Resource tgt) throws FHIRException {
  if (src.hasId())   tgt.setId(src.getId());
  if (src.hasMeta())   tgt.setMeta(convertMeta(src.getMeta()));
  if (src.hasImplicitRules())   tgt.setImplicitRules(src.getImplicitRules());
  if (src.hasLanguage())   tgt.setLanguage(src.getLanguage());
}
Program: 23344
Project: 23344
Buggy source:
private static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src,org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
  copyResource(src,tgt);
  tgt.setText(convertNarrative(src.getText()));
  for (  org.hl7.fhir.dstu3.model.Resource t : src.getContained())   tgt.addContained(convertResource(t));
  for (  org.hl7.fhir.dstu3.model.Extension t : src.getExtension())   tgt.addExtension(convertExtension(t));
  for (  org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension())   tgt.addModifierExtension(convertExtension(t));
}

Fixed version (ground truth):
private static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src,org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
  copyResource(src,tgt);
  if (src.hasText())   tgt.setText(convertNarrative(src.getText()));
  for (  org.hl7.fhir.dstu3.model.Resource t : src.getContained())   tgt.addContained(convertResource(t));
  for (  org.hl7.fhir.dstu3.model.Extension t : src.getExtension())   tgt.addExtension(convertExtension(t));
  for (  org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension())   tgt.addModifierExtension(convertExtension(t));
}
Program: 23345
Project: 23345
Buggy source:
private void load(String type) throws Exception {
  dlog("String_Node_Str" + type);
  for (  FetchedFile f : fileList) {
    for (    FetchedResource r : f.getResources()) {
      if (r.getElement().fhirType().equals(type)) {
        dlog("String_Node_Str" + r.getId());
        if (!r.isValidated())         validate(f,r);
        if (r.getResource() == null)         try {
          r.setResource(parse(f));
        }
 catch (        Exception e) {
          throw new Exception("String_Node_Str" + f.getName() + "String_Node_Str"+ e.getMessage(),e);
        }
        MetadataResource bc=(MetadataResource)r.getResource();
        boolean altered=false;
        if (!bc.hasDate()) {
          altered=true;
          bc.setDateElement(new DateTimeType(execTime));
        }
        if (!bc.hasStatus()) {
          altered=true;
          bc.setStatus(PublicationStatus.DRAFT);
        }
        if (altered)         r.setElement(convertToElement(bc));
        igpkp.checkForPath(f,r,bc);
        try {
          if (!(bc instanceof StructureDefinition))           context.seeResource(bc.getUrl(),bc);
        }
 catch (        Exception e) {
          throw new Exception("String_Node_Str" + bc.getUrl() + "String_Node_Str"+ e.getMessage(),e);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void load(String type) throws Exception {
  dlog("String_Node_Str" + type);
  for (  FetchedFile f : fileList) {
    for (    FetchedResource r : f.getResources()) {
      if (r.getElement().fhirType().equals(type)) {
        dlog("String_Node_Str" + r.getId());
        if (!r.isValidated())         validate(f,r);
        if (r.getResource() == null)         try {
          r.setResource(parse(f));
        }
 catch (        Exception e) {
          throw new Exception("String_Node_Str" + f.getName() + "String_Node_Str"+ e.getMessage(),e);
        }
        MetadataResource bc=(MetadataResource)r.getResource();
        boolean altered=false;
        if (!bc.hasDate()) {
          altered=true;
          bc.setDateElement(new DateTimeType(execTime));
        }
        if (!bc.hasStatus()) {
          altered=true;
          bc.setStatus(PublicationStatus.DRAFT);
        }
        if (altered)         r.setElement(convertToElement(bc));
        igpkp.checkForPath(f,r,bc);
        try {
          context.seeResource(bc.getUrl(),bc);
        }
 catch (        Exception e) {
          throw new Exception("String_Node_Str" + bc.getUrl() + "String_Node_Str"+ e.getMessage(),e);
        }
      }
    }
  }
}
Program: 23346
Project: 23346
Buggy source:
private ElementDefinitionConstraintComponent getConstraint(List<ElementDefinitionConstraintComponent> constraints,String id){
  for (  ElementDefinitionConstraintComponent c : constraints)   if (c.getKey().equals(id))   return c;
  return null;
}

Fixed version (ground truth):
private ElementDefinitionConstraintComponent getConstraint(List<ElementDefinitionConstraintComponent> constraints,String id){
  for (  ElementDefinitionConstraintComponent c : constraints) {
    if (c.hasKey() && c.getKey().equals(id))     return c;
    if (!c.hasKey() && c.toString().equals(id))     return c;
  }
  return null;
}
Program: 23347
Project: 23347
Buggy source:
private String invariants(List<ElementDefinitionConstraintComponent> constraints){
  if (constraints.isEmpty())   return null;
  StringBuilder s=new StringBuilder();
  if (constraints.size() > 0) {
    s.append("String_Node_Str");
    List<String> ids=new ArrayList<String>();
    for (    ElementDefinitionConstraintComponent id : constraints)     ids.add(id.getKey());
    Collections.sort(ids);
    boolean b=false;
    for (    String id : ids) {
      ElementDefinitionConstraintComponent inv=getConstraint(constraints,id);
      if (b)       s.append("String_Node_Str");
 else       b=true;
      s.append("String_Node_Str" + id + "String_Node_Str"+ Utilities.escapeXml(inv.getHuman())+ "String_Node_Str"+ Utilities.escapeXml(inv.getXpath())+ "String_Node_Str");
    }
  }
  return s.toString();
}

Fixed version (ground truth):
private String invariants(List<ElementDefinitionConstraintComponent> constraints){
  if (constraints.isEmpty())   return null;
  StringBuilder s=new StringBuilder();
  if (constraints.size() > 0) {
    s.append("String_Node_Str");
    List<String> ids=new ArrayList<String>();
    for (    ElementDefinitionConstraintComponent id : constraints)     ids.add(id.hasKey() ? id.getKey() : id.toString());
    Collections.sort(ids);
    boolean b=false;
    for (    String id : ids) {
      ElementDefinitionConstraintComponent inv=getConstraint(constraints,id);
      if (b)       s.append("String_Node_Str");
 else       b=true;
      s.append("String_Node_Str" + id + "String_Node_Str"+ Utilities.escapeXml(inv.getHuman())+ "String_Node_Str"+ Utilities.escapeXml(inv.getXpath())+ "String_Node_Str");
    }
  }
  return s.toString();
}
Program: 23350
Project: 23350
Buggy source:
@Override public boolean hasPrimitiveValue(){
  return property.isPrimitive(name) || property.IsLogicalAndHasPrimitiveValue(name);
}

Fixed version (ground truth):
@Override public boolean hasPrimitiveValue(){
  return property.isPrimitiveName(name) || property.IsLogicalAndHasPrimitiveValue(name);
}
Program: 23351
Project: 23351
Buggy source:
public boolean isPrimitive(String name){
  String code=name;
  StructureDefinition sd=context.fetchResource(StructureDefinition.class,"String_Node_Str" + code);
  return sd != null && sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE;
}

Fixed version (ground truth):
/** 
 * Is the given type a primitive
 * @param E.g. "integer"
 */
public boolean isPrimitive(String code){
  StructureDefinition sd=context.fetchResource(StructureDefinition.class,"String_Node_Str" + code);
  return sd != null && sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE;
}
Program: 23352
Project: 23352
Buggy source:
private String determineCacheId(ValueSet vs,boolean heirarchical) throws Exception {
  ValueSet vsid=new ValueSet();
  vsid.setCompose(vs.getCompose());
  JsonParser parser=new JsonParser();
  parser.setOutputStyle(OutputStyle.NORMAL);
  ByteArrayOutputStream b=new ByteArrayOutputStream();
  parser.compose(b,vsid);
  b.close();
  String s=new String(b.toByteArray());
  for (  ConceptSetComponent inc : vs.getCompose().getInclude()) {
    CodeSystem cs=fetchCodeSystem(inc.getSystem());
    if (cs != null)     s=s + cacheValue(cs);
  }
  s=s + "String_Node_Str" + Boolean.toString(heirarchical);
  String r=Integer.toString(s.hashCode());
  return r;
}

Fixed version (ground truth):
private String determineCacheId(ValueSet vs,boolean heirarchical) throws Exception {
  ValueSet vsid=new ValueSet();
  vsid.setCompose(vs.getCompose());
  JsonParser parser=new JsonParser();
  parser.setOutputStyle(OutputStyle.NORMAL);
  ByteArrayOutputStream b=new ByteArrayOutputStream();
  parser.compose(b,vsid);
  b.close();
  String s=new String(b.toByteArray(),Charsets.UTF_8);
  for (  ConceptSetComponent inc : vs.getCompose().getInclude()) {
    CodeSystem cs=fetchCodeSystem(inc.getSystem());
    if (cs != null) {
      String css=cacheValue(cs);
      s=s + css;
    }
  }
  s=s + "String_Node_Str" + Boolean.toString(heirarchical);
  String r=Integer.toString(s.hashCode());
  return r;
}
Program: 23353
Project: 23353
Buggy source:
private String cacheValue(CodeSystem cs) throws IOException {
  CodeSystem csid=new CodeSystem();
  csid.setId(cs.getId());
  csid.setVersion(cs.getVersion());
  csid.setContent(cs.getContent());
  csid.setHierarchyMeaning(CodeSystemHierarchyMeaning.GROUPEDBY);
  for (  ConceptDefinitionComponent cc : cs.getConcept())   csid.getConcept().add(processCSConcept(cc));
  JsonParser parser=new JsonParser();
  parser.setOutputStyle(OutputStyle.NORMAL);
  ByteArrayOutputStream b=new ByteArrayOutputStream();
  parser.compose(b,csid);
  b.close();
  return new String(b.toByteArray());
}

Fixed version (ground truth):
private String cacheValue(CodeSystem cs) throws IOException {
  CodeSystem csid=new CodeSystem();
  csid.setId(cs.getId());
  csid.setVersion(cs.getVersion());
  csid.setContent(cs.getContent());
  csid.setHierarchyMeaning(CodeSystemHierarchyMeaning.GROUPEDBY);
  for (  ConceptDefinitionComponent cc : cs.getConcept())   csid.getConcept().add(processCSConcept(cc));
  JsonParser parser=new JsonParser();
  parser.setOutputStyle(OutputStyle.NORMAL);
  ByteArrayOutputStream b=new ByteArrayOutputStream();
  parser.compose(b,csid);
  b.close();
  return new String(b.toByteArray(),Charsets.UTF_8);
}
Program: 23356
Project: 23356
Buggy source:
private List<String> listReferenceProfiles(ElementDefinition ed){
  List<String> res=new ArrayList<String>();
  for (  TypeRefComponent tr : ed.getType()) {
    if ("String_Node_Str".equals(tr.getCode()))     res.add(tr.getProfile());
  }
  return res;
}

Fixed version (ground truth):
private List<String> listReferenceProfiles(ElementDefinition ed){
  List<String> res=new ArrayList<String>();
  for (  TypeRefComponent tr : ed.getType()) {
    if (tr.getCode() != null && "String_Node_Str".equals(tr.getCode()) && tr.getProfile() != null)     res.add(tr.getProfile());
  }
  return res;
}
Program: 23360
Project: 23360
Buggy source:
private String encodeType(ElementDefn e,TypeRef type,boolean params) throws Exception {
  if (type.isResourceReference())   return "String_Node_Str";
 else   if (type.getName().equals("String_Node_Str")) {
    String en=null;
    if (e.hasBinding()) {
      BindingSpecification cd=e.getBinding();
      if (cd != null && cd.getBinding() == BindingSpecification.BindingMethod.CodeList) {
        en=cd.getValueSet().getName();
        if (!cd.isShared()) {
          enums.put(en,cd.getValueSet());
          enumDefs.put(en,cd.getDefinition());
        }
        return en;
      }
    }
    return "String_Node_Str";
  }
 else   if (!type.hasParams() || !params) {
    if (type.getName().equals("String_Node_Str"))     return "String_Node_Str";
 else     return type.getName();
  }
 else   if (type.getParams().size() > 1)   throw new Exception("String_Node_Str");
 else   return type.getName() + "String_Node_Str" + upFirst(type.getParams().get(0));
}

Fixed version (ground truth):
private String encodeType(ElementDefn e,TypeRef type,boolean params) throws Exception {
  if (type.isResourceReference())   return "String_Node_Str";
 else   if (type.getName().equals("String_Node_Str")) {
    String en=null;
    if (e.hasBinding()) {
      BindingSpecification cd=e.getBinding();
      if (cd != null && cd.getBinding() == BindingSpecification.BindingMethod.CodeList) {
        en=cd.getValueSet().getName();
        if (!cd.isShared()) {
          enums.put(en,cd.getValueSet());
          enumDefs.put(en,cd.getDefinition());
        }
        return en;
      }
    }
    return "String_Node_Str";
  }
 else   if (!type.hasParams() || !params) {
    if (type.getName().equals("String_Node_Str"))     return "String_Node_Str";
 else     if (definitions.getConstraints().containsKey(type.getName())) {
      ProfiledType pt=definitions.getConstraints().get(type.getName());
      return pt.getBaseType();
    }
 else     return type.getName();
  }
 else   if (type.getParams().size() > 1)   throw new Exception("String_Node_Str");
 else   return type.getName() + "String_Node_Str" + upFirst(type.getParams().get(0));
}
Program: 23362
Project: 23362
Buggy source:
public JsonObject generate(ElementDefn root,String version,String genDate,JsonObject mainSchema) throws Exception {
  enums.clear();
  enumDefs.clear();
  JsonObject schema=mainSchema;
  JsonObject definitions;
  if (schema == null) {
    schema=new JsonObject();
    schema.addProperty("String_Node_Str","String_Node_Str");
    schema.addProperty("String_Node_Str","String_Node_Str" + root.getName());
    schema.addProperty("String_Node_Str","String_Node_Str" + root.getName());
    schema.addProperty("String_Node_Str","String_Node_Str");
    definitions=new JsonObject();
    schema.add("String_Node_Str",definitions);
  }
 else   definitions=schema.getAsJsonObject("String_Node_Str");
  scanTypes(root,root);
  generateType(root,root.getName(),root,true,definitions,mainSchema != null);
  for (  ElementDefn e : structures) {
    generateType(root,types.get(e),e,false,definitions,mainSchema != null);
  }
  return schema;
}

Fixed version (ground truth):
public JsonObject generate(ElementDefn root,String version,String genDate,JsonObject mainSchema) throws Exception {
  enums.clear();
  enumDefs.clear();
  JsonObject schema=mainSchema;
  JsonObject definitions;
  if (schema == null) {
    schema=new JsonObject();
    schema.addProperty("String_Node_Str","String_Node_Str");
    schema.addProperty("String_Node_Str","String_Node_Str" + root.getName());
    schema.addProperty("String_Node_Str","String_Node_Str" + root.getName().replace("String_Node_Str","String_Node_Str"));
    schema.addProperty("String_Node_Str","String_Node_Str");
    definitions=new JsonObject();
    schema.add("String_Node_Str",definitions);
  }
 else   definitions=schema.getAsJsonObject("String_Node_Str");
  scanTypes(root,root);
  generateType(root,root.getName(),root,true,definitions,mainSchema != null);
  for (  ElementDefn e : structures) {
    generateType(root,types.get(e),e,false,definitions,mainSchema != null);
  }
  return schema;
}
Program: 23363
Project: 23363
Buggy source:
private void generateAny(ElementDefn root,ElementDefn e,String prefix,JsonObject props,boolean relative) throws Exception {
  for (  TypeRef t : datatypes) {
    JsonObject property=new JsonObject();
    JsonObject property_=null;
    String en=e.getName().replace("String_Node_Str","String_Node_Str");
    props.add(en + upFirst(t.getName()),property);
    property.addProperty("String_Node_Str",e.getDefinition());
    String tref=null;
    String type=null;
    String pattern=null;
    if (definitions.getPrimitives().containsKey(t.getName())) {
      DefinedCode def=definitions.getPrimitives().get(t.getName());
      type=def.getJsonType();
      pattern=def.getRegex();
      if (!Utilities.noString(pattern))       property.addProperty("String_Node_Str",pattern);
      property.addProperty("String_Node_Str",type);
      property_=new JsonObject();
      props.add(en + upFirst(t.getName()) + "String_Node_Str",property_);
      property_.addProperty("String_Node_Str","String_Node_Str" + en + upFirst(t.getName()));
      tref=(relative ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str";
      property_.addProperty("String_Node_Str",tref);
    }
 else {
      String tn=encodeType(e,t,true);
      tref=(relative ? "String_Node_Str" : tn + "String_Node_Str") + "String_Node_Str" + tn;
      property.addProperty("String_Node_Str",tref);
    }
  }
}

Fixed version (ground truth):
private void generateAny(ElementDefn root,ElementDefn e,String prefix,JsonObject props,boolean relative) throws Exception {
  for (  TypeRef t : datatypes) {
    JsonObject property=new JsonObject();
    JsonObject property_=null;
    String en=e.getName().replace("String_Node_Str","String_Node_Str");
    props.add(en + upFirst(t.getName()),property);
    property.addProperty("String_Node_Str",e.getDefinition());
    String tref=null;
    String type=null;
    String pattern=null;
    if (definitions.getPrimitives().containsKey(t.getName())) {
      DefinedCode def=definitions.getPrimitives().get(t.getName());
      type=def.getJsonType();
      pattern=def.getRegex();
      if (!Utilities.noString(pattern))       property.addProperty("String_Node_Str",pattern);
      property.addProperty("String_Node_Str",type);
      property_=new JsonObject();
      props.add("String_Node_Str" + en + upFirst(t.getName()),property_);
      property_.addProperty("String_Node_Str","String_Node_Str" + en + upFirst(t.getName()));
      tref=(relative ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str";
      property_.addProperty("String_Node_Str",tref);
    }
 else {
      String tn=encodeType(e,t,true);
      tref=(relative ? "String_Node_Str" : tn.replace("String_Node_Str","String_Node_Str") + "String_Node_Str") + "String_Node_Str" + tn.replace("String_Node_Str","String_Node_Str");
      property.addProperty("String_Node_Str",tref);
    }
  }
}
Program: 23367
Project: 23367
Buggy source:
private List<String> listReferenceProfiles(ElementDefinition ed){
  List<String> res=new ArrayList<String>();
  for (  TypeRefComponent tr : ed.getType()) {
    if (tr.getCode().equals("String_Node_Str"))     res.add(tr.getProfile());
  }
  return res;
}

Fixed version (ground truth):
private List<String> listReferenceProfiles(ElementDefinition ed){
  List<String> res=new ArrayList<String>();
  for (  TypeRefComponent tr : ed.getType()) {
    if ("String_Node_Str".equals(tr.getCode()))     res.add(tr.getProfile());
  }
  return res;
}
Program: 23368
Project: 23368
Buggy source:
private List<String> listReferenceProfiles(ElementDefinition ed){
  List<String> res=new ArrayList<String>();
  for (  TypeRefComponent tr : ed.getType()) {
    if (tr.getCode().equals("String_Node_Str"))     res.add(tr.getProfile());
  }
  return res;
}

Fixed version (ground truth):
private List<String> listReferenceProfiles(ElementDefinition ed){
  List<String> res=new ArrayList<String>();
  for (  TypeRefComponent tr : ed.getType()) {
    if ("String_Node_Str".equals(tr.getCode()))     res.add(tr.getProfile());
  }
  return res;
}
Program: 23369
Project: 23369
Buggy source:
@Override public List<BaseConformance> allConformanceResources(){
  List<BaseConformance> result=new ArrayList<BaseConformance>();
  result.addAll(structures.values());
  result.addAll(codeSystems.values());
  result.addAll(valueSets.values());
  result.addAll(maps.values());
  result.addAll(transforms.values());
  return result;
}

Fixed version (ground truth):
@Override public List<BaseConformance> allConformanceResources(){
  List<BaseConformance> result=new ArrayList<BaseConformance>();
  result.addAll(structures.values());
  result.addAll(codeSystems.values());
  result.addAll(valueSets.values());
  result.addAll(maps.values());
  result.addAll(transforms.values());
  result.addAll(searchparams);
  return result;
}
Program: 23370
Project: 23370
Buggy source:
public void seeResource(String url,Resource r) throws FHIRException {
  if (r instanceof StructureDefinition)   seeProfile(url,(StructureDefinition)r);
 else   if (r instanceof ValueSet)   seeValueSet(url,(ValueSet)r);
 else   if (r instanceof CodeSystem)   seeCodeSystem(url,(CodeSystem)r);
 else   if (r instanceof ConceptMap)   maps.put(((ConceptMap)r).getUrl(),(ConceptMap)r);
 else   if (r instanceof StructureMap)   transforms.put(((StructureMap)r).getUrl(),(StructureMap)r);
 else   if (r instanceof NamingSystem)   systems.add((NamingSystem)r);
}

Fixed version (ground truth):
public void seeResource(String url,Resource r) throws FHIRException {
  if (r instanceof StructureDefinition)   seeProfile(url,(StructureDefinition)r);
 else   if (r instanceof ValueSet)   seeValueSet(url,(ValueSet)r);
 else   if (r instanceof CodeSystem)   seeCodeSystem(url,(CodeSystem)r);
 else   if (r instanceof ConceptMap)   maps.put(((ConceptMap)r).getUrl(),(ConceptMap)r);
 else   if (r instanceof StructureMap)   transforms.put(((StructureMap)r).getUrl(),(StructureMap)r);
 else   if (r instanceof NamingSystem)   systems.add((NamingSystem)r);
 else   if (r instanceof SearchParameter)   searchparams.add((SearchParameter)r);
}
Program: 23371
Project: 23371
Buggy source:
@Override public void setValueAsString(String theValue) throws IllegalArgumentException {
  this.attributes=null;
  this.childNodes=null;
  this.content=null;
  this.name=null;
  this.nodeType=null;
  if (isBlank(theValue)) {
    return;
  }
  String val=theValue.trim();
  if (!val.startsWith("String_Node_Str")) {
    val="String_Node_Str" + DECL_XMLNS + "String_Node_Str"+ val+ "String_Node_Str";
  }
  if (val.startsWith("String_Node_Str") && val.endsWith("String_Node_Str")) {
    return;
  }
  val=XhtmlDt.preprocessXhtmlNamespaceDeclaration(val);
  try {
    XhtmlNode fragment=new XhtmlParser().parseFragment(val);
    this.attributes=fragment.attributes;
    this.childNodes=fragment.childNodes;
    this.content=fragment.content;
    this.name=fragment.name;
    this.nodeType=fragment.nodeType;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void setValueAsString(String theValue) throws IllegalArgumentException {
  this.attributes=null;
  this.childNodes=null;
  this.content=null;
  this.name=null;
  this.nodeType=null;
  if (theValue == null || theValue.length() == 0) {
    return;
  }
  String val=theValue.trim();
  if (!val.startsWith("String_Node_Str")) {
    val="String_Node_Str" + DECL_XMLNS + "String_Node_Str"+ val+ "String_Node_Str";
  }
  if (val.startsWith("String_Node_Str") && val.endsWith("String_Node_Str")) {
    return;
  }
  val=XhtmlDt.preprocessXhtmlNamespaceDeclaration(val);
  try {
    XhtmlNode fragment=new XhtmlParser().parseFragment(val);
    this.attributes=fragment.attributes;
    this.childNodes=fragment.childNodes;
    this.content=fragment.content;
    this.name=fragment.name;
    this.nodeType=fragment.nodeType;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 23372
Project: 23372
Buggy source:
public void closeDifferential(StructureDefinition base,StructureDefinition derived) throws FHIRException {
  for (  ElementDefinition edb : base.getSnapshot().getElement()) {
    if (isImmediateChild(edb) && !edb.getPath().endsWith("String_Node_Str")) {
      ElementDefinition edm=getMatchInDerived(edb,derived.getDifferential().getElement());
      if (edm == null) {
        ElementDefinition edd=derived.getDifferential().addElement();
        edd.setPath(edb.getPath());
        edd.setMax("String_Node_Str");
      }
 else {
        closeChildren(base,edb,derived,edm);
      }
    }
  }
  sortDifferential(base,derived,derived.getName(),new ArrayList<String>());
}

Fixed version (ground truth):
public void closeDifferential(StructureDefinition base,StructureDefinition derived) throws FHIRException {
  for (  ElementDefinition edb : base.getSnapshot().getElement()) {
    if (isImmediateChild(edb) && !edb.getPath().endsWith("String_Node_Str")) {
      ElementDefinition edm=getMatchInDerived(edb,derived.getDifferential().getElement());
      if (edm == null) {
        ElementDefinition edd=derived.getDifferential().addElement();
        edd.setPath(edb.getPath());
        edd.setMax("String_Node_Str");
      }
 else       if (edb.hasSlicing()) {
        closeChildren(base,edb,derived,edm);
      }
    }
  }
  sortDifferential(base,derived,derived.getName(),new ArrayList<String>());
}
Program: 23373
Project: 23373
Buggy source:
public List<Element> getChildren(String name){
  List<Element> res=new ArrayList<Element>();
  for (  Element child : children) {
    if (name.equals(child.getName()))     res.add(child);
  }
  return res;
}

Fixed version (ground truth):
public List<Element> getChildren(String name){
  List<Element> res=new ArrayList<Element>();
  if (children != null)   for (  Element child : children) {
    if (name.equals(child.getName()))     res.add(child);
  }
  return res;
}
Program: 23374
Project: 23374
Buggy source:
private Element getValueForDiscriminator(Object appContext,List<ValidationMessage> errors,Element element,String discriminator,ElementDefinition criteria,NodeStack stack) throws FHIRException, IOException {
  String p=stack.getLiteralPath();
  Element focus=element;
  String[] dlist=discriminator.split("String_Node_Str");
  for (  String d : dlist) {
    if (focus.fhirType().equals("String_Node_Str") && d.equals("String_Node_Str")) {
      String url=focus.getChildValue("String_Node_Str");
      if (Utilities.noString(url))       throw new FHIRException("String_Node_Str" + discriminator + "String_Node_Str"+ element.getProperty().getName());
      Element target=resolve(appContext,url,stack,errors,p);
      if (target == null)       throw new FHIRException("String_Node_Str" + url + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=target;
    }
 else {
      List<Element> children=focus.getChildren(d);
      if (children.isEmpty())       throw new FHIRException("String_Node_Str" + d + "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      if (children.size() > 1)       throw new FHIRException("String_Node_Str" + Integer.toString(children.size()) + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=children.get(0);
      p=p + "String_Node_Str" + d;
    }
  }
  return focus;
}

Fixed version (ground truth):
private Element getValueForDiscriminator(Object appContext,List<ValidationMessage> errors,Element element,String discriminator,ElementDefinition criteria,NodeStack stack) throws FHIRException, IOException {
  String p=stack.getLiteralPath() + "String_Node_Str" + element.getName();
  Element focus=element;
  String[] dlist=discriminator.split("String_Node_Str");
  for (  String d : dlist) {
    if (focus.fhirType().equals("String_Node_Str") && d.equals("String_Node_Str")) {
      String url=focus.getChildValue("String_Node_Str");
      if (Utilities.noString(url))       throw new FHIRException("String_Node_Str" + discriminator + "String_Node_Str"+ element.getProperty().getName());
      Element target=resolve(appContext,url,stack,errors,p);
      if (target == null)       throw new FHIRException("String_Node_Str" + url + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=target;
    }
 else     if (d.equals("String_Node_Str") && focus.isPrimitive()) {
      return focus;
    }
 else {
      List<Element> children=focus.getChildren(d);
      if (children.isEmpty())       throw new FHIRException("String_Node_Str" + d + "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      if (children.size() > 1)       throw new FHIRException("String_Node_Str" + Integer.toString(children.size()) + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=children.get(0);
      p=p + "String_Node_Str" + d;
    }
  }
  return focus;
}
Program: 23375
Project: 23375
Buggy source:
public void closeDifferential(StructureDefinition base,StructureDefinition derived) throws FHIRException {
  for (  ElementDefinition edb : base.getSnapshot().getElement()) {
    if (isImmediateChild(edb) && !edb.getPath().endsWith("String_Node_Str")) {
      ElementDefinition edm=getMatchInDerived(edb,derived.getDifferential().getElement());
      if (edm == null) {
        ElementDefinition edd=derived.getDifferential().addElement();
        edd.setPath(edb.getPath());
        edd.setMax("String_Node_Str");
      }
 else {
        closeChildren(base,edb,derived,edm);
      }
    }
  }
  sortDifferential(base,derived,derived.getName(),new ArrayList<String>());
}

Fixed version (ground truth):
public void closeDifferential(StructureDefinition base,StructureDefinition derived) throws FHIRException {
  for (  ElementDefinition edb : base.getSnapshot().getElement()) {
    if (isImmediateChild(edb) && !edb.getPath().endsWith("String_Node_Str")) {
      ElementDefinition edm=getMatchInDerived(edb,derived.getDifferential().getElement());
      if (edm == null) {
        ElementDefinition edd=derived.getDifferential().addElement();
        edd.setPath(edb.getPath());
        edd.setMax("String_Node_Str");
      }
 else       if (edb.hasSlicing()) {
        closeChildren(base,edb,derived,edm);
      }
    }
  }
  sortDifferential(base,derived,derived.getName(),new ArrayList<String>());
}
Program: 23376
Project: 23376
Buggy source:
public List<Element> getChildren(String name){
  List<Element> res=new ArrayList<Element>();
  for (  Element child : children) {
    if (name.equals(child.getName()))     res.add(child);
  }
  return res;
}

Fixed version (ground truth):
public List<Element> getChildren(String name){
  List<Element> res=new ArrayList<Element>();
  if (children != null)   for (  Element child : children) {
    if (name.equals(child.getName()))     res.add(child);
  }
  return res;
}
Program: 23377
Project: 23377
Buggy source:
private Element getValueForDiscriminator(Object appContext,List<ValidationMessage> errors,Element element,String discriminator,ElementDefinition criteria,NodeStack stack) throws FHIRException, IOException {
  String p=stack.getLiteralPath();
  Element focus=element;
  String[] dlist=discriminator.split("String_Node_Str");
  for (  String d : dlist) {
    if (focus.fhirType().equals("String_Node_Str") && d.equals("String_Node_Str")) {
      String url=focus.getChildValue("String_Node_Str");
      if (Utilities.noString(url))       throw new FHIRException("String_Node_Str" + discriminator + "String_Node_Str"+ element.getProperty().getName());
      Element target=resolve(appContext,url,stack,errors,p);
      if (target == null)       throw new FHIRException("String_Node_Str" + url + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=target;
    }
 else {
      List<Element> children=focus.getChildren(d);
      if (children.isEmpty())       throw new FHIRException("String_Node_Str" + d + "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      if (children.size() > 1)       throw new FHIRException("String_Node_Str" + Integer.toString(children.size()) + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=children.get(0);
      p=p + "String_Node_Str" + d;
    }
  }
  return focus;
}

Fixed version (ground truth):
private Element getValueForDiscriminator(Object appContext,List<ValidationMessage> errors,Element element,String discriminator,ElementDefinition criteria,NodeStack stack) throws FHIRException, IOException {
  String p=stack.getLiteralPath() + "String_Node_Str" + element.getName();
  Element focus=element;
  String[] dlist=discriminator.split("String_Node_Str");
  for (  String d : dlist) {
    if (focus.fhirType().equals("String_Node_Str") && d.equals("String_Node_Str")) {
      String url=focus.getChildValue("String_Node_Str");
      if (Utilities.noString(url))       throw new FHIRException("String_Node_Str" + discriminator + "String_Node_Str"+ element.getProperty().getName());
      Element target=resolve(appContext,url,stack,errors,p);
      if (target == null)       throw new FHIRException("String_Node_Str" + url + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=target;
    }
 else     if (d.equals("String_Node_Str") && focus.isPrimitive()) {
      return focus;
    }
 else {
      List<Element> children=focus.getChildren(d);
      if (children.isEmpty())       throw new FHIRException("String_Node_Str" + d + "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      if (children.size() > 1)       throw new FHIRException("String_Node_Str" + Integer.toString(children.size()) + "String_Node_Str"+ d+ "String_Node_Str"+ discriminator+ "String_Node_Str"+ element.getProperty().getName());
      focus=children.get(0);
      p=p + "String_Node_Str" + d;
    }
  }
  return focus;
}
Program: 23382
Project: 23382
Buggy source:
private void loadConformance() throws Exception {
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  generateSnapshots();
  generateLogicalMaps();
  load("String_Node_Str");
  generateAdditionalExamples();
  executeTransforms();
}

Fixed version (ground truth):
private void loadConformance() throws Exception {
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  load("String_Node_Str");
  generateSnapshots();
  generateLogicalMaps();
  load("String_Node_Str");
  generateAdditionalExamples();
  executeTransforms();
  validateExpressions();
}
Program: 23383
Project: 23383
Buggy source:
public ValueSetExpansionOutcome(String error,ExpansionErrorClass errorClass){
  this.valueset=null;
  this.service=null;
  this.error=error;
  this.errorClass=errorClass;
}

Fixed version (ground truth):
public ValueSetExpansionOutcome(String error,TerminologyServiceErrorClass errorClass){
  this.valueset=null;
  this.service=null;
  this.error=error;
  this.errorClass=errorClass;
}
Program: 23384
Project: 23384
Buggy source:
public ExpansionErrorClass getErrorClass(){
  return errorClass;
}

Fixed version (ground truth):
public TerminologyServiceErrorClass getErrorClass(){
  return errorClass;
}
Program: 23386
Project: 23386
Buggy source:
private void loadCache() throws FHIRFormatError, IOException {
  File[] files=new File(cacheFolder).listFiles();
  for (  File f : files) {
    if (f.getName().endsWith("String_Node_Str")) {
      final FileInputStream is=new FileInputStream(f);
      try {
        Resource r=context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).parse(is);
        if (r instanceof OperationOutcome) {
          OperationOutcome oo=(OperationOutcome)r;
          expansions.put(ToolingExtensions.getExtension(oo,VS_ID_EXT).getValue().toString(),new ValueSetExpansionOutcome(new XhtmlComposer().setXmlOnly(true).composePlainText(oo.getText().getDiv()),ExpansionErrorClass.UNKNOWN));
        }
 else {
          ValueSet vs=(ValueSet)r;
          expansions.put(vs.getUrl(),new ValueSetExpansionOutcome(vs));
        }
      }
  finally {
        IOUtils.closeQuietly(is);
      }
    }
  }
}

Fixed version (ground truth):
private void loadCache() throws FHIRFormatError, IOException {
  File[] files=new File(cacheFolder).listFiles();
  for (  File f : files) {
    if (f.getName().endsWith("String_Node_Str")) {
      final FileInputStream is=new FileInputStream(f);
      try {
        Resource r=context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).parse(is);
        if (r instanceof OperationOutcome) {
          OperationOutcome oo=(OperationOutcome)r;
          expansions.put(ToolingExtensions.getExtension(oo,VS_ID_EXT).getValue().toString(),new ValueSetExpansionOutcome(new XhtmlComposer().setXmlOnly(true).composePlainText(oo.getText().getDiv()),TerminologyServiceErrorClass.UNKNOWN));
        }
 else {
          ValueSet vs=(ValueSet)r;
          expansions.put(vs.getUrl(),new ValueSetExpansionOutcome(vs));
        }
      }
  finally {
        IOUtils.closeQuietly(is);
      }
    }
  }
}
Program: 23387
Project: 23387
Buggy source:
@Test public void testTransformProfilesCDA() throws FileNotFoundException, Exception {
  Map<String,StructureMap> maps=new HashMap<String,StructureMap>();
  if (TestingUtilities.context == null)   TestingUtilities.context=SimpleWorkerContext.fromPack("String_Node_Str");
  StructureMapUtilities scu=new StructureMapUtilities(TestingUtilities.context,maps,null);
  for (  String f : new File("String_Node_Str").list()) {
    try {
      StructureDefinition sd=(StructureDefinition)new XmlParser().parse(new FileInputStream("String_Node_Str" + f));
      ((SimpleWorkerContext)TestingUtilities.context).seeResource(sd.getUrl(),sd);
    }
 catch (    Exception e) {
    }
  }
  for (  String f : new File("String_Node_Str").list()) {
    try {
      StructureMap map=scu.parse(TextFile.fileToString("String_Node_Str" + f));
      maps.put(map.getUrl(),map);
    }
 catch (    Exception e) {
    }
  }
  List<StructureDefinition> result=scu.transformProfile(null,maps.get("String_Node_Str"));
  for (  StructureDefinition sd : result)   new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream("String_Node_Str" + sd.getId() + "String_Node_Str"),sd);
}

Fixed version (ground truth):
@Test public void testTransformProfilesCDA() throws FileNotFoundException, Exception {
  Map<String,StructureMap> maps=new HashMap<String,StructureMap>();
  if (TestingUtilities.context == null)   TestingUtilities.context=SimpleWorkerContext.fromPack("String_Node_Str");
  StructureMapUtilities scu=new StructureMapUtilities(TestingUtilities.context,maps,null);
  for (  String f : new File("String_Node_Str").list()) {
    try {
      StructureDefinition sd=(StructureDefinition)new XmlParser().parse(new FileInputStream("String_Node_Str" + f));
      ((SimpleWorkerContext)TestingUtilities.context).seeResource(sd.getUrl(),sd);
    }
 catch (    Exception e) {
    }
  }
  for (  String f : new File("String_Node_Str").list()) {
    try {
      StructureMap map=scu.parse(TextFile.fileToString("String_Node_Str" + f));
      maps.put(map.getUrl(),map);
    }
 catch (    Exception e) {
    }
  }
  List<StructureDefinition> result=scu.analyse(null,maps.get("String_Node_Str")).getProfiles();
  for (  StructureDefinition sd : result)   new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream("String_Node_Str" + sd.getId() + "String_Node_Str"),sd);
}
Program: 23388
Project: 23388
Buggy source:
public ValidationResult(IssueSeverity error,String error2,ExpansionErrorClass errorClass){
  this.severity=severity;
  this.message=message;
  this.errorClass=errorClass;
}

Fixed version (ground truth):
public ValidationResult(IssueSeverity error,String error2,TerminologyServiceErrorClass errorClass){
  this.severity=severity;
  this.message=message;
  this.errorClass=errorClass;
}
Program: 23389
Project: 23389
Buggy source:
public boolean IsNoService(){
  return errorClass == ExpansionErrorClass.NOSERVICE;
}

Fixed version (ground truth):
public boolean IsNoService(){
  return errorClass == TerminologyServiceErrorClass.NOSERVICE;
}
Program: 23390
Project: 23390
Buggy source:
public ExpansionErrorClass getErrorClass(){
  return errorClass;
}

Fixed version (ground truth):
public TerminologyServiceErrorClass getErrorClass(){
  return errorClass;
}
Program: 23391
Project: 23391
Buggy source:
private void executeRule(String indent,TransformContext context,StructureMap map,Variables vars,StructureMapGroupComponent group,StructureMapGroupRuleComponent rule) throws Exception {
  log(indent + "String_Node_Str" + rule.getName());
  Variables srcVars=vars.copy();
  if (rule.getSource().size() != 1)   throw new Exception("String_Node_Str");
  List<Variables> source=analyseSource(context,srcVars,rule.getSource().get(0));
  if (source != null) {
    for (    Variables v : source) {
      for (      StructureMapGroupRuleTargetComponent t : rule.getTarget()) {
        processTarget(context,v,map,t);
      }
      if (rule.hasRule()) {
        for (        StructureMapGroupRuleComponent childrule : rule.getRule()) {
          executeRule(indent + "String_Node_Str",context,map,v,group,childrule);
        }
      }
 else       if (rule.hasDependent()) {
        for (        StructureMapGroupRuleDependentComponent dependent : rule.getDependent()) {
          executeDependency(indent + "String_Node_Str",context,map,v,group,dependent);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void executeRule(String indent,TransformContext context,StructureMap map,Variables vars,StructureMapGroupComponent group,StructureMapGroupRuleComponent rule) throws Exception {
  log(indent + "String_Node_Str" + rule.getName());
  Variables srcVars=vars.copy();
  if (rule.getSource().size() != 1)   throw new Exception("String_Node_Str");
  List<Variables> source=processSource(context,srcVars,rule.getSource().get(0));
  if (source != null) {
    for (    Variables v : source) {
      for (      StructureMapGroupRuleTargetComponent t : rule.getTarget()) {
        processTarget(context,v,map,t);
      }
      if (rule.hasRule()) {
        for (        StructureMapGroupRuleComponent childrule : rule.getRule()) {
          executeRule(indent + "String_Node_Str",context,map,v,group,childrule);
        }
      }
 else       if (rule.hasDependent()) {
        for (        StructureMapGroupRuleDependentComponent dependent : rule.getDependent()) {
          executeDependency(indent + "String_Node_Str",context,map,v,group,dependent);
        }
      }
    }
  }
}