Program: 10941
Project: 10941
Buggy source:
private void initHDAccount(DeterministicKey accountKey,boolean isFromXRandom,boolean isSyncedComplete,HDAccount.HDAccountGenerationDelegate generationDelegate){
  double progress=0;
  if (generationDelegate != null) {
    generationDelegate.onHDAccountGenerationProgress(progress);
  }
  DeterministicKey internalKey=getChainRootKey(accountKey,AbstractHD.PathType.INTERNAL_ROOT_PATH);
  DeterministicKey externalKey=getChainRootKey(accountKey,AbstractHD.PathType.EXTERNAL_ROOT_PATH);
  accountKey.wipe();
  progress+=GenerationPreStartProgress;
  if (generationDelegate != null) {
    generationDelegate.onHDAccountGenerationProgress(progress);
  }
  double itemProgress=(1.0 - GenerationPreStartProgress) / (LOOK_AHEAD_SIZE * 2);
  List<HDAccount.HDAccountAddress> externalAddresses=new ArrayList<HDAccount.HDAccountAddress>();
  List<HDAccount.HDAccountAddress> internalAddresses=new ArrayList<HDAccount.HDAccountAddress>();
  for (int i=0; i < LOOK_AHEAD_SIZE; i++) {
    byte[] subExternalPub=externalKey.deriveSoftened(i).getPubKey();
    HDAccount.HDAccountAddress externalAddress=new HDAccount.HDAccountAddress(subExternalPub,AbstractHD.PathType.EXTERNAL_ROOT_PATH,i,isSyncedComplete,hdSeedId);
    externalAddresses.add(externalAddress);
    progress+=itemProgress;
    if (generationDelegate != null) {
      generationDelegate.onHDAccountGenerationProgress(progress);
    }
    byte[] subInternalPub=internalKey.deriveSoftened(i).getPubKey();
    HDAccount.HDAccountAddress internalAddress=new HDAccount.HDAccountAddress(subInternalPub,AbstractHD.PathType.INTERNAL_ROOT_PATH,i,isSyncedComplete,hdSeedId);
    internalAddresses.add(internalAddress);
    progress+=itemProgress;
    if (generationDelegate != null) {
      generationDelegate.onHDAccountGenerationProgress(progress);
    }
  }
  AbstractDb.hdAccountProvider.addAddress(externalAddresses);
  AbstractDb.hdAccountProvider.addAddress(internalAddresses);
  hdSeedId=AbstractDb.addressProvider.addMonitoredHDAccount(isFromXRandom,internalKey.getPubKeyExtended(),externalKey.getPubKeyExtended());
  internalKey.wipe();
  externalKey.wipe();
}

Fixed version (ground truth):
private void initHDAccount(DeterministicKey accountKey,boolean isFromXRandom,boolean isSyncedComplete,HDAccount.HDAccountGenerationDelegate generationDelegate){
  double progress=0;
  if (generationDelegate != null) {
    generationDelegate.onHDAccountGenerationProgress(progress);
  }
  DeterministicKey internalKey=getChainRootKey(accountKey,AbstractHD.PathType.INTERNAL_ROOT_PATH);
  DeterministicKey externalKey=getChainRootKey(accountKey,AbstractHD.PathType.EXTERNAL_ROOT_PATH);
  DeterministicKey key=externalKey.deriveSoftened(0);
  String firstAddress=key.toAddress();
  accountKey.wipe();
  progress+=GenerationPreStartProgress;
  if (generationDelegate != null) {
    generationDelegate.onHDAccountGenerationProgress(progress);
  }
  double itemProgress=(1.0 - GenerationPreStartProgress) / (LOOK_AHEAD_SIZE * 2);
  List<HDAccount.HDAccountAddress> externalAddresses=new ArrayList<HDAccount.HDAccountAddress>();
  List<HDAccount.HDAccountAddress> internalAddresses=new ArrayList<HDAccount.HDAccountAddress>();
  for (int i=0; i < LOOK_AHEAD_SIZE; i++) {
    byte[] subExternalPub=externalKey.deriveSoftened(i).getPubKey();
    HDAccount.HDAccountAddress externalAddress=new HDAccount.HDAccountAddress(subExternalPub,AbstractHD.PathType.EXTERNAL_ROOT_PATH,i,isSyncedComplete,hdSeedId);
    externalAddresses.add(externalAddress);
    progress+=itemProgress;
    if (generationDelegate != null) {
      generationDelegate.onHDAccountGenerationProgress(progress);
    }
    byte[] subInternalPub=internalKey.deriveSoftened(i).getPubKey();
    HDAccount.HDAccountAddress internalAddress=new HDAccount.HDAccountAddress(subInternalPub,AbstractHD.PathType.INTERNAL_ROOT_PATH,i,isSyncedComplete,hdSeedId);
    internalAddresses.add(internalAddress);
    progress+=itemProgress;
    if (generationDelegate != null) {
      generationDelegate.onHDAccountGenerationProgress(progress);
    }
  }
  hdSeedId=AbstractDb.addressProvider.addMonitoredHDAccount(firstAddress,isFromXRandom,internalKey.getPubKeyExtended(),externalKey.getPubKeyExtended());
  for (  HDAccount.HDAccountAddress addr : externalAddresses) {
    addr.setHdAccountId(hdSeedId);
  }
  for (  HDAccount.HDAccountAddress addr : internalAddresses) {
    addr.setHdAccountId(hdSeedId);
  }
  AbstractDb.hdAccountProvider.addAddress(externalAddresses);
  AbstractDb.hdAccountProvider.addAddress(internalAddresses);
  internalKey.wipe();
  externalKey.wipe();
}