Program: 85782
Project: 85782
Buggy source:
@Override protected void startUp() throws Exception {
  if (!directory.exists()) {
    if (!directory.mkdir()) {
      throw new IOException("String_Node_Str");
    }
  }
  FileInputStream walletStream=null;
  try {
    File chainFile=new File(directory,filePrefix + "String_Node_Str");
    boolean chainFileExists=chainFile.exists();
    vWalletFile=new File(directory,filePrefix + "String_Node_Str");
    boolean shouldReplayWallet=vWalletFile.exists() && !chainFileExists;
    if (vWalletFile.exists()) {
      walletStream=new FileInputStream(vWalletFile);
      vWallet=new Wallet(params);
      addWalletExtensions();
      new WalletProtobufSerializer().readWallet(WalletProtobufSerializer.parseToProto(walletStream),vWallet);
      if (shouldReplayWallet)       vWallet.clearTransactions(0);
    }
 else {
      vWallet=new Wallet(params);
      vWallet.addKey(new ECKey());
      addWalletExtensions();
    }
    if (useAutoSave)     vWallet.autosaveToFile(vWalletFile,1,TimeUnit.SECONDS,null);
    vStore=new SPVBlockStore(params,chainFile);
    if (!chainFileExists && checkpoints != null) {
      CheckpointManager.checkpoint(params,checkpoints,vStore,vWallet.getEarliestKeyCreationTime());
    }
    vChain=new BlockChain(params,vStore);
    vPeerGroup=new PeerGroup(params,vChain);
    if (peerAddresses != null) {
      for (      PeerAddress addr : peerAddresses)       vPeerGroup.addAddress(addr);
      peerAddresses=null;
    }
 else {
      vPeerGroup.addPeerDiscovery(new DnsDiscovery(params));
    }
    vChain.addWallet(vWallet);
    vPeerGroup.addWallet(vWallet);
    onSetupCompleted();
    if (blockingStartup) {
      vPeerGroup.startAndWait();
      installShutdownHook();
      final DownloadListener listener=new DownloadListener();
      vPeerGroup.startBlockChainDownload(listener);
      listener.await();
    }
 else {
      Futures.addCallback(vPeerGroup.start(),new FutureCallback<State>(){
        @Override public void onSuccess(        State result){
          final PeerEventListener l=downloadListener == null ? new DownloadListener() : downloadListener;
          vPeerGroup.startBlockChainDownload(l);
        }
        @Override public void onFailure(        Throwable t){
          throw new RuntimeException(t);
        }
      }
);
    }
  }
 catch (  BlockStoreException e) {
    throw new IOException(e);
  }
 finally {
    if (walletStream != null)     walletStream.close();
  }
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  if (!directory.exists()) {
    if (!directory.mkdir()) {
      throw new IOException("String_Node_Str");
    }
  }
  FileInputStream walletStream=null;
  try {
    File chainFile=new File(directory,filePrefix + "String_Node_Str");
    boolean chainFileExists=chainFile.exists();
    vStore=new SPVBlockStore(params,chainFile);
    if (!chainFileExists && checkpoints != null) {
      CheckpointManager.checkpoint(params,checkpoints,vStore,vWallet.getEarliestKeyCreationTime());
    }
    vChain=new BlockChain(params,vStore);
    vPeerGroup=new PeerGroup(params,vChain);
    vWalletFile=new File(directory,filePrefix + "String_Node_Str");
    boolean shouldReplayWallet=vWalletFile.exists() && !chainFileExists;
    if (vWalletFile.exists()) {
      walletStream=new FileInputStream(vWalletFile);
      vWallet=new Wallet(params);
      addWalletExtensions();
      new WalletProtobufSerializer().readWallet(WalletProtobufSerializer.parseToProto(walletStream),vWallet);
      if (shouldReplayWallet)       vWallet.clearTransactions(0);
    }
 else {
      vWallet=new Wallet(params);
      vWallet.addKey(new ECKey());
      addWalletExtensions();
    }
    if (useAutoSave)     vWallet.autosaveToFile(vWalletFile,1,TimeUnit.SECONDS,null);
    if (peerAddresses != null) {
      for (      PeerAddress addr : peerAddresses)       vPeerGroup.addAddress(addr);
      peerAddresses=null;
    }
 else {
      vPeerGroup.addPeerDiscovery(new DnsDiscovery(params));
    }
    vChain.addWallet(vWallet);
    vPeerGroup.addWallet(vWallet);
    onSetupCompleted();
    if (blockingStartup) {
      vPeerGroup.startAndWait();
      installShutdownHook();
      final DownloadListener listener=new DownloadListener();
      vPeerGroup.startBlockChainDownload(listener);
      listener.await();
    }
 else {
      Futures.addCallback(vPeerGroup.start(),new FutureCallback<State>(){
        @Override public void onSuccess(        State result){
          final PeerEventListener l=downloadListener == null ? new DownloadListener() : downloadListener;
          vPeerGroup.startBlockChainDownload(l);
        }
        @Override public void onFailure(        Throwable t){
          throw new RuntimeException(t);
        }
      }
);
    }
  }
 catch (  BlockStoreException e) {
    throw new IOException(e);
  }
 finally {
    if (walletStream != null)     walletStream.close();
  }
}