Program: 85683
Project: 85683
Buggy source:
/** 
 * <p>Gets a bloom filter that contains all of the public keys from this wallet, and which will provide the given false-positive rate if it has size elements. Keep in mind that you will get 2 elements in the bloom filter for each key in the wallet, for the public key and the hash of the public key (address form).</p> <p>This is used to generate a BloomFilter which can be   {@link BloomFilter#merge(BloomFilter)}d with another. It could also be used if you have a specific target for the filter's size.</p> <p>See the docs for   {@link BloomFilter(int, double)} for a brief explanation of anonymity when using bloomfilters.</p>
 */
@Override public BloomFilter getBloomFilter(int size,double falsePositiveRate,long nTweak){
  BloomFilter filter;
  lock.lock();
  try {
    filter=keychain.getBloomFilter(size,falsePositiveRate,nTweak);
    for (    Script script : watchedScripts) {
      for (      ScriptChunk chunk : script.getChunks()) {
        if (!chunk.isOpCode() && chunk.data.length >= MINIMUM_BLOOM_DATA_LENGTH) {
          filter.insert(chunk.data);
        }
      }
    }
  }
  finally {
    lock.unlock();
  }
  for (  Transaction tx : getTransactions(false)) {
    for (int i=0; i < tx.getOutputs().size(); i++) {
      TransactionOutput out=tx.getOutputs().get(i);
      try {
        if (isTxOutputBloomFilterable(out)) {
          TransactionOutPoint outPoint=new TransactionOutPoint(params,i,tx);
          filter.insert(outPoint.bitcoinSerialize());
        }
      }
 catch (      ScriptException e) {
        throw new RuntimeException(e);
      }
    }
  }
  return filter;
}

Fixed version (ground truth):
/** 
 * <p>Gets a bloom filter that contains all of the public keys from this wallet, and which will provide the given false-positive rate if it has size elements. Keep in mind that you will get 2 elements in the bloom filter for each key in the wallet, for the public key and the hash of the public key (address form).</p> <p>This is used to generate a BloomFilter which can be   {@link BloomFilter#merge(BloomFilter)}d with another. It could also be used if you have a specific target for the filter's size.</p> <p>See the docs for   {@link BloomFilter(int, double)} for a brief explanation of anonymity when using bloomfilters.</p>
 */
@Override public BloomFilter getBloomFilter(int size,double falsePositiveRate,long nTweak){
  lock.lock();
  try {
    BloomFilter filter=keychain.getBloomFilter(size,falsePositiveRate,nTweak);
    for (    Script script : watchedScripts) {
      for (      ScriptChunk chunk : script.getChunks()) {
        if (!chunk.isOpCode() && chunk.data.length >= MINIMUM_BLOOM_DATA_LENGTH) {
          filter.insert(chunk.data);
        }
      }
    }
    for (    Transaction tx : getTransactions(false)) {
      for (int i=0; i < tx.getOutputs().size(); i++) {
        TransactionOutput out=tx.getOutputs().get(i);
        try {
          if (isTxOutputBloomFilterable(out)) {
            TransactionOutPoint outPoint=new TransactionOutPoint(params,i,tx);
            filter.insert(outPoint.bitcoinSerialize());
          }
        }
 catch (        ScriptException e) {
          throw new RuntimeException(e);
        }
      }
    }
    return filter;
  }
  finally {
    lock.unlock();
  }
}