Program: 31027
Project: 31027
Buggy source:
private void syncPledges(Project forProject,Set<LHProtos.Pledge> testedPledges,List<LHProtos.Pledge> verifiedPledges){
  executor.checkOnThread();
  final ObservableSet<LHProtos.Pledge> curOpenPledges=getOpenPledgesFor(forProject);
  Map<Sha256Hash,LHProtos.Pledge> hashes=curOpenPledges.stream().collect(toMap(p -> Sha256Hash.create(p.toByteArray()),p -> p));
  Set<LHProtos.Pledge> newlyOpen=new HashSet<>(verifiedPledges);
  newlyOpen.removeAll(curOpenPledges);
  if (mode == Mode.CLIENT) {
    newlyOpen.removeIf(wallet::wasPledgeRevoked);
    newlyOpen.removeIf(pledge -> pledge.hasOrigHash() && hashes.get(hashFromPledge(pledge)) != null);
  }
  curOpenPledges.addAll(newlyOpen);
  Set<LHProtos.Pledge> newlyInvalid=new HashSet<>(testedPledges);
  newlyInvalid.removeAll(verifiedPledges);
  curOpenPledges.removeAll(newlyInvalid);
  if (forProject.getPaymentURL() != null && mode == Mode.CLIENT) {
    Set<LHProtos.Pledge> removedItems=new HashSet<>(hashes.values());
    for (    LHProtos.Pledge pledge : verifiedPledges) {
      LHProtos.Pledge orig=hashes.get(hashFromPledge(pledge));
      if (orig != null)       removedItems.remove(orig);
    }
    if (removedItems.size() > 0) {
      log.info("String_Node_Str",removedItems);
      curOpenPledges.removeAll(removedItems);
    }
  }
  if (forProject.getPaymentURL() == null || mode == Mode.SERVER) {
    Transaction claim=getClaimForProject(forProject);
    if (claim != null) {
      Set<LHProtos.Pledge> newlyClaimed=new HashSet<>(newlyInvalid);
      newlyClaimed.removeIf(pledge -> !LHUtils.pledgeAppearsInClaim(forProject,pledge,claim));
      ObservableSet<LHProtos.Pledge> cpf=getClaimedPledgesFor(forProject);
      cpf.addAll(newlyClaimed);
    }
  }
}

Fixed version (ground truth):
private void syncPledges(Project forProject,Set<LHProtos.Pledge> testedPledges,List<LHProtos.Pledge> verifiedPledges){
  executor.checkOnThread();
  final ObservableSet<LHProtos.Pledge> curOpenPledges=getOpenPledgesFor(forProject);
  Map<Sha256Hash,LHProtos.Pledge> hashes=curOpenPledges.stream().collect(toMap(LHUtils::hashFromPledge,p -> p));
  Set<LHProtos.Pledge> newlyOpen=new HashSet<>(verifiedPledges);
  newlyOpen.removeAll(curOpenPledges);
  if (mode == Mode.CLIENT) {
    newlyOpen.removeIf(wallet::wasPledgeRevoked);
    newlyOpen.removeIf(pledge -> pledge.hasOrigHash() && hashes.get(hashFromPledge(pledge)) != null);
  }
  curOpenPledges.addAll(newlyOpen);
  Set<LHProtos.Pledge> newlyInvalid=new HashSet<>(testedPledges);
  newlyInvalid.removeAll(verifiedPledges);
  curOpenPledges.removeAll(newlyInvalid);
  if (forProject.getPaymentURL() != null && mode == Mode.CLIENT) {
    Set<LHProtos.Pledge> removedItems=new HashSet<>(hashes.values());
    for (    LHProtos.Pledge pledge : verifiedPledges) {
      LHProtos.Pledge orig=hashes.get(hashFromPledge(pledge));
      if (orig != null)       removedItems.remove(orig);
    }
    if (removedItems.size() > 0) {
      log.info("String_Node_Str",removedItems);
      curOpenPledges.removeAll(removedItems);
    }
  }
  if (forProject.getPaymentURL() == null || mode == Mode.SERVER) {
    Transaction claim=getClaimForProject(forProject);
    if (claim != null) {
      Set<LHProtos.Pledge> newlyClaimed=new HashSet<>(newlyInvalid);
      newlyClaimed.removeIf(pledge -> !LHUtils.pledgeAppearsInClaim(forProject,pledge,claim));
      ObservableSet<LHProtos.Pledge> cpf=getClaimedPledgesFor(forProject);
      cpf.addAll(newlyClaimed);
    }
  }
}