Program: 23128
Project: 23128
Buggy source:
public String getDiffAsHtml(TypeLinkProvider linker) throws IOException {
  this.linker=linker;
  start();
  header("String_Node_Str");
  for (  String s : sorted(revision.types.keySet())) {
    StructureDefinition orig=original.types.get(s);
    StructureDefinition rev=revision.types.get(s);
    if (orig == null) {
      markNew(rev.getName(),true,false);
    }
 else     if (rev.getKind() == StructureDefinitionKind.PRIMITIVETYPE) {
      markNoChanges(rev.getName(),true);
    }
 else     if (rev.hasDerivation() && orig.hasDerivation() && rev.getDerivation() != orig.getDerivation()) {
      markChanged(rev.getName(),"String_Node_Str" + orig.getDerivation().toCode() + "String_Node_Str"+ rev.getDerivation().toCode(),true);
    }
 else {
      compare(orig,rev);
    }
  }
  for (  String s : sorted(original.types.keySet())) {
    StructureDefinition orig=original.types.get(s);
    StructureDefinition rev=revision.types.get(s);
    if (rev == null)     markDeleted(orig.getName(),true);
  }
  header("String_Node_Str");
  for (  String s : sorted(revision.resources.keySet())) {
    StructureDefinition orig=original.resources.get(checkRename(s));
    StructureDefinition rev=revision.resources.get(s);
    if (orig == null) {
      markNew(rev.getName(),true,true);
    }
 else {
      compare(orig,rev);
    }
  }
  for (  String s : sorted(original.resources.keySet())) {
    StructureDefinition orig=original.resources.get(s);
    StructureDefinition rev=revision.resources.get(s);
    if (rev == null)     markDeleted(orig.getName(),true);
  }
  return new XhtmlComposer().setPretty(true).compose(tbl);
}

Fixed version (ground truth):
public String getDiffAsHtml(TypeLinkProvider linker) throws IOException {
  this.linker=linker;
  start();
  header("String_Node_Str");
  for (  String s : sorted(revision.types.keySet())) {
    StructureDefinition orig=original.types.get(s);
    StructureDefinition rev=revision.types.get(s);
    if (orig == null) {
      markNew(rev.getName(),true,false);
    }
 else     if (rev.getKind() == StructureDefinitionKind.PRIMITIVETYPE) {
      markNoChanges(rev.getName(),true);
    }
 else     if (rev.hasDerivation() && orig.hasDerivation() && rev.getDerivation() != orig.getDerivation()) {
      markChanged(rev.getName(),"String_Node_Str" + orig.getDerivation().toCode() + "String_Node_Str"+ rev.getDerivation().toCode(),true);
    }
 else {
      compare(orig,rev);
    }
  }
  for (  String s : sorted(original.types.keySet())) {
    StructureDefinition orig=original.types.get(s);
    StructureDefinition rev=revision.types.get(s);
    if (rev == null)     markDeleted(orig.getName(),true);
  }
  header("String_Node_Str");
  for (  String s : sorted(revision.resources.keySet())) {
    StructureDefinition orig=original.resources.get(checkRename(s));
    StructureDefinition rev=revision.resources.get(s);
    if (orig == null) {
      markNew(rev.getName(),true,true);
    }
 else {
      compare(orig,rev);
    }
  }
  for (  String s : sorted(original.resources.keySet())) {
    StructureDefinition orig=original.resources.get(s);
    StructureDefinition rev=revision.resources.get(s);
    if (rev == null)     markDeleted(orig.getName(),true);
  }
  return new XhtmlComposer(false,true).compose(tbl);
}