Program: 23982
Project: 23982
Buggy source:
public List<TypeRefComponent> convert(IWorkerContext context,String path,List<TypeRef> types) throws Exception {
  List<TypeRefComponent> list=new ArrayList<TypeRefComponent>();
  for (  TypeRef t : types) {
    if (t.hasParams() && !"String_Node_Str".equals(t.getName())) {
      throw new Exception("String_Node_Str" + path);
    }
    if (t.getParams().size() > 0) {
      if (t.getProfile() != null && t.getParams().size() != 1) {
        throw new Exception("String_Node_Str" + path);
      }
      for (      String param : t.getParams()) {
        TypeRefComponent childType=new TypeRefComponent();
        childType.setCode(t.getName());
        childType.addProfile("String_Node_Str" + param);
        list.add(childType);
      }
    }
 else     if (t.isWildcardType()) {
      for (      String n : wildcardTypes())       list.add(new TypeRefComponent().setCode(n));
    }
 else {
      StructureDefinition sd=context.fetchResource(StructureDefinition.class,"String_Node_Str" + t.getName());
      if (sd == null)       throw new Exception("String_Node_Str" + t.getName());
      if (sd.getDerivation() == TypeDerivationRule.CONSTRAINT) {
        TypeRefComponent tc=new TypeRefComponent().setCode(sd.getBaseType());
        list.add(tc);
        tc.addProfile(sd.getUrl());
      }
 else {
        TypeRefComponent tc=new TypeRefComponent().setCode(t.getName());
        list.add(tc);
        if (t.hasProfile())         tc.addProfile(t.getProfile());
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public List<TypeRefComponent> convert(IWorkerContext context,String path,List<TypeRef> types,boolean resource,ElementDefinition ed) throws Exception {
  List<TypeRefComponent> list=new ArrayList<TypeRefComponent>();
  for (  TypeRef t : types) {
    if (t.hasParams() && !"String_Node_Str".equals(t.getName())) {
      throw new Exception("String_Node_Str" + path);
    }
    if (t.getParams().size() > 0) {
      if (t.getProfile() != null && t.getParams().size() != 1) {
        throw new Exception("String_Node_Str" + path);
      }
      for (      String param : t.getParams()) {
        TypeRefComponent childType=new TypeRefComponent();
        childType.setCode(t.getName());
        childType.addProfile("String_Node_Str" + param);
        list.add(childType);
      }
    }
 else     if (t.isWildcardType()) {
      for (      String n : wildcardTypes())       list.add(new TypeRefComponent().setCode(n));
    }
 else     if (t.getName().startsWith("String_Node_Str")) {
      if (resource)       list.add(new TypeRefComponent().setCode("String_Node_Str"));
 else       list.add(new TypeRefComponent().setCode("String_Node_Str"));
      ToolingExtensions.addStringExtension(ed,"String_Node_Str",t.getName().substring(1));
    }
 else {
      StructureDefinition sd=context.fetchResource(StructureDefinition.class,"String_Node_Str" + t.getName());
      if (sd == null)       throw new Exception("String_Node_Str" + t.getName());
      if (sd.getDerivation() == TypeDerivationRule.CONSTRAINT) {
        TypeRefComponent tc=new TypeRefComponent().setCode(sd.getBaseType());
        list.add(tc);
        tc.addProfile(sd.getUrl());
      }
 else {
        TypeRefComponent tc=new TypeRefComponent().setCode(t.getName());
        list.add(tc);
        if (t.hasProfile())         tc.addProfile(t.getProfile());
      }
    }
  }
  return list;
}