Program: 23942
Project: 23942
Buggy source:
private int processExtension(Sheet sheet,int row,String uri,List<ValidationMessage> issues,Map<String,ElementDefinitionConstraintComponent> invariants) throws Exception {
  String name=sheet.getColumn(row,"String_Node_Str");
  StructureDefinition ex=new StructureDefinition();
  ex.setUrl(uri + name);
  ex.setId(tail(ex.getUrl()));
  bundle.addEntry().setResource(ex).setFullUrl(ex.getUrl());
  ex.setKind(StructureDefinitionKind.COMPLEXTYPE);
  ex.setType("String_Node_Str");
  ex.setBaseDefinition("String_Node_Str");
  ex.setDerivation(TypeDerivationRule.CONSTRAINT);
  ex.setAbstract(false);
  ex.setFhirVersion(Constants.VERSION);
  String context=null;
  if (Utilities.noString(name))   throw new Exception("String_Node_Str" + getLocation(row));
  if (name.contains("String_Node_Str"))   throw new Exception("String_Node_Str" + name + "String_Node_Str"+ getLocation(row));
  if (context == null) {
    ex.setContextType(readContextType(sheet.getColumn(row,"String_Node_Str"),row));
    String cc=sheet.getColumn(row,"String_Node_Str");
    if (!Utilities.noString(cc))     for (    String c : cc.split("String_Node_Str")) {
      checkContextValid(ex.getContextType(),c,this.name);
      ex.addContext(c);
    }
  }
  ex.setDisplay(sheet.getColumn(row,"String_Node_Str"));
  ElementDefinition exe=ex.getDifferential().addElement();
  exe.setPath("String_Node_Str");
  exe.setName(sheet.getColumn(row,"String_Node_Str"));
  ElementDefinition exu=ex.getDifferential().addElement();
  exu.setPath("String_Node_Str");
  exu.setFixed(new UriType(ex.getUrl()));
  if (invariants != null) {
    for (    ElementDefinitionConstraintComponent inv : invariants.values()) {
      if (inv.getKey().equals(name))       exe.getConstraint().add(inv);
    }
  }
  parseExtensionElement(sheet,row,ex,exe,false);
  String sl=exe.getShort();
  ex.setName(sheet.getColumn(row,"String_Node_Str"));
  if (!ex.hasName())   ex.setName(ex.getDisplay());
  if (!Utilities.noString(sl) && (!sl.contains("String_Node_Str") || !ex.hasName()))   ex.setName(sl);
  if (!ex.hasName())   throw new Exception("String_Node_Str" + ex.getUrl() + "String_Node_Str"+ getLocation(row));
  ex.setDescription(exe.getDefinition());
  ex.setPublisher(metadata("String_Node_Str"));
  if (hasMetadata("String_Node_Str"))   ex.addContact().getTelecom().add(Factory.newContactPoint(ContactPointSystem.OTHER,metadata("String_Node_Str")));
  if (hasMetadata("String_Node_Str"))   ex.setDateElement(Factory.newDateTime(metadata("String_Node_Str").substring(0,10)));
 else   ex.setDate(genDate.getTime());
  if (hasMetadata("String_Node_Str"))   ex.setStatus(ConformanceResourceStatus.fromCode(metadata("String_Node_Str")));
  row++;
  while (row < sheet.getRows().size() && sheet.getColumn(row,"String_Node_Str").startsWith(name + "String_Node_Str")) {
    String n=sheet.getColumn(row,"String_Node_Str");
    ElementDefinition child=ex.getDifferential().addElement();
    child.setPath("String_Node_Str");
    child.setName(n.substring(n.lastIndexOf("String_Node_Str") + 1));
    parseExtensionElement(sheet,row,ex,child,true);
    if (invariants != null) {
      for (      ElementDefinitionConstraintComponent inv : invariants.values()) {
        if (inv.getKey().equals(n))         child.getConstraint().add(inv);
      }
    }
    row++;
  }
  ex.getDifferential().getElementFirstRep().getType().clear();
  StructureDefinition base=this.context.fetchResource(StructureDefinition.class,"String_Node_Str");
  List<String> errors=new ArrayList<String>();
  ProfileUtilities utils=new ProfileUtilities(this.context,issues,null);
  utils.sortDifferential(base,ex,"String_Node_Str" + ex.getUrl(),errors);
  assert(errors.size() == 0);
  utils.setIds(ex,ex.getName());
  return row;
}

