Program: 23019
Project: 23019
Buggy source:
private boolean loadBundle(JsonPrimitive be,boolean needToBuild,FetchedFile igf) throws Exception {
  FetchedFile f=fetcher.fetch(new Reference().setReference("String_Node_Str" + be.getAsString()),igf);
  boolean changed=noteFile("String_Node_Str" + be.getAsString(),f);
  if (changed) {
    f.setBundle(new FetchedResource());
    loadAsElementModel(f,f.getBundle());
    List<Element> entries=new ArrayList<Element>();
    f.getBundle().getElement().getNamedChildren("String_Node_Str",entries);
    for (    Element bnde : entries) {
      Element res=bnde.getNamedChild("String_Node_Str");
      FetchedResource r=f.addResource();
      r.setElement(res);
      r.setId(res.getIdBase());
      List<Element> profiles=new ArrayList<Element>();
      Element meta=res.getNamedChild("String_Node_Str");
      if (meta != null)       meta.getNamedChildren("String_Node_Str",profiles);
      for (      Element p : profiles)       r.getProfiles().add(p.primitiveValue());
      r.setTitle(r.getElement().getChildValue("String_Node_Str"));
      igpkp.findConfiguration(f,r);
    }
  }
 else   f=altMap.get("String_Node_Str" + be.getAsString());
  ImplementationGuideDefinitionPackageComponent pck=publishedIg.getDefinition().addPackage().setName(f.getTitle());
  pck.setId(be.getAsString());
  for (  FetchedResource r : f.getResources()) {
    bndIds.add(r.getElement().fhirType() + "String_Node_Str" + r.getId());
    ImplementationGuideDefinitionResourceComponent res=publishedIg.getDefinition().addResource();
    res.setPackage(pck.getId());
    res.setName(r.getId()).setReference(new Reference().setReference(r.getElement().fhirType() + "String_Node_Str" + r.getId()));
  }
  return changed || needToBuild;
}

Fixed version (ground truth):
private boolean loadBundle(JsonPrimitive be,boolean needToBuild,FetchedFile igf) throws Exception {
  FetchedFile f=fetcher.fetch(new Reference().setReference("String_Node_Str" + be.getAsString()),igf);
  boolean changed=noteFile("String_Node_Str" + be.getAsString(),f);
  if (changed) {
    f.setBundle(new FetchedResource());
    f.setBundleType(FetchedBundleType.NATIVE);
    loadAsElementModel(f,f.getBundle());
    List<Element> entries=new ArrayList<Element>();
    f.getBundle().getElement().getNamedChildren("String_Node_Str",entries);
    for (    Element bnde : entries) {
      Element res=bnde.getNamedChild("String_Node_Str");
      FetchedResource r=f.addResource();
      r.setElement(res);
      r.setId(res.getIdBase());
      List<Element> profiles=new ArrayList<Element>();
      Element meta=res.getNamedChild("String_Node_Str");
      if (meta != null)       meta.getNamedChildren("String_Node_Str",profiles);
      for (      Element p : profiles)       r.getProfiles().add(p.primitiveValue());
      r.setTitle(r.getElement().getChildValue("String_Node_Str"));
      igpkp.findConfiguration(f,r);
    }
  }
 else   f=altMap.get("String_Node_Str" + be.getAsString());
  ImplementationGuideDefinitionPackageComponent pck=publishedIg.getDefinition().addPackage().setName(f.getTitle());
  pck.setId(be.getAsString());
  for (  FetchedResource r : f.getResources()) {
    bndIds.add(r.getElement().fhirType() + "String_Node_Str" + r.getId());
    ImplementationGuideDefinitionResourceComponent res=publishedIg.getDefinition().addResource();
    res.setPackage(pck.getId());
    res.setName(r.getId()).setReference(new Reference().setReference(r.getElement().fhirType() + "String_Node_Str" + r.getId()));
  }
  return changed || needToBuild;
}