Program: 44078
Project: 44078
Buggy source:
private Locator<Context> addContexts(List<org.dodgybits.shuffle.dto.ShuffleProtos.Context> protoContexts,int progressStart,int progressEnd){
  Set<String> allContextNames=new HashSet<String>();
  for (  org.dodgybits.shuffle.dto.ShuffleProtos.Context protoContext : protoContexts) {
    allContextNames.add(protoContext.getName());
  }
  Map<String,Context> existingContexts=BindingUtils.fetchContextsByName(PreferencesRestoreBackupActivity.this,allContextNames);
  BaseLocator<Context> contextLocator=new BaseLocator<Context>();
  List<Context> newContexts=new ArrayList<Context>();
  Set<String> newContextNames=new HashSet<String>();
  int i=0;
  int total=protoContexts.size();
  String type=getString(R.string.context_name);
  for (  org.dodgybits.shuffle.dto.ShuffleProtos.Context protoContext : protoContexts) {
    String contextName=protoContext.getName();
    Context context=existingContexts.get(contextName);
    if (context != null) {
      Log.d(cTag,"String_Node_Str" + contextName + "String_Node_Str");
    }
 else {
      Log.d(cTag,"String_Node_Str" + contextName + "String_Node_Str");
    }
    contextLocator.addItem(protoContext.getId(),contextName,context);
    String text=getString(R.string.restore_progress,type,contextName);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  BindingUtils.persistNewContexts(PreferencesRestoreBackupActivity.this,newContexts);
  Map<String,Context> savedContexts=BindingUtils.fetchContextsByName(PreferencesRestoreBackupActivity.this,newContextNames);
  for (  String contextName : newContextNames) {
    Context savedContext=savedContexts.get(contextName);
    Context restoredContext=contextLocator.findByName(contextName);
    contextLocator.addItem(restoredContext.id,contextName,savedContext);
  }
  return contextLocator;
}

Fixed version (ground truth):
private Locator<Context> addContexts(List<org.dodgybits.shuffle.dto.ShuffleProtos.Context> protoContexts,int progressStart,int progressEnd){
  Set<String> allContextNames=new HashSet<String>();
  for (  org.dodgybits.shuffle.dto.ShuffleProtos.Context protoContext : protoContexts) {
    allContextNames.add(protoContext.getName());
  }
  Map<String,Context> existingContexts=BindingUtils.fetchContextsByName(PreferencesRestoreBackupActivity.this,allContextNames);
  BaseLocator<Context> contextLocator=new BaseLocator<Context>();
  List<Context> newContexts=new ArrayList<Context>();
  Set<String> newContextNames=new HashSet<String>();
  int i=0;
  int total=protoContexts.size();
  String type=getString(R.string.context_name);
  for (  org.dodgybits.shuffle.dto.ShuffleProtos.Context protoContext : protoContexts) {
    String contextName=protoContext.getName();
    Context context=existingContexts.get(contextName);
    if (context != null) {
      Log.d(cTag,"String_Node_Str" + contextName + "String_Node_Str");
    }
 else {
      Log.d(cTag,"String_Node_Str" + contextName + "String_Node_Str");
      context=Context.buildFromDto(protoContext,getResources());
      newContexts.add(context);
      newContextNames.add(contextName);
    }
    contextLocator.addItem(protoContext.getId(),contextName,context);
    String text=getString(R.string.restore_progress,type,contextName);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  BindingUtils.persistNewContexts(PreferencesRestoreBackupActivity.this,newContexts);
  Map<String,Context> savedContexts=BindingUtils.fetchContextsByName(PreferencesRestoreBackupActivity.this,newContextNames);
  for (  String contextName : newContextNames) {
    Context savedContext=savedContexts.get(contextName);
    Context restoredContext=contextLocator.findByName(contextName);
    contextLocator.addItem(restoredContext.id,contextName,savedContext);
  }
  return contextLocator;
}