Fixed version (ground truth):
private int processExtension(Sheet sheet,int row,String uri,List<ValidationMessage> issues,Map<String,ElementDefinitionConstraintComponent> invariants) throws Exception {
  String name=sheet.getColumn(row,"String_Node_Str");
  StructureDefinition ex=new StructureDefinition();
  ex.setUrl(uri + name);
  ex.setId(tail(ex.getUrl()));
  bundle.addEntry().setResource(ex).setFullUrl(ex.getUrl());
  ex.setKind(StructureDefinitionKind.COMPLEXTYPE);
  ex.setType("String_Node_Str");
  ex.setBaseDefinition("String_Node_Str");
  ex.setDerivation(TypeDerivationRule.CONSTRAINT);
  ex.setAbstract(false);
  ex.setFhirVersion(Constants.VERSION);
  String context=null;
  if (Utilities.noString(name))   throw new Exception("String_Node_Str" + getLocation(row));
  if (name.contains("String_Node_Str"))   throw new Exception("String_Node_Str" + name + "String_Node_Str"+ getLocation(row));
  if (context == null) {
    ex.setContextType(readContextType(sheet.getColumn(row,"String_Node_Str"),row));
    String cc=sheet.getColumn(row,"String_Node_Str");
    if (!Utilities.noString(cc))     for (    String c : cc.split("String_Node_Str")) {
      checkContextValid(ex.getContextType(),c,this.name);
      ex.addContext(c);
    }
  }
  ex.setDisplay(sheet.getColumn(row,"String_Node_Str"));
  ElementDefinition exe=ex.getDifferential().addElement();
  exe.setPath("String_Node_Str");
  exe.setName(sheet.getColumn(row,"String_Node_Str"));
  ElementDefinition exu=ex.getDifferential().addElement();
  exu.setPath("String_Node_Str");
  exu.setFixed(new UriType(ex.getUrl()));
  if (invariants != null) {
    for (    ElementDefinitionConstraintComponent inv : invariants.values()) {
      if (inv.getKey().equals(name))       exe.getConstraint().add(inv);
    }
  }
  parseExtensionElement(sheet,row,ex,exe,false);
  String sl=exe.getShort();
  ex.setName(sheet.getColumn(row,"String_Node_Str"));
  if (!ex.hasName())   ex.setName(ex.getDisplay());
  if (!Utilities.noString(sl) && (!sl.contains("String_Node_Str") || !ex.hasName()))   ex.setName(sl);
  if (!ex.hasName())   throw new Exception("String_Node_Str" + ex.getUrl() + "String_Node_Str"+ getLocation(row));
  ex.setDescription(exe.getDefinition());
  ex.setPublisher(metadata("String_Node_Str"));
  if (hasMetadata("String_Node_Str"))   ex.addContact().getTelecom().add(Factory.newContactPoint(ContactPointSystem.OTHER,metadata("String_Node_Str")));
  if (hasMetadata("String_Node_Str"))   ex.setDateElement(Factory.newDateTime(metadata("String_Node_Str").substring(0,10)));
 else   ex.setDate(genDate.getTime());
  if (hasMetadata("String_Node_Str"))   ex.setStatus(ConformanceResourceStatus.fromCode(metadata("String_Node_Str")));
  row++;
  while (row < sheet.getRows().size() && sheet.getColumn(row,"String_Node_Str").startsWith(name + "String_Node_Str")) {
    String n=sheet.getColumn(row,"String_Node_Str");
    ElementDefinition child=ex.getDifferential().addElement();
    child.setPath("String_Node_Str");
    child.setName(n.substring(n.lastIndexOf("String_Node_Str") + 1));
    parseExtensionElement(sheet,row,ex,child,true);
    if (invariants != null) {
      for (      ElementDefinitionConstraintComponent inv : invariants.values()) {
        if (inv.getKey().equals(n))         child.getConstraint().add(inv);
      }
    }
    row++;
  }
  ex.getDifferential().getElementFirstRep().getType().clear();
  if (ex.getDifferential().getElementFirstRep().hasRequirements()) {
    ex.setRequirements(ex.getDifferential().getElementFirstRep().getRequirements());
    ex.getDifferential().getElementFirstRep().setRequirements(null);
  }
  if (ex.getDifferential().getElementFirstRep().hasLabel()) {
    ex.setDisplay(ex.getDifferential().getElementFirstRep().getLabel());
    ex.getDifferential().getElementFirstRep().setLabel(null);
  }
  if (ex.getDifferential().getElementFirstRep().hasCode()) {
    ex.getCode().addAll(ex.getDifferential().getElementFirstRep().getCode());
    ex.getDifferential().getElementFirstRep().getCode().clear();
  }
  StructureDefinition base=this.context.fetchResource(StructureDefinition.class,"String_Node_Str");
  List<String> errors=new ArrayList<String>();
  ProfileUtilities utils=new ProfileUtilities(this.context,issues,null);
  utils.sortDifferential(base,ex,"String_Node_Str" + ex.getUrl(),errors);
  assert(errors.size() == 0);
  utils.setIds(ex,ex.getName());
  return row;
}