Program: 85728
Project: 85728
Buggy source:
@Override protected void startUp() throws Exception {
  if (!directory.exists()) {
    if (!directory.mkdir()) {
      throw new IOException("String_Node_Str");
    }
  }
  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;
    vStore=new SPVBlockStore(params,chainFile);
    if (!chainFileExists && checkpoints != null) {
      long time=Long.MAX_VALUE;
      if (vWalletFile.exists()) {
        FileInputStream stream=new FileInputStream(vWalletFile);
        final WalletProtobufSerializer serializer=new WalletProtobufSerializer();
        final Wallet wallet=serializer.readWallet(params,null,WalletProtobufSerializer.parseToProto(stream));
        time=wallet.getEarliestKeyCreationTime();
      }
      CheckpointManager.checkpoint(params,checkpoints,vStore,time);
    }
    vChain=new BlockChain(params,vStore);
    vPeerGroup=createPeerGroup();
    if (this.userAgent != null)     vPeerGroup.setUserAgent(userAgent,version);
    if (vWalletFile.exists()) {
      FileInputStream walletStream=new FileInputStream(vWalletFile);
      try {
        List<WalletExtension> extensions=provideWalletExtensions();
        vWallet=new Wallet(params);
        WalletExtension[] extArray=extensions.toArray(new WalletExtension[extensions.size()]);
        Protos.Wallet proto=WalletProtobufSerializer.parseToProto(walletStream);
        new WalletProtobufSerializer().readWallet(params,extArray,proto);
        if (shouldReplayWallet)         vWallet.clearTransactions(0);
      }
  finally {
        walletStream.close();
      }
    }
 else {
      vWallet=new Wallet(params);
      vWallet.freshReceiveKey();
      for (      WalletExtension e : provideWalletExtensions()) {
        vWallet.addExtension(e);
      }
      vWallet.saveToFile(vWalletFile);
    }
    if (useAutoSave)     vWallet.autosaveToFile(vWalletFile,200,TimeUnit.MILLISECONDS,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.startAsync();
      vPeerGroup.awaitRunning();
      installShutdownHook();
      final DownloadListener listener=new DownloadListener();
      vPeerGroup.startBlockChainDownload(listener);
      listener.await();
    }
 else {
      vPeerGroup.startAsync();
      vPeerGroup.addListener(new Service.Listener(){
        @Override public void running(){
          final PeerEventListener l=downloadListener == null ? new DownloadListener() : downloadListener;
          vPeerGroup.startBlockChainDownload(l);
        }
        @Override public void failed(        State from,        Throwable failure){
          throw new RuntimeException(failure);
        }
      }
,MoreExecutors.sameThreadExecutor());
    }
  }
 catch (  BlockStoreException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  if (!directory.exists()) {
    if (!directory.mkdir()) {
      throw new IOException("String_Node_Str");
    }
  }
  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;
    vStore=new SPVBlockStore(params,chainFile);
    if (!chainFileExists && checkpoints != null) {
      long time=Long.MAX_VALUE;
      if (vWalletFile.exists()) {
        FileInputStream stream=new FileInputStream(vWalletFile);
        final WalletProtobufSerializer serializer=new WalletProtobufSerializer();
        final Wallet wallet=serializer.readWallet(params,null,WalletProtobufSerializer.parseToProto(stream));
        time=wallet.getEarliestKeyCreationTime();
      }
      CheckpointManager.checkpoint(params,checkpoints,vStore,time);
    }
    vChain=new BlockChain(params,vStore);
    vPeerGroup=createPeerGroup();
    if (this.userAgent != null)     vPeerGroup.setUserAgent(userAgent,version);
    if (vWalletFile.exists()) {
      FileInputStream walletStream=new FileInputStream(vWalletFile);
      try {
        List<WalletExtension> extensions=provideWalletExtensions();
        vWallet=new Wallet(params);
        WalletExtension[] extArray=extensions.toArray(new WalletExtension[extensions.size()]);
        Protos.Wallet proto=WalletProtobufSerializer.parseToProto(walletStream);
        vWallet=new WalletProtobufSerializer().readWallet(params,extArray,proto);
        if (shouldReplayWallet)         vWallet.clearTransactions(0);
      }
  finally {
        walletStream.close();
      }
    }
 else {
      vWallet=new Wallet(params);
      vWallet.freshReceiveKey();
      for (      WalletExtension e : provideWalletExtensions()) {
        vWallet.addExtension(e);
      }
      vWallet.saveToFile(vWalletFile);
    }
    if (useAutoSave)     vWallet.autosaveToFile(vWalletFile,200,TimeUnit.MILLISECONDS,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.startAsync();
      vPeerGroup.awaitRunning();
      installShutdownHook();
      final DownloadListener listener=new DownloadListener();
      vPeerGroup.startBlockChainDownload(listener);
      listener.await();
    }
 else {
      vPeerGroup.startAsync();
      vPeerGroup.addListener(new Service.Listener(){
        @Override public void running(){
          final PeerEventListener l=downloadListener == null ? new DownloadListener() : downloadListener;
          vPeerGroup.startBlockChainDownload(l);
        }
        @Override public void failed(        State from,        Throwable failure){
          throw new RuntimeException(failure);
        }
      }
,MoreExecutors.sameThreadExecutor());
    }
  }
 catch (  BlockStoreException e) {
    throw new IOException(e);
  }
}