nus-yam/ex-repair huggingface dataset:
Program: 30982
Project: 30982
Buggy source:
@Test public void projectAddedWithServer() throws Exception {
  projectModel.serverName.set("String_Node_Str");
  project=projectModel.getProject();
  final LHProtos.Pledge scrubbedPledge=makeScrubbedPledge();
  ObservableList<Project> projects=backend.mirrorProjects(gate);
  assertEquals(0,projects.size());
  writeProjectToDisk();
  assertEquals(0,projects.size());
  gate.waitAndRun();
  assertEquals(1,projects.size());
  final Project project1=projects.iterator().next();
  assertEquals("String_Node_Str",project1.getTitle());
  ObservableSet<LHProtos.Pledge> pledges=backend.mirrorOpenPledges(project1,gate);
  gate.waitAndRun();
  HttpExchange exchange=httpReqs.take();
  sendServerStatus(exchange,scrubbedPledge);
  pledges.addListener((SetChangeListener<LHProtos.Pledge>)c -> {
    assertTrue(c.wasAdded());
  }
);
  gate.waitAndRun();
  assertEquals(1,pledges.size());
  assertEquals(Coin.COIN.value,pledges.iterator().next().getTotalInputValue());
}

Fixed version (ground truth):
@Test public void projectAddedWithServer() throws Exception {
  projectModel.serverName.set("String_Node_Str");
  project=projectModel.getProject();
  final LHProtos.Pledge scrubbedPledge=makeScrubbedPledge(Coin.COIN);
  ObservableList<Project> projects=backend.mirrorProjects(gate);
  assertEquals(0,projects.size());
  writeProjectToDisk();
  assertEquals(0,projects.size());
  gate.waitAndRun();
  assertEquals(1,projects.size());
  final Project project1=projects.iterator().next();
  assertEquals("String_Node_Str",project1.getTitle());
  ObservableSet<LHProtos.Pledge> pledges=backend.mirrorOpenPledges(project1,gate);
  gate.waitAndRun();
  HttpExchange exchange=httpReqs.take();
  sendServerStatus(exchange,scrubbedPledge);
  pledges.addListener((SetChangeListener<LHProtos.Pledge>)c -> {
    assertTrue(c.wasAdded());
  }
);
  gate.waitAndRun();
  assertEquals(1,pledges.size());
  assertEquals(Coin.COIN.value,pledges.iterator().next().getTotalInputValue());
}
Program: 30983
Project: 30983
Buggy source:
@Test public void serverPledgeSync() throws Exception {
  projectModel.serverName.set("String_Node_Str");
  project=projectModel.getProject();
  ObservableSet<LHProtos.Pledge> openPledges=backend.mirrorOpenPledges(project,gate);
  final LHProtos.Pledge scrubbedPledge=makeScrubbedPledge();
  writeProjectToDisk();
  gate.waitAndRun();
  HttpExchange exchange=httpReqs.take();
  sendServerStatus(exchange,scrubbedPledge);
  gate.waitAndRun();
  assertEquals(1,openPledges.size());
  backend.refreshProjectStatusFromServer(project);
  gate.waitAndRun();
  sendServerStatus(httpReqs.take());
  gate.waitAndRun();
  assertEquals(0,openPledges.size());
}

Fixed version (ground truth):
@Test public void serverPledgeSync() throws Exception {
  Utils.setMockClock();
  projectModel.serverName.set("String_Node_Str");
  project=projectModel.getProject();
  ObservableSet<LHProtos.Pledge> openPledges=backend.mirrorOpenPledges(project,gate);
  ObservableSet<LHProtos.Pledge> claimedPledges=backend.mirrorClaimedPledges(project,gate);
  final LHProtos.Pledge scrubbedPledge=makeScrubbedPledge(Coin.COIN);
  writeProjectToDisk();
  gate.waitAndRun();
  HttpExchange exchange=httpReqs.take();
  sendServerStatus(exchange,scrubbedPledge);
  gate.waitAndRun();
  assertEquals(1,openPledges.size());
  assertEquals(0,claimedPledges.size());
  backend.refreshProjectStatusFromServer(project);
  gate.waitAndRun();
  sendServerStatus(httpReqs.take());
  gate.waitAndRun();
  assertEquals(0,openPledges.size());
  assertEquals(0,claimedPledges.size());
  Utils.rollMockClock(60);
  LHProtos.Pledge scrubbedPledge2=makeScrubbedPledge(Coin.COIN.divide(2));
  Utils.rollMockClock(60);
  LHProtos.Pledge scrubbedPledge3=makeScrubbedPledge(Coin.COIN.divide(2));
  backend.refreshProjectStatusFromServer(project);
  gate.waitAndRun();
  sendServerStatus(httpReqs.take(),scrubbedPledge2,scrubbedPledge3);
  gate.waitAndRun();
  gate.waitAndRun();
  assertEquals(2,openPledges.size());
  assertEquals(0,claimedPledges.size());
  backend.refreshProjectStatusFromServer(project);
  gate.waitAndRun();
  LHProtos.ProjectStatus.Builder status=LHProtos.ProjectStatus.newBuilder();
  status.setId(project.getID());
  status.setTimestamp(Instant.now().getEpochSecond());
  status.setValuePledgedSoFar(Coin.COIN.value);
  status.addPledges(scrubbedPledge2);
  status.addPledges(scrubbedPledge3);
  status.setClaimedBy(ByteString.copyFrom(Sha256Hash.ZERO_HASH.getBytes()));
  byte[] bits=status.build().toByteArray();
  exchange=httpReqs.take();
  exchange.sendResponseHeaders(HTTP_OK,bits.length);
  exchange.getResponseBody().write(bits);
  exchange.close();
  for (int i=0; i < 4; i++)   gate.waitAndRun();
  assertEquals(0,openPledges.size());
  assertEquals(2,claimedPledges.size());
}
Program: 30984
Project: 30984
Buggy source:
@Test public void serverCheckStatus() throws Exception {
  projectModel.serverName.set("String_Node_Str");
  project=projectModel.getProject();
  final LHProtos.Pledge scrubbedPledge=makeScrubbedPledge();
  ObservableMap<Project,LighthouseBackend.CheckStatus> statuses=backend.mirrorCheckStatuses(gate);
  assertEquals(0,statuses.size());
  writeProjectToDisk();
  gate.waitAndRun();
  assertEquals(1,statuses.size());
  assertNotNull(statuses.get(project));
  assertTrue(statuses.get(project).inProgress);
  assertNull(statuses.get(project).error);
  gate.waitAndRun();
  HttpExchange exchange=httpReqs.take();
  exchange.sendResponseHeaders(404,-1);
  gate.waitAndRun();
  assertEquals(1,statuses.size());
  assertFalse(statuses.get(project).inProgress);
  final Throwable error=statuses.get(project).error;
  assertNotNull(error);
  assertEquals(java.io.FileNotFoundException.class,error.getClass());
  backend.refreshProjectStatusFromServer(project);
  gate.waitAndRun();
  assertEquals(1,statuses.size());
  assertTrue(statuses.get(project).inProgress);
  gate.waitAndRun();
  exchange=httpReqs.take();
  sendServerStatus(exchange,scrubbedPledge);
  gate.waitAndRun();
  assertEquals(0,statuses.size());
}

Fixed version (ground truth):
@Test public void serverCheckStatus() throws Exception {
  projectModel.serverName.set("String_Node_Str");
  project=projectModel.getProject();
  final LHProtos.Pledge scrubbedPledge=makeScrubbedPledge(Coin.COIN);
  ObservableMap<Project,LighthouseBackend.CheckStatus> statuses=backend.mirrorCheckStatuses(gate);
  assertEquals(0,statuses.size());
  writeProjectToDisk();
  gate.waitAndRun();
  assertEquals(1,statuses.size());
  assertNotNull(statuses.get(project));
  assertTrue(statuses.get(project).inProgress);
  assertNull(statuses.get(project).error);
  gate.waitAndRun();
  HttpExchange exchange=httpReqs.take();
  exchange.sendResponseHeaders(404,-1);
  gate.waitAndRun();
  assertEquals(1,statuses.size());
  assertFalse(statuses.get(project).inProgress);
  final Throwable error=statuses.get(project).error;
  assertNotNull(error);
  assertEquals(java.io.FileNotFoundException.class,error.getClass());
  backend.refreshProjectStatusFromServer(project);
  gate.waitAndRun();
  assertEquals(1,statuses.size());
  assertTrue(statuses.get(project).inProgress);
  gate.waitAndRun();
  exchange=httpReqs.take();
  sendServerStatus(exchange,scrubbedPledge);
  gate.waitAndRun();
  assertEquals(0,statuses.size());
}
Program: 30985
Project: 30985
Buggy source:
private LHProtos.Pledge makeScrubbedPledge(){
  final LHProtos.Pledge pledge=LHProtos.Pledge.newBuilder().setTotalInputValue(Coin.COIN.value).setProjectId(project.getID()).setTimestamp(Utils.currentTimeSeconds()).addTransactions(ByteString.copyFromUtf8("String_Node_Str")).setPledgeDetails(LHProtos.PledgeDetails.newBuilder().build()).build();
  final Sha256Hash origHash=Sha256Hash.create(pledge.toByteArray());
  return pledge.toBuilder().clearTransactions().setOrigHash(ByteString.copyFrom(origHash.getBytes())).build();
}

Fixed version (ground truth):
private LHProtos.Pledge makeScrubbedPledge(Coin pledgedCoin){
  final LHProtos.Pledge pledge=LHProtos.Pledge.newBuilder().setTotalInputValue(pledgedCoin.value).setProjectId(project.getID()).setTimestamp(Utils.currentTimeSeconds()).addTransactions(ByteString.copyFromUtf8("String_Node_Str")).setPledgeDetails(LHProtos.PledgeDetails.newBuilder().build()).build();
  final Sha256Hash origHash=Sha256Hash.create(pledge.toByteArray());
  return pledge.toBuilder().clearTransactions().setOrigHash(ByteString.copyFrom(origHash.getBytes())).build();
}
Program: 30986
Project: 30986
Buggy source:
private boolean checkClaimConfidence(Transaction transaction,TransactionConfidence conf,Project project){
switch (conf.getConfidenceType()) {
case PENDING:
    int seenBy=conf.numBroadcastPeers();
  log.info("String_Node_Str",seenBy);
if (seenBy < peerGroup.getMinBroadcastConnections()) break;
case BUILDING:
if (conf.getDepthInBlocks() > 3) return true;
log.info("String_Node_Str");
if (project.getPaymentURL() == null || mode == Mode.SERVER) movePledgesFromOpenToClaimed(transaction,project);
 else refreshProjectStatusFromServer(project);
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,transaction.getHash()));
break;
case DEAD:
log.warn("String_Node_Str",conf.getOverridingTransaction());
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.ERROR,null));
break;
case UNKNOWN:
break;
}
return false;
}

Fixed version (ground truth):
private boolean checkClaimConfidence(Transaction transaction,TransactionConfidence conf,Project project){
  executor.checkOnThread();
switch (conf.getConfidenceType()) {
case PENDING:
    int seenBy=conf.numBroadcastPeers();
  log.info("String_Node_Str",seenBy);
if (seenBy < peerGroup.getMinBroadcastConnections()) break;
case BUILDING:
if (conf.getDepthInBlocks() > 3) return true;
if (diskManager.getProjectState(project).state != ProjectState.CLAIMED) {
log.info("String_Node_Str");
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,transaction.getHash()));
if (project.getPaymentURL() == null || mode == Mode.SERVER) {
movePledgesFromOpenToClaimed(transaction,project);
}
 else {
jitteredServerRequery(project);
}
}
break;
case DEAD:
log.warn("String_Node_Str",conf.getOverridingTransaction());
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.ERROR,null));
break;
case UNKNOWN:
break;
}
return false;
}
Program: 30987
Project: 30987
Buggy source:
private CompletableFuture<LHProtos.Pledge> checkPledgeAgainstP2PNetwork(Project project,LHProtos.Pledge pledge){
  return checkPledgesAgainstP2PNetwork(project,FXCollections.observableSet(pledge),false).thenApply(results -> {
    if (results.isEmpty())     return null;
 else     return results.iterator().next();
  }
);
}

Fixed version (ground truth):
private void checkPledgeAgainstP2PNetwork(Project project,LHProtos.Pledge pledge){
  checkPledgesAgainstP2PNetwork(project,FXCollections.observableSet(pledge),false);
}
Program: 30989
Project: 30989
Buggy source:
/** 
 * Invokes a manual refresh by going back to the server. Can be called from any thread. 
 */
public CompletableFuture<LHProtos.ProjectStatus> refreshProjectStatusFromServer(Project project,@Nullable KeyParameter aesKey){
  checkState(mode == Mode.CLIENT);
  CompletableFuture<LHProtos.ProjectStatus> future=new CompletableFuture<>();
  executor.execute(() -> {
    markAsInProgress(project);
    project.getStatus(wallet,aesKey).whenCompleteAsync((status,ex) -> {
      if (ex != null) {
        markAsErrored(project,ex);
        future.completeExceptionally(ex);
      }
 else {
        try {
          log.info("String_Node_Str",status);
          syncPledges(project,new HashSet<>(status.getPledgesList()),status.getPledgesList());
          if (status.hasClaimedBy() && diskManager.getProjectState(project).state != ProjectState.CLAIMED) {
            diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,new Sha256Hash(status.getClaimedBy().toByteArray())));
          }
          markAsCheckDone(project);
          future.complete(status);
        }
 catch (        Throwable t) {
          future.completeExceptionally(t);
        }
      }
    }
,executor);
  }
);
  return future;
}

Fixed version (ground truth):
/** 
 * Invokes a manual refresh by going back to the server. Can be called from any thread. 
 */
public CompletableFuture<LHProtos.ProjectStatus> refreshProjectStatusFromServer(Project project,@Nullable KeyParameter aesKey){
  checkState(mode == Mode.CLIENT);
  CompletableFuture<LHProtos.ProjectStatus> future=new CompletableFuture<>();
  executor.execute(() -> {
    markAsInProgress(project);
    project.getStatus(wallet,aesKey).whenCompleteAsync((status,ex) -> {
      if (ex != null) {
        markAsErrored(project,ex);
        future.completeExceptionally(ex);
      }
 else {
        try {
          log.info("String_Node_Str",status);
          executor.checkOnThread();
          if (status.hasClaimedBy()) {
            if (diskManager.getProjectState(project).state != ProjectState.CLAIMED) {
              diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,new Sha256Hash(status.getClaimedBy().toByteArray())));
            }
            ObservableSet<LHProtos.Pledge> curOpenPledges=getOpenPledgesFor(project);
            ObservableSet<LHProtos.Pledge> curClaimedPledges=getClaimedPledgesFor(project);
            log.info("String_Node_Str",curOpenPledges.size(),curClaimedPledges.size());
            curClaimedPledges.clear();
            curClaimedPledges.addAll(status.getPledgesList());
            curOpenPledges.clear();
          }
 else {
            syncPledges(project,new HashSet<>(status.getPledgesList()),status.getPledgesList());
          }
          markAsCheckDone(project);
          future.complete(status);
          log.info("String_Node_Str");
        }
 catch (        Throwable t) {
          log.error("String_Node_Str",t);
          future.completeExceptionally(t);
        }
      }
    }
,executor);
  }
);
  return future;
}
Program: 30990
Project: 30990
Buggy source:
private void updateExistingProject(int index,Project newProject,Project prevProject){
  projectsVBox.getChildren().set(projectsVBox.getChildren().size() - 2 - index,buildProjectWidget(newProject));
  if (inProjectView.get() && projectView.getProject().equals(prevProject)) {
    projectView.setProject(newProject);
  }
}

Fixed version (ground truth):
private void updateExistingProject(int index,Project newProject,Project prevProject){
  log.info("String_Node_Str",index);
  projectsVBox.getChildren().set(projectsVBox.getChildren().size() - 2 - index,buildProjectWidget(newProject));
  if (inProjectView.get() && projectView.getProject().equals(prevProject)) {
    projectView.setProject(newProject);
  }
}
Program: 30992
Project: 30992
Buggy source:
public void importProjectFrom(Path file) throws IOException {
  checkState(Files.isRegularFile(file));
  Path destPath=AppDirectory.dir().resolve(file.getFileName());
  Path tmpPath=Paths.get(destPath + "String_Node_Str");
  Files.copy(file,tmpPath,StandardCopyOption.REPLACE_EXISTING);
  Files.move(tmpPath,destPath,StandardCopyOption.REPLACE_EXISTING);
  Runnable runnable=() -> watchDirectoryForPledges(file.getParent());
  executor.executeIn(Duration.ofSeconds(3),runnable);
}

Fixed version (ground truth):
public void importProjectFrom(Path file) throws IOException {
  checkState(Files.isRegularFile(file));
  Path destPath=AppDirectory.dir().resolve(file.getFileName());
  if (Files.exists(destPath)) {
    Sha256Hash theirHash=Sha256Hash.hashFileContents(file.toFile());
    Sha256Hash ourHash=Sha256Hash.hashFileContents(destPath.toFile());
    if (theirHash.equals(ourHash)) {
      log.info("String_Node_Str");
      return;
    }
  }
  Path tmpPath=Paths.get(destPath + "String_Node_Str");
  Files.copy(file,tmpPath,StandardCopyOption.REPLACE_EXISTING);
  Files.move(tmpPath,destPath,StandardCopyOption.REPLACE_EXISTING);
  Runnable runnable=() -> watchDirectoryForPledges(file.getParent());
  executor.executeIn(Duration.ofSeconds(3),runnable);
}
Program: 30993
Project: 30993
Buggy source:
private boolean checkClaimConfidence(Transaction t,Project project){
switch (t.getConfidence().getConfidenceType()) {
case PENDING:
    int seenBy=t.getConfidence().numBroadcastPeers();
  log.info("String_Node_Str",seenBy);
if (seenBy < peerGroup.getMinBroadcastConnections() || wallet.getParams().equals(RegTestParams.get())) break;
case BUILDING:
log.info("String_Node_Str");
if (t.getConfidence().getDepthInBlocks() > 3) return true;
if (project.getPaymentURL() == null) movePledgesFromOpenToClaimed(t,project);
 else refreshProjectStatusFromServer(project);
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,t.getHash()));
break;
case DEAD:
log.warn("String_Node_Str",t.getConfidence().getOverridingTransaction());
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.ERROR,null));
break;
case UNKNOWN:
break;
}
return false;
}

Fixed version (ground truth):
private boolean checkClaimConfidence(Transaction t,Project project){
switch (t.getConfidence().getConfidenceType()) {
case PENDING:
    int seenBy=t.getConfidence().numBroadcastPeers();
  log.info("String_Node_Str",seenBy);
if (seenBy < peerGroup.getMinBroadcastConnections() || wallet.getParams().equals(RegTestParams.get())) break;
case BUILDING:
if (t.getConfidence().getDepthInBlocks() > 3) return true;
log.info("String_Node_Str");
if (project.getPaymentURL() == null || mode == Mode.SERVER) movePledgesFromOpenToClaimed(t,project);
 else refreshProjectStatusFromServer(project);
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,t.getHash()));
break;
case DEAD:
log.warn("String_Node_Str",t.getConfidence().getOverridingTransaction());
diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.ERROR,null));
break;
case UNKNOWN:
break;
}
return false;
}
Program: 30994
Project: 30994
Buggy source:
private CompletableFuture<Void> lookupPledgesFromServer(Project project){
  CompletableFuture<Void> future=new CompletableFuture<>();
  executor.execute(() -> {
    markAsInProgress(project);
    project.getStatus(wallet,null).whenCompleteAsync((status,ex) -> {
      if (ex != null) {
        markAsErrored(project,ex);
        future.completeExceptionally(ex);
      }
 else {
        log.info("String_Node_Str",status);
        syncPledges(project,new HashSet<>(status.getPledgesList()),status.getPledgesList());
        if (status.hasClaimedBy() && diskManager.getProjectState(project).state != ProjectState.CLAIMED) {
          diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,new Sha256Hash(status.getClaimedBy().toByteArray())));
        }
        markAsCheckDone(project);
        future.complete(null);
      }
    }
,executor);
  }
);
  return future;
}

Fixed version (ground truth):
private CompletableFuture<Void> lookupPledgesFromServer(Project project){
  checkState(mode == Mode.CLIENT);
  CompletableFuture<Void> future=new CompletableFuture<>();
  executor.execute(() -> {
    markAsInProgress(project);
    project.getStatus(wallet,null).whenCompleteAsync((status,ex) -> {
      if (ex != null) {
        markAsErrored(project,ex);
        future.completeExceptionally(ex);
      }
 else {
        log.info("String_Node_Str",status);
        syncPledges(project,new HashSet<>(status.getPledgesList()),status.getPledgesList());
        if (status.hasClaimedBy() && diskManager.getProjectState(project).state != ProjectState.CLAIMED) {
          diskManager.setProjectState(project,new ProjectStateInfo(ProjectState.CLAIMED,new Sha256Hash(status.getClaimedBy().toByteArray())));
        }
        markAsCheckDone(project);
        future.complete(null);
      }
    }
,executor);
  }
);
  return future;
}
Program: 30995
Project: 30995
Buggy source:
private void updateForProject(){
  pieChart.getData().clear();
  pledgesList.getItems().clear();
  final Project p=project.get();
  projectTitle.setText(p.getTitle());
  goalAmountLabel.setText(String.format(goalAmountFormatStr,p.getGoalAmount().toPlainString()));
  description.getChildren().setAll(new Text(project.get().getMemo()));
  pledgesListVBox.visibleProperty().bind(not(isEmpty(pledgesList.getItems())));
  noPledgesLabel.visibleProperty().bind(isEmpty(pledgesList.getItems()));
  Image img=new Image(p.getCoverImage().newInput());
  if (img.getException() != null)   Throwables.propagate(img.getException());
  BackgroundSize cover=new BackgroundSize(BackgroundSize.AUTO,BackgroundSize.AUTO,false,false,false,true);
  BackgroundImage bimg=new BackgroundImage(img,BackgroundRepeat.NO_REPEAT,BackgroundRepeat.NO_REPEAT,BackgroundPosition.DEFAULT,cover);
  coverImage.setBackground(new Background(bimg));
  emptySlice=new PieChart.Data("String_Node_Str",0);
  if (bindings != null)   bindings.unbind();
  bindings=new UIBindings();
  emptySlice.getNode().setVisible(false);
  checkForMyPledge(p);
  editButton.setVisible(Main.wallet.isProjectMine(p));
  if (p.getPaymentURL() != null) {
    Platform.runLater(() -> {
      Main.instance.scene.getAccelerators().put(KeyCombination.keyCombination("String_Node_Str"),() -> Main.backend.refreshProjectStatusFromServer(p));
    }
);
  }
}

Fixed version (ground truth):
private void updateForProject(){
  pieChart.getData().clear();
  pledgesList.getItems().clear();
  final Project p=project.get();
  projectTitle.setText(p.getTitle());
  goalAmountLabel.setText(String.format(goalAmountFormatStr,p.getGoalAmount().toPlainString()));
  description.getChildren().setAll(new Text(project.get().getMemo()));
  pledgesListVBox.visibleProperty().bind(not(isEmpty(pledgesList.getItems())));
  noPledgesLabel.visibleProperty().bind(isEmpty(pledgesList.getItems()));
  Image img=new Image(p.getCoverImage().newInput());
  if (img.getException() != null)   Throwables.propagate(img.getException());
  BackgroundSize cover=new BackgroundSize(BackgroundSize.AUTO,BackgroundSize.AUTO,false,false,false,true);
  BackgroundImage bimg=new BackgroundImage(img,BackgroundRepeat.NO_REPEAT,BackgroundRepeat.NO_REPEAT,BackgroundPosition.DEFAULT,cover);
  coverImage.setBackground(new Background(bimg));
  emptySlice=new PieChart.Data("String_Node_Str",0);
  if (bindings != null)   bindings.unbind();
  bindings=new UIBindings();
  emptySlice.getNode().setVisible(false);
  checkForMyPledge(p);
  editButton.setVisible(Main.wallet.isProjectMine(p));
  Main.wallet.addOnRevokeHandler(pledge -> setModeFor(p,pledgedValue.get()),Platform::runLater);
  if (p.getPaymentURL() != null) {
    Platform.runLater(() -> {
      Main.instance.scene.getAccelerators().put(KeyCombination.keyCombination("String_Node_Str"),() -> Main.backend.refreshProjectStatusFromServer(p));
    }
);
  }
}
Program: 30996
Project: 30996
Buggy source:
private synchronized void updateForRevoke(Sha256Hash hash,Transaction tx,LHProtos.Pledge proto,TransactionOutput stub){
  revokeInProgress.remove(tx);
  revokedPledges.put(hash,proto);
  pledges.remove(stub);
  projects.inverse().remove(proto);
}

Fixed version (ground truth):
private synchronized void updateForRevoke(Transaction tx,LHProtos.Pledge proto,TransactionOutput stub){
  revokeInProgress.remove(tx);
  revokedPledges.put(LHUtils.hashFromPledge(proto),proto);
  pledges.remove(stub);
  projects.inverse().remove(proto);
}
Program: 30997
Project: 30997
Buggy source:
@Override protected void queueOnCoinsSent(Transaction tx,Coin prevBalance,Coin newBalance){
  super.queueOnCoinsSent(tx,prevBalance,newBalance);
synchronized (this) {
    for (    Map.Entry<TransactionOutput,LHProtos.Pledge> entry : pledges.entrySet()) {
      TransactionInput spentBy=entry.getKey().getSpentBy();
      if (spentBy != null && tx.equals(spentBy.getParentTransaction())) {
        if (!revokeInProgress.contains(tx)) {
          log.info("String_Node_Str");
          LHProtos.Pledge pledge=entry.getValue();
          Project project=projects.inverse().get(pledge);
          checkNotNull(project);
          if (compareOutputsStructurally(tx,project)) {
            log.info("String_Node_Str");
            for (            ListenerRegistration<OnClaimHandler> handler : onClaimedHandlers) {
              handler.executor.execute(() -> handler.listener.onClaim(pledge,tx));
            }
          }
 else {
            log.warn("String_Node_Str");
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void queueOnCoinsSent(Transaction tx,Coin prevBalance,Coin newBalance){
  super.queueOnCoinsSent(tx,prevBalance,newBalance);
synchronized (this) {
    for (    Map.Entry<TransactionOutput,LHProtos.Pledge> entry : new HashSet<>(pledges.entrySet())) {
      TransactionInput spentBy=entry.getKey().getSpentBy();
      if (spentBy != null && tx.equals(spentBy.getParentTransaction())) {
        if (!revokeInProgress.contains(tx)) {
          log.info("String_Node_Str");
          LHProtos.Pledge pledge=entry.getValue();
          Project project=projects.inverse().get(pledge);
          checkNotNull(project);
          if (compareOutputsStructurally(tx,project)) {
            log.info("String_Node_Str");
            for (            ListenerRegistration<OnClaimHandler> handler : onClaimedHandlers) {
              handler.executor.execute(() -> handler.listener.onClaim(pledge,tx));
            }
          }
 else {
            log.warn("String_Node_Str");
            updateForRevoke(tx,pledge,entry.getKey());
            for (            ListenerRegistration<OnRevokeHandler> handler : onRevokeHandlers) {
              handler.executor.execute(() -> handler.listener.onRevoke(pledge));
            }
            saveNow();
          }
        }
      }
    }
  }
}
Program: 30999
Project: 30999
Buggy source:
@Override public void onSuccess(@Nullable Transaction result){
  final Sha256Hash hash=hashFromPledge(proto);
  log.info("String_Node_Str",hash);
  log.info("String_Node_Str",proto.getTransactionsCount());
  updateForRevoke(hash,result,proto,stub);
  saveNow();
  for (  ListenerRegistration<OnRevokeHandler> handler : onRevokeHandlers) {
    handler.executor.execute(() -> handler.listener.onRevoke(proto));
  }
  lock.lock();
  try {
    maybeQueueOnWalletChanged();
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override public void onSuccess(@Nullable Transaction result){
  log.info("String_Node_Str",hashFromPledge(proto));
  log.info("String_Node_Str",proto.getTransactionsCount());
  updateForRevoke(result,proto,stub);
  saveNow();
  for (  ListenerRegistration<OnRevokeHandler> handler : onRevokeHandlers) {
    handler.executor.execute(() -> handler.listener.onRevoke(proto));
  }
  lock.lock();
  try {
    maybeQueueOnWalletChanged();
  }
  finally {
    lock.unlock();
  }
}
Program: 31001
Project: 31001
Buggy source:
@Override public void stop() throws Exception {
  if (bitcoin != null && bitcoin.isRunning()) {
    bitcoin.stopAsync();
    bitcoin.awaitTerminated();
  }
  super.stop();
}

Fixed version (ground truth):
@Override public void stop() throws Exception {
  if (bitcoin != null && bitcoin.isRunning()) {
    backend.shutdown();
    bitcoin.stopAsync();
    bitcoin.awaitTerminated();
  }
  super.stop();
}
Program: 31002
Project: 31002
Buggy source:
public void onBitcoinSetup(){
  bitcoinUIModel.setWallet(Main.wallet);
  addressControl.addressProperty().bind(bitcoinUIModel.addressProperty());
  balance.textProperty().bind(EasyBind.map(bitcoinUIModel.balanceProperty(),coin -> MonetaryFormat.BTC.noCode().format(coin).toString()));
  sendMoneyOutBtn.disableProperty().bind(bitcoinUIModel.balanceProperty().isEqualTo(Coin.ZERO));
  if (Main.params != MainNetParams.get()) {
    networkIndicatorLabel.setVisible(true);
    if (Main.params == TestNet3Params.get())     networkIndicatorLabel.setText("String_Node_Str");
 else     if (Main.params == RegTestParams.get())     networkIndicatorLabel.setText("String_Node_Str");
 else     networkIndicatorLabel.setText("String_Node_Str");
  }
  if (firstTime) {
    firstTime=false;
    setupBitcoinSyncNotification();
    doOnlineUpdateCheck();
    maybeShowReleaseNotes();
  }
}

Fixed version (ground truth):
public void onBitcoinSetup(){
  checkGuiThread();
  bitcoinUIModel.setWallet(Main.wallet);
  addressControl.addressProperty().bind(bitcoinUIModel.addressProperty());
  balance.textProperty().bind(EasyBind.map(bitcoinUIModel.balanceProperty(),coin -> MonetaryFormat.BTC.noCode().format(coin).toString()));
  sendMoneyOutBtn.disableProperty().bind(bitcoinUIModel.balanceProperty().isEqualTo(Coin.ZERO));
  if (Main.params != MainNetParams.get()) {
    networkIndicatorLabel.setVisible(true);
    if (Main.params == TestNet3Params.get())     networkIndicatorLabel.setText("String_Node_Str");
 else     if (Main.params == RegTestParams.get())     networkIndicatorLabel.setText("String_Node_Str");
 else     networkIndicatorLabel.setText("String_Node_Str");
  }
  if (firstTime) {
    firstTime=false;
    setupBitcoinSyncNotification();
    doOnlineUpdateCheck();
    maybeShowReleaseNotes();
  }
}
Program: 31003
Project: 31003
Buggy source:
@FXML public void restoreClicked(ActionEvent event){
  if (Main.bitcoin.wallet().getBalance().value > 0) {
    informationalAlert("String_Node_Str","String_Node_Str" + "String_Node_Str");
    return;
  }
  if (aesKey != null) {
    informationalAlert("String_Node_Str","String_Node_Str");
  }
  log.info("String_Node_Str",wordsArea.getText(),datePicker.getValue());
  informationalAlert("String_Node_Str","String_Node_Str");
  overlayUI.done();
  long birthday=datePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC);
  DeterministicSeed seed=new DeterministicSeed(Splitter.on(' ').splitToList(wordsArea.getText()),null,"String_Node_Str",birthday);
  Main.bitcoin.addListener(new Service.Listener(){
    @Override public void terminated(    Service.State from){
      uncheck(() -> Main.instance.initBitcoin(seed));
      Main.bitcoin.startAsync();
    }
  }
,Platform::runLater);
  Main.bitcoin.stopAsync();
}

Fixed version (ground truth):
@FXML public void restoreClicked(ActionEvent event){
  if (Main.bitcoin.wallet().getBalance().value > 0) {
    informationalAlert("String_Node_Str","String_Node_Str" + "String_Node_Str");
    return;
  }
  if (aesKey != null) {
    informationalAlert("String_Node_Str","String_Node_Str");
  }
  log.info("String_Node_Str",wordsArea.getText(),datePicker.getValue());
  informationalAlert("String_Node_Str","String_Node_Str");
  overlayUI.done();
  long birthday=datePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC);
  DeterministicSeed seed=new DeterministicSeed(Splitter.on(' ').splitToList(wordsArea.getText()),null,"String_Node_Str",birthday);
  Main.restartBitcoinJ(seed);
}
Program: 31005
Project: 31005
Buggy source:
@After public void tearDown(){
  super.tearDown();
  executor.service.shutdown();
  localServer.stop(Integer.MAX_VALUE);
}

Fixed version (ground truth):
@After public void tearDown(){
  super.tearDown();
  backend.shutdown();
  localServer.stop(Integer.MAX_VALUE);
}
Program: 31006
Project: 31006
Buggy source:
public void shutdown(){
  executor.execute(() -> {
    peerGroup.removePeerFilterProvider(manager);
    peerGroup.removeEventListener(manager);
  }
);
}

Fixed version (ground truth):
public void shutdown(){
  ignoreAndLog(() -> Uninterruptibles.getUninterruptibly(executor.service.submit(() -> {
    peerGroup.removePeerFilterProvider(manager);
    peerGroup.removeEventListener(manager);
    diskManager.shutdown();
    executor.service.shutdown();
  }
)));
}
Program: 31007
Project: 31007
Buggy source:
public static void importProject(Path file){
  String msg;
  try {
    if (Main.backend.importProjectFrom(file) != null)     return;
    msg="String_Node_Str";
  }
 catch (  IOException e) {
    msg=e.getLocalizedMessage();
  }
  GuiUtils.informationalAlert("String_Node_Str","String_Node_Str" + msg);
}

Fixed version (ground truth):
public static void importProject(Path file){
  try {
    Main.backend.importProjectFrom(file);
  }
 catch (  IOException e) {
    GuiUtils.informationalAlert("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 31008
Project: 31008
Buggy source:
private void saveAndWatchDirectory(Project project,Path dirPath){
  try {
    Path file=dirPath.resolve(project.getSuggestedFileName());
    try (OutputStream stream=new BufferedOutputStream(Files.newOutputStream(file))){
      project.getProto().writeTo(stream);
    }
     Main.backend.importProjectFrom(file);
    Main.backend.watchDirectoryForPledges(dirPath);
  }
 catch (  IOException e) {
    crashAlert(e);
  }
}

Fixed version (ground truth):
private void saveAndWatchDirectory(Project project,Path dirPath){
  try {
    Path file=dirPath.resolve(project.getSuggestedFileName());
    try (OutputStream stream=new BufferedOutputStream(Files.newOutputStream(file))){
      project.getProto().writeTo(stream);
    }
     Main.backend.importProjectFrom(file);
  }
 catch (  IOException e) {
    crashAlert(e);
  }
}
Program: 31009
Project: 31009
Buggy source:
private void jitteredExecute(Runnable runnable,int baseSeconds){
  if (executor instanceof AffinityExecutor.ServiceAffinityExecutor) {
    ScheduledExecutorService service=((AffinityExecutor.ServiceAffinityExecutor)executor).service;
    int jitterSeconds=Math.min(maxJitterSeconds,baseSeconds + (int)(Math.random() * baseSeconds));
    log.info("String_Node_Str",jitterSeconds);
    service.schedule(runnable,jitterSeconds,TimeUnit.SECONDS);
  }
 else {
    runnable.run();
  }
}

Fixed version (ground truth):
private void jitteredExecute(Runnable runnable,int baseSeconds){
  if (executor instanceof AffinityExecutor.ServiceAffinityExecutor) {
    int jitterSeconds=Math.min(maxJitterSeconds,baseSeconds + (int)(Math.random() * baseSeconds));
    log.info("String_Node_Str",jitterSeconds);
    scheduleInSeconds(jitterSeconds,runnable);
  }
 else {
    runnable.run();
  }
}
Program: 31010
Project: 31010
Buggy source:
@Nullable public Project importProjectFrom(Path file) throws IOException {
  checkState(Files.isRegularFile(file));
  Path destPath=AppDirectory.dir().resolve(file.getFileName());
  Path tmpPath=Paths.get(destPath + "String_Node_Str");
  Files.copy(file,tmpPath);
  Files.move(tmpPath,destPath);
  return executor.fetchFrom(() -> {
    Project p=diskManager.tryLoadProject(destPath);
    if (p == null) {
      log.error("String_Node_Str");
      return null;
    }
 else {
      if (p.getPaymentURL() == null)       watchDirectoryForPledges(file.getParent());
      return p;
    }
  }
);
}

Fixed version (ground truth):
public void importProjectFrom(Path file) throws IOException {
  checkState(Files.isRegularFile(file));
  Path destPath=AppDirectory.dir().resolve(file.getFileName());
  Path tmpPath=Paths.get(destPath + "String_Node_Str");
  Files.copy(file,tmpPath,StandardCopyOption.REPLACE_EXISTING);
  Files.move(tmpPath,destPath,StandardCopyOption.REPLACE_EXISTING);
  scheduleInSeconds(6,() -> watchDirectoryForPledges(file.getParent()));
}
Program: 31012
Project: 31012
Buggy source:
public static void openForPledge(Project project,PledgingWallet.PledgeSupplier pledge){
  log.info("String_Node_Str",project.getTitle());
  ExportWindow window=Main.instance.<ExportWindow>overlayUI("String_Node_Str","String_Node_Str").controller;
  window.project=project;
  window.pledge=pledge;
}

Fixed version (ground truth):
public static void openForPledge(Project project,PledgingWallet.PledgeSupplier pledge){
  log.info("String_Node_Str",project.getTitle());
  ExportWindow window=Main.instance.<ExportWindow>overlayUI("String_Node_Str","String_Node_Str").controller;
  window.project=project;
  window.pledge=pledge;
  ((BorderPane)window.folderWatchExplainer.getParent()).setBottom(null);
}
Program: 31014
Project: 31014
Buggy source:
public void shutdown(){
  peerGroup.removePeerFilterProvider(manager);
  peerGroup.removeEventListener(manager);
}

Fixed version (ground truth):
public void shutdown(){
  executor.execute(() -> {
    peerGroup.removePeerFilterProvider(manager);
    peerGroup.removeEventListener(manager);
  }
);
}
Program: 31015
Project: 31015
Buggy source:
private void loadAll() throws IOException {
  executor.checkOnThread();
  log.info("String_Node_Str");
  for (  Path path : LHUtils.listDir(AppDirectory.dir())) {
    if (!path.toString().endsWith(PROJECT_FILE_EXTENSION))     continue;
    if (!Files.isRegularFile(path) || (tryLoadProject(path) == null))     log.warn("String_Node_Str",path);
  }
  loadPledgesFromDirectory(AppDirectory.dir());
  for (  Path path : pledgePaths) {
    if (!Files.isDirectory(path))     continue;
    loadPledgesFromDirectory(path);
  }
  loadProjectStatuses();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
private void loadAll() throws IOException {
  executor.checkOnThread();
  log.info("String_Node_Str");
  loadProjectStatuses();
  List<String> ids=new ArrayList<>(projectStatesMap.keySet());
  for (  Path path : LHUtils.listDir(AppDirectory.dir())) {
    if (!path.toString().endsWith(PROJECT_FILE_EXTENSION))     continue;
    if (!Files.isRegularFile(path))     continue;
    if (tryLoadProject(path) == null)     log.warn("String_Node_Str",path);
  }
  projects.sort(new Comparator<Project>(){
    @Override public int compare(    Project o1,    Project o2){
      int o1i=ids.indexOf(o1.getID());
      int o2i=ids.indexOf(o2.getID());
      if (o1i == -1)       o1i=Integer.MAX_VALUE;
      if (o2i == -1)       o2i=Integer.MAX_VALUE;
      return Integer.compare(o1i,o2i);
    }
  }
);
  loadPledgesFromDirectory(AppDirectory.dir());
  for (  Path path : pledgePaths) {
    if (!Files.isDirectory(path))     continue;
    loadPledgesFromDirectory(path);
  }
  log.info("String_Node_Str");
}
Program: 31016
Project: 31016
Buggy source:
/** 
 * Creates a disk manager that reloads data from disk when a new project path is added or the directories change. This object should be owned by the thread backing owningExecutor: changes will all be queued onto this thread.
 */
public DiskManager(AffinityExecutor.ServiceAffinityExecutor owningExecutor){
  executor=owningExecutor;
  projects=FXCollections.observableArrayList();
  projectsById=FXCollections.observableHashMap();
  projectsByPath=new HashMap<>();
  projectStates=FXCollections.observableHashMap();
  pledgesByPath=new HashMap<>();
  pledges=new HashMap<>();
  pledgePaths=new ArrayList<>();
  owningExecutor.execute(() -> uncheck(this::init));
}

Fixed version (ground truth):
/** 
 * Creates a disk manager that reloads data from disk when a new project path is added or the directories change. This object should be owned by the thread backing owningExecutor: changes will all be queued onto this thread.
 */
public DiskManager(AffinityExecutor.ServiceAffinityExecutor owningExecutor){
  executor=owningExecutor;
  projects=FXCollections.observableArrayList();
  projectsById=FXCollections.observableHashMap();
  projectsByPath=new HashMap<>();
  projectStatesMap=new LinkedHashMap<>();
  projectStates=FXCollections.observableMap(projectStatesMap);
  pledgesByPath=new HashMap<>();
  pledges=new HashMap<>();
  pledgePaths=new ArrayList<>();
  owningExecutor.execute(() -> uncheck(this::init));
}
Program: 31017
Project: 31017
Buggy source:
private void loadProjectStatuses() throws IOException {
  Path path=AppDirectory.dir().resolve(PROJECT_STATUS_FILENAME);
  projectStates.addListener((InvalidationListener)x -> saveProjectStatuses());
  if (!Files.exists(path))   return;
  Properties properties=new Properties();
  try (InputStream stream=Files.newInputStream(path)){
    properties.load(stream);
  }
   for (  Object o : properties.keySet()) {
    String key=(String)o;
    String val=properties.getProperty(key);
    if (val.equals("String_Node_Str")) {
      projectStates.put(key,new LighthouseBackend.ProjectStateInfo(LighthouseBackend.ProjectState.OPEN,null));
    }
 else {
      Sha256Hash claimedBy=new Sha256Hash(val);
      log.info("String_Node_Str",key,claimedBy);
      projectStates.put(key,new LighthouseBackend.ProjectStateInfo(LighthouseBackend.ProjectState.CLAIMED,claimedBy));
    }
  }
}

Fixed version (ground truth):
private void loadProjectStatuses() throws IOException {
  Path path=AppDirectory.dir().resolve(PROJECT_STATUS_FILENAME);
  projectStates.addListener((InvalidationListener)x -> saveProjectStatuses());
  if (!Files.exists(path))   return;
  List<String> lines=Files.readAllLines(path);
  for (  String line : lines) {
    if (line.startsWith("String_Node_Str"))     continue;
    List<String> parts=Splitter.on("String_Node_Str").splitToList(line);
    String key=parts.get(0);
    String val=parts.get(1);
    if (val.equals("String_Node_Str")) {
      projectStates.put(key,new LighthouseBackend.ProjectStateInfo(LighthouseBackend.ProjectState.OPEN,null));
    }
 else {
      Sha256Hash claimedBy=new Sha256Hash(val);
      log.info("String_Node_Str",key,claimedBy);
      projectStates.put(key,new LighthouseBackend.ProjectStateInfo(LighthouseBackend.ProjectState.CLAIMED,claimedBy));
    }
  }
}
Program: 31018
Project: 31018
Buggy source:
private void saveProjectStatuses(){
  log.info("String_Node_Str");
  Path path=AppDirectory.dir().resolve(PROJECT_STATUS_FILENAME);
  Properties properties=new Properties();
  for (  Map.Entry<String,LighthouseBackend.ProjectStateInfo> entry : projectStates.entrySet()) {
    String val=entry.getValue().state == LighthouseBackend.ProjectState.OPEN ? "String_Node_Str" : checkNotNull(entry.getValue().claimedBy).toString();
    properties.setProperty(entry.getKey(),val);
  }
  if (properties.isEmpty())   return;
  try (OutputStream stream=Files.newOutputStream(path)){
    properties.store(stream,"String_Node_Str");
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void saveProjectStatuses(){
  log.info("String_Node_Str");
  Path path=AppDirectory.dir().resolve(PROJECT_STATUS_FILENAME);
  List<String> lines=new ArrayList<>();
  for (  Map.Entry<String,LighthouseBackend.ProjectStateInfo> entry : projectStates.entrySet()) {
    String val=entry.getValue().state == LighthouseBackend.ProjectState.OPEN ? "String_Node_Str" : checkNotNull(entry.getValue().claimedBy).toString();
    lines.add(entry.getKey() + "String_Node_Str" + val);
  }
  uncheck(() -> Files.write(path,lines));
}
Program: 31022
Project: 31022
Buggy source:
@Test public void pledgeAddedViaWallet() throws Exception {
  ObservableList<Project> projects=backend.mirrorProjects(gate);
  writeProjectToDisk();
  gate.waitAndRun();
  assertEquals(1,projects.size());
  Transaction payment=FakeTxBuilder.createFakeTx(params,Coin.COIN,pledgingWallet.currentReceiveAddress());
  FakeTxBuilder.BlockPair bp=createFakeBlock(blockStore,payment);
  wallet.receiveFromBlock(payment,bp.storedBlock,AbstractBlockChain.NewBlockType.BEST_CHAIN,0);
  wallet.notifyNewBestBlock(bp.storedBlock);
  PledgingWallet.PendingPledge pendingPledge=pledgingWallet.createPledge(project,Coin.COIN.value / 2,null);
  ObservableSet<LHProtos.Pledge> pledges=backend.mirrorOpenPledges(project,gate);
  assertEquals(0,pledges.size());
  LHProtos.Pledge proto=pendingPledge.commit(true);
  gate.waitAndRun();
  assertEquals(1,pledges.size());
  assertEquals(proto,pledges.iterator().next());
}

Fixed version (ground truth):
@Test public void pledgeAddedViaWallet() throws Exception {
  ObservableList<Project> projects=backend.mirrorProjects(gate);
  writeProjectToDisk();
  gate.waitAndRun();
  assertEquals(1,projects.size());
  Transaction payment=FakeTxBuilder.createFakeTx(params,Coin.COIN,pledgingWallet.currentReceiveAddress());
  FakeTxBuilder.BlockPair bp=createFakeBlock(blockStore,payment);
  wallet.receiveFromBlock(payment,bp.storedBlock,AbstractBlockChain.NewBlockType.BEST_CHAIN,0);
  wallet.notifyNewBestBlock(bp.storedBlock);
  PledgingWallet.PendingPledge pendingPledge=pledgingWallet.createPledge(project,Coin.COIN.value,null);
  ObservableSet<LHProtos.Pledge> pledges=backend.mirrorOpenPledges(project,gate);
  assertEquals(0,pledges.size());
  LHProtos.Pledge proto=pendingPledge.commit(true);
  gate.waitAndRun();
  assertEquals(1,pledges.size());
  assertEquals(proto,pledges.iterator().next());
  writePledgeToDisk(AppDirectory.dir(),proto);
  initCoreState();
  ObservableMap<Project,LighthouseBackend.CheckStatus> statuses=backend.mirrorCheckStatuses(gate);
  assertEquals(0,statuses.size());
}
Program: 31023
Project: 31023
Buggy source:
private void diskPledgesChanged(SetChangeListener.Change<? extends LHProtos.Pledge> change,Project project){
  executor.checkOnThread();
  if (change.wasRemoved()) {
    LHProtos.Pledge walletPledge=wallet.getPledgeFor(project);
    LHProtos.Pledge removedPledge=change.getElementRemoved();
    if (walletPledge != null && walletPledge.equals(removedPledge)) {
      log.info("String_Node_Str");
    }
 else {
      openPledges.get(project).remove(removedPledge);
      getClaimedPledgesFor(project).remove(removedPledge);
    }
  }
  if (change.wasAdded()) {
    final LHProtos.Pledge added=change.getElementAdded();
    if (!isPledgeKnown(added)) {
      log.info("String_Node_Str",project);
      jitteredExecute(() -> checkPledgeAgainstP2PNetwork(project,added),TX_PROPAGATION_TIME_SECS);
    }
  }
}

Fixed version (ground truth):
private void diskPledgesChanged(SetChangeListener.Change<? extends LHProtos.Pledge> change,Project project){
  executor.checkOnThread();
  if (change.wasRemoved()) {
    LHProtos.Pledge walletPledge=wallet.getPledgeFor(project);
    LHProtos.Pledge removedPledge=change.getElementRemoved();
    if (walletPledge != null && walletPledge.equals(removedPledge)) {
      log.info("String_Node_Str");
    }
 else {
      openPledges.get(project).remove(removedPledge);
      getClaimedPledgesFor(project).remove(removedPledge);
    }
  }
  if (change.wasAdded()) {
    final LHProtos.Pledge added=change.getElementAdded();
    if (isPledgeKnown(added)) {
      log.info("String_Node_Str",LHUtils.hashFromPledge(added));
    }
 else {
      log.info("String_Node_Str",project);
      jitteredExecute(() -> checkPledgeAgainstP2PNetwork(project,added),TX_PROPAGATION_TIME_SECS);
    }
  }
}
Program: 31024
Project: 31024
Buggy source:
private boolean isPledgeKnown(LHProtos.Pledge pledge){
  executor.checkOnThread();
  if (mode == Mode.CLIENT && wallet.wasPledgeRevoked(pledge))   return true;
  for (  ObservableSet<LHProtos.Pledge> set : openPledges.values())   if (set.contains(pledge))   return true;
  for (  ObservableSet<LHProtos.Pledge> set : claimedPledges.values())   if (set.contains(pledge))   return true;
  return false;
}

Fixed version (ground truth):
private boolean isPledgeKnown(LHProtos.Pledge pledge){
  executor.checkOnThread();
  if (mode == Mode.CLIENT) {
    if (wallet.getPledges().contains(pledge) || wallet.wasPledgeRevoked(pledge)) {
      return true;
    }
  }
  for (  ObservableSet<LHProtos.Pledge> set : openPledges.values())   if (set.contains(pledge))   return true;
  for (  ObservableSet<LHProtos.Pledge> set : claimedPledges.values())   if (set.contains(pledge))   return true;
  return false;
}
Program: 31025
Project: 31025
Buggy source:
private void loadAll() throws IOException {
  executor.checkOnThread();
  log.info("String_Node_Str");
  for (  Path path : LHUtils.listDir(AppDirectory.dir())) {
    if (!path.toString().endsWith(PROJECT_FILE_EXTENSION))     continue;
    if (!Files.isRegularFile(path) || (tryLoadProject(path) == null))     log.warn("String_Node_Str",path);
  }
  for (  Path path : pledgePaths) {
    if (!Files.isDirectory(path))     continue;
    loadPledgesFromDirectory(path);
  }
  loadProjectStatuses();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
private void loadAll() throws IOException {
  executor.checkOnThread();
  log.info("String_Node_Str");
  for (  Path path : LHUtils.listDir(AppDirectory.dir())) {
    if (!path.toString().endsWith(PROJECT_FILE_EXTENSION))     continue;
    if (!Files.isRegularFile(path) || (tryLoadProject(path) == null))     log.warn("String_Node_Str",path);
  }
  loadPledgesFromDirectory(AppDirectory.dir());
  for (  Path path : pledgePaths) {
    if (!Files.isDirectory(path))     continue;
    loadPledgesFromDirectory(path);
  }
  loadProjectStatuses();
  log.info("String_Node_Str");
}
Program: 31028
Project: 31028
Buggy source:
@FXML public void sendMoneyOut(ActionEvent event){
  Main.instance.overlayUI("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@FXML public void sendMoneyOut(ActionEvent event){
  SendMoneyController.open();
}