nus-yam/ex-repair huggingface dataset:
Program: 85753
Project: 85753
Buggy source:
private void handleKey(SelectionKey key) throws IOException {
  if (key.isValid() && key.isConnectable()) {
    StreamParser parser=(StreamParser)key.attachment();
    SocketChannel sc=(SocketChannel)key.channel();
    ConnectionHandler handler=new ConnectionHandler(parser,key,connectedHandlers);
    try {
      if (sc.finishConnect()) {
        log.info("String_Node_Str",sc.socket().getRemoteSocketAddress());
        handler.parser.connectionOpened();
        key.interestOps(SelectionKey.OP_READ).attach(handler);
      }
 else {
        log.error("String_Node_Str",sc.socket().getRemoteSocketAddress());
        handler.closeConnection();
      }
    }
 catch (    IOException e) {
      log.error("String_Node_Str",e.getMessage());
      handler.closeConnection();
    }
catch (    CancelledKeyException e) {
      log.error("String_Node_Str",e.getMessage());
      handler.closeConnection();
    }
  }
 else   ConnectionHandler.handleKey(key);
}

Fixed version (ground truth):
private void handleKey(SelectionKey key) throws IOException {
  if (key.isValid() && key.isConnectable()) {
    StreamParser parser=(StreamParser)key.attachment();
    SocketChannel sc=(SocketChannel)key.channel();
    ConnectionHandler handler=new ConnectionHandler(parser,key,connectedHandlers);
    try {
      if (sc.finishConnect()) {
        log.info("String_Node_Str",sc.socket().getRemoteSocketAddress());
        key.interestOps(SelectionKey.OP_READ).attach(handler);
        handler.parser.connectionOpened();
      }
 else {
        log.error("String_Node_Str",sc.socket().getRemoteSocketAddress());
        handler.closeConnection();
      }
    }
 catch (    IOException e) {
      log.error("String_Node_Str",e.getMessage());
      handler.closeConnection();
    }
catch (    CancelledKeyException e) {
      log.error("String_Node_Str",e.getMessage());
      handler.closeConnection();
    }
  }
 else   ConnectionHandler.handleKey(key);
}
Program: 85754
Project: 85754
Buggy source:
public TestNet3Params(){
  super();
  id=ID_TESTNET;
  packetMagic=0x0b110907;
  interval=INTERVAL;
  targetTimespan=TARGET_TIMESPAN;
  proofOfWorkLimit=Utils.decodeCompactBits(0x1d00ffffL);
  port=CoinDefinition.TestPort;
  addressHeader=CoinDefinition.testnetAddressHeader;
  acceptableAddressCodes=new int[]{CoinDefinition.testnetAddressHeader};
  dumpedPrivateKeyHeader=128 + CoinDefinition.testnetAddressHeader;
  genesisBlock.setTime(1296688602L);
  genesisBlock.setDifficultyTarget(0x1d00ffffL);
  genesisBlock.setNonce(414098458);
  spendableCoinbaseDepth=CoinDefinition.spendableCoinbaseDepth;
  subsidyDecreaseBlockCount=CoinDefinition.subsidyDecreaseBlockCount;
  String genesisHash=genesisBlock.getHashAsString();
  checkState(genesisHash.equals(CoinDefinition.testnetGenesisHash));
  alertSigningKey=Hex.decode("String_Node_Str");
  dnsSeeds=CoinDefinition.testnetDnsSeeds;
}

Fixed version (ground truth):
public TestNet3Params(){
  super();
  id=ID_TESTNET;
  packetMagic=0x0b110907;
  interval=INTERVAL;
  targetTimespan=TARGET_TIMESPAN;
  proofOfWorkLimit=Utils.decodeCompactBits(0x1d00ffffL);
  port=CoinDefinition.TestPort;
  addressHeader=CoinDefinition.testnetAddressHeader;
  acceptableAddressCodes=new int[]{CoinDefinition.testnetAddressHeader};
  dumpedPrivateKeyHeader=128 + CoinDefinition.testnetAddressHeader;
  genesisBlock.setTime(1296688602L);
  genesisBlock.setDifficultyTarget(0x1d00ffffL);
  genesisBlock.setNonce(414098458);
  spendableCoinbaseDepth=CoinDefinition.spendableCoinbaseDepth;
  subsidyDecreaseBlockCount=CoinDefinition.subsidyDecreaseBlockCount;
  String genesisHash=genesisBlock.getHashAsString();
  alertSigningKey=Hex.decode("String_Node_Str");
  dnsSeeds=CoinDefinition.testnetDnsSeeds;
}
Program: 85755
Project: 85755
Buggy source:
private static void executeCheckSig(Transaction txContainingThis,int index,Script script,LinkedList<byte[]> stack,int lastCodeSepLocation,int opcode) throws ScriptException {
  if (stack.size() < 2)   throw new ScriptException("String_Node_Str");
  byte[] pubKey=stack.pollLast();
  byte[] sigBytes=stack.pollLast();
  if (sigBytes.length == 0 || pubKey.length == 0)   throw new ScriptException("String_Node_Str");
  byte[] prog=script.getProgram();
  byte[] connectedScript=Arrays.copyOfRange(prog,lastCodeSepLocation,prog.length);
  UnsafeByteArrayOutputStream outStream=new UnsafeByteArrayOutputStream(sigBytes.length + 1);
  try {
    writeBytes(outStream,sigBytes);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  connectedScript=removeAllInstancesOf(connectedScript,outStream.toByteArray());
  boolean sigValid=false;
  try {
    TransactionSignature sig=TransactionSignature.decodeFromBitcoin(sigBytes,false);
    Sha256Hash hash=txContainingThis.hashForSignature(index,connectedScript,(byte)sig.sighashFlags);
    sigValid=ECKey.verify(hash.getBytes(),sig,pubKey);
  }
 catch (  Exception e1) {
    log.warn(e1.toString());
  }
  if (opcode == OP_CHECKSIG)   stack.add(sigValid ? new byte[]{1} : new byte[]{0});
 else   if (opcode == OP_CHECKSIGVERIFY)   if (!sigValid)   throw new ScriptException("String_Node_Str");
}

Fixed version (ground truth):
private static void executeCheckSig(Transaction txContainingThis,int index,Script script,LinkedList<byte[]> stack,int lastCodeSepLocation,int opcode) throws ScriptException {
  if (stack.size() < 2)   throw new ScriptException("String_Node_Str");
  byte[] pubKey=stack.pollLast();
  byte[] sigBytes=stack.pollLast();
  if (sigBytes.length == 0 || pubKey.length == 0) {
    if (opcode == OP_CHECKSIG)     stack.add(new byte[]{0});
 else     if (opcode == OP_CHECKSIGVERIFY)     throw new ScriptException("String_Node_Str");
    return;
  }
  byte[] prog=script.getProgram();
  byte[] connectedScript=Arrays.copyOfRange(prog,lastCodeSepLocation,prog.length);
  UnsafeByteArrayOutputStream outStream=new UnsafeByteArrayOutputStream(sigBytes.length + 1);
  try {
    writeBytes(outStream,sigBytes);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  connectedScript=removeAllInstancesOf(connectedScript,outStream.toByteArray());
  boolean sigValid=false;
  try {
    TransactionSignature sig=TransactionSignature.decodeFromBitcoin(sigBytes,false);
    Sha256Hash hash=txContainingThis.hashForSignature(index,connectedScript,(byte)sig.sighashFlags);
    sigValid=ECKey.verify(hash.getBytes(),sig,pubKey);
  }
 catch (  Exception e1) {
    log.warn(e1.toString());
  }
  if (opcode == OP_CHECKSIG)   stack.add(sigValid ? new byte[]{1} : new byte[]{0});
 else   if (opcode == OP_CHECKSIGVERIFY)   if (!sigValid)   throw new ScriptException("String_Node_Str");
}
Program: 85756
Project: 85756
Buggy source:
private void watchCloseConfirmations(){
  storedChannel.close.getConfidence().getDepthFuture(CONFIRMATIONS_FOR_DELETE).addListener(new Runnable(){
    @Override public void run(){
      deleteChannelFromWallet();
    }
  }
,Threading.SAME_THREAD);
}

Fixed version (ground truth):
private void watchCloseConfirmations(){
  final TransactionConfidence confidence=storedChannel.close.getConfidence();
  ListenableFuture<Transaction> future=confidence.getDepthFuture(CONFIRMATIONS_FOR_DELETE,Threading.SAME_THREAD);
  Futures.addCallback(future,new FutureCallback<Transaction>(){
    @Override public void onSuccess(    Transaction result){
      deleteChannelFromWallet();
    }
    @Override public void onFailure(    Throwable t){
      Throwables.propagate(t);
    }
  }
);
}
Program: 85757
Project: 85757
Buggy source:
@After @Override public void tearDown() throws Exception {
  super.tearDown();
}

Fixed version (ground truth):
@After @Override public void tearDown() throws Exception {
  super.tearDown();
  ECKey.FAKE_SIGNATURES=false;
}
Program: 85759
Project: 85759
Buggy source:
@Before public void setUp() throws Exception {
  super.setUp();
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  wallet.addExtension(new StoredPaymentChannelClientStates(wallet,failBroadcaster));
  serverWallet=new Wallet(params);
  serverWallet.addExtension(new StoredPaymentChannelServerStates(serverWallet,failBroadcaster));
  serverWallet.addKey(new ECKey());
  serverChain=new BlockChain(params,serverWallet,blockStore);
  fail=new AtomicBoolean(false);
  broadcasts=new LinkedBlockingQueue<Transaction>();
  broadcastTxPause=new Semaphore(0);
  mockBroadcaster=new TransactionBroadcaster(){
    @Override public ListenableFuture<Transaction> broadcastTransaction(    Transaction tx){
      broadcastTxPause.acquireUninterruptibly();
      SettableFuture<Transaction> future=SettableFuture.create();
      future.set(tx);
      broadcasts.add(tx);
      return future;
    }
  }
;
  Threading.warnOnLockCycles();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  super.setUp();
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  wallet.addExtension(new StoredPaymentChannelClientStates(wallet,failBroadcaster));
  serverWallet=new Wallet(params);
  serverWallet.addExtension(new StoredPaymentChannelServerStates(serverWallet,failBroadcaster));
  serverWallet.addKey(new ECKey());
  serverChain=new BlockChain(params,serverWallet,blockStore);
  fail=new AtomicBoolean(false);
  broadcasts=new LinkedBlockingQueue<Transaction>();
  broadcastTxPause=new Semaphore(0);
  mockBroadcaster=new TransactionBroadcaster(){
    @Override public ListenableFuture<Transaction> broadcastTransaction(    Transaction tx){
      broadcastTxPause.acquireUninterruptibly();
      SettableFuture<Transaction> future=SettableFuture.create();
      future.set(tx);
      broadcasts.add(tx);
      return future;
    }
  }
;
  Threading.warnOnLockCycles();
  ECKey.FAKE_SIGNATURES=true;
}
Program: 85760
Project: 85760
Buggy source:
/** 
 * Returns the script bytes of inputScript with all instances of the specified script object removed
 */
public static byte[] removeAllInstancesOf(byte[] inputScript,byte[] chunkToRemove){
  UnsafeByteArrayOutputStream bos=new UnsafeByteArrayOutputStream(inputScript.length);
  int cursor=0;
  while (cursor < inputScript.length) {
    boolean skip=equalsRange(inputScript,cursor,chunkToRemove);
    int opcode=inputScript[cursor++] & 0xFF;
    int additionalBytes=0;
    if (opcode >= 0 && opcode < OP_PUSHDATA1) {
      additionalBytes=opcode;
    }
 else     if (opcode == OP_PUSHDATA1) {
      additionalBytes=inputScript[cursor] + 1;
    }
 else     if (opcode == OP_PUSHDATA2) {
      additionalBytes=((0xFF & inputScript[cursor]) | ((0xFF & inputScript[cursor + 1]) << 8)) + 2;
    }
 else     if (opcode == OP_PUSHDATA4) {
      additionalBytes=((0xFF & inputScript[cursor]) | ((0xFF & inputScript[cursor + 1]) << 8) | ((0xFF & inputScript[cursor + 1]) << 16)| ((0xFF & inputScript[cursor + 1]) << 24)) + 4;
    }
    if (!skip) {
      try {
        bos.write(opcode);
        bos.write(Arrays.copyOfRange(inputScript,cursor,cursor + additionalBytes));
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
    cursor+=additionalBytes;
  }
  return bos.toByteArray();
}

Fixed version (ground truth):
/** 
 * Returns the script bytes of inputScript with all instances of the specified script object removed
 */
public static byte[] removeAllInstancesOf(byte[] inputScript,byte[] chunkToRemove){
  UnsafeByteArrayOutputStream bos=new UnsafeByteArrayOutputStream(inputScript.length);
  int cursor=0;
  while (cursor < inputScript.length) {
    boolean skip=equalsRange(inputScript,cursor,chunkToRemove);
    int opcode=inputScript[cursor++] & 0xFF;
    int additionalBytes=0;
    if (opcode >= 0 && opcode < OP_PUSHDATA1) {
      additionalBytes=opcode;
    }
 else     if (opcode == OP_PUSHDATA1) {
      additionalBytes=(0xFF & inputScript[cursor]) + 1;
    }
 else     if (opcode == OP_PUSHDATA2) {
      additionalBytes=((0xFF & inputScript[cursor]) | ((0xFF & inputScript[cursor + 1]) << 8)) + 2;
    }
 else     if (opcode == OP_PUSHDATA4) {
      additionalBytes=((0xFF & inputScript[cursor]) | ((0xFF & inputScript[cursor + 1]) << 8) | ((0xFF & inputScript[cursor + 1]) << 16)| ((0xFF & inputScript[cursor + 1]) << 24)) + 4;
    }
    if (!skip) {
      try {
        bos.write(opcode);
        bos.write(Arrays.copyOfRange(inputScript,cursor,cursor + additionalBytes));
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
    cursor+=additionalBytes;
  }
  return bos.toByteArray();
}
Program: 85762
Project: 85762
Buggy source:
/** 
 * <p>Called by the   {@link BlockChain} when a new block on the best chain is seen, AFTER relevant wallettransactions are extracted and sent to us UNLESS the new block caused a re-org, in which case this will not be called (the  {@link Wallet#reorganize(StoredBlock,java.util.List,java.util.List)} method willcall this one in that case).</p> <p/> <p>Used to update confidence data in each transaction and last seen block hash. Triggers auto saving. Invokes the onWalletChanged event listener if there were any affected transactions.</p>
 */
public void notifyNewBestBlock(StoredBlock block) throws VerificationException {
  Sha256Hash newBlockHash=block.getHeader().getHash();
  if (newBlockHash.equals(getLastBlockSeenHash()))   return;
  lock.lock();
  try {
    setLastBlockSeenHash(newBlockHash);
    setLastBlockSeenHeight(block.getHeight());
    Set<Transaction> transactions=getTransactions(true);
    for (    Transaction tx : transactions) {
      if (ignoreNextNewBlock.contains(tx.getHash())) {
        ignoreNextNewBlock.remove(tx.getHash());
      }
 else {
        tx.getConfidence().notifyWorkDone(block.getHeader());
        confidenceChanged.put(tx,TransactionConfidence.Listener.ChangeReason.DEPTH);
      }
    }
    informConfidenceListenersIfNotReorganizing();
    maybeQueueOnWalletChanged();
    saveLater();
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * <p>Called by the   {@link BlockChain} when a new block on the best chain is seen, AFTER relevant wallettransactions are extracted and sent to us UNLESS the new block caused a re-org, in which case this will not be called (the  {@link Wallet#reorganize(StoredBlock,java.util.List,java.util.List)} method willcall this one in that case).</p> <p/> <p>Used to update confidence data in each transaction and last seen block hash. Triggers auto saving. Invokes the onWalletChanged event listener if there were any affected transactions.</p>
 */
public void notifyNewBestBlock(StoredBlock block) throws VerificationException {
  Sha256Hash newBlockHash=block.getHeader().getHash();
  if (newBlockHash.equals(getLastBlockSeenHash()))   return;
  lock.lock();
  try {
    setLastBlockSeenHash(newBlockHash);
    setLastBlockSeenHeight(block.getHeight());
    Set<Transaction> transactions=getTransactions(true);
    for (    Transaction tx : transactions) {
      if (ignoreNextNewBlock.contains(tx.getHash())) {
        ignoreNextNewBlock.remove(tx.getHash());
      }
 else       if (tx.getConfidence().getConfidenceType() == ConfidenceType.BUILDING) {
        tx.getConfidence().notifyWorkDone(block.getHeader());
        confidenceChanged.put(tx,TransactionConfidence.Listener.ChangeReason.DEPTH);
      }
    }
    informConfidenceListenersIfNotReorganizing();
    maybeQueueOnWalletChanged();
    saveLater();
  }
  finally {
    lock.unlock();
  }
}
Program: 85764
Project: 85764
Buggy source:
public void onConfidenceChanged(Transaction tx,TransactionConfidence.Listener.ChangeReason reason){
  flags[1]=true;
}

Fixed version (ground truth):
public void onConfidenceChanged(Transaction tx,TransactionConfidence.Listener.ChangeReason reason){
  flags[1]=true;
  reasons[0]=reason;
}
Program: 85766
Project: 85766
Buggy source:
/** 
 * <p>Link the given wallet to this PeerGroup. This is used for three purposes:</p> <ol> <li>So the wallet receives broadcast transactions.</li> <li>Announcing pending transactions that didn't get into the chain yet to our peers.</li> <li>Set the fast catchup time using   {@link PeerGroup#setFastCatchupTimeSecs(long)}, to optimize chain download.</li> </ol> <p>Note that this should be done before chain download commences because if you add a wallet with keys earlier than the current chain head, the relevant parts of the chain won't be redownloaded for you.</p> <p>The Wallet will have an event listener registered on it, so to avoid leaks remember to use  {@link PeerGroup#removeWallet(Wallet)} on it if you wish to keep the Wallet but lose the PeerGroup.</p>
 */
public void addWallet(Wallet wallet){
  lock.lock();
  try {
    checkNotNull(wallet);
    checkState(!wallets.contains(wallet));
    wallets.add(wallet);
    wallet.setTransactionBroadcaster(this);
    announcePendingWalletTransactions(Collections.singletonList(wallet),peers);
    wallet.addEventListener(walletEventListener);
    addPeerFilterProvider(wallet);
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * <p>Link the given wallet to this PeerGroup. This is used for three purposes:</p> <ol> <li>So the wallet receives broadcast transactions.</li> <li>Announcing pending transactions that didn't get into the chain yet to our peers.</li> <li>Set the fast catchup time using   {@link PeerGroup#setFastCatchupTimeSecs(long)}, to optimize chain download.</li> </ol> <p>Note that this should be done before chain download commences because if you add a wallet with keys earlier than the current chain head, the relevant parts of the chain won't be redownloaded for you.</p> <p>The Wallet will have an event listener registered on it, so to avoid leaks remember to use  {@link PeerGroup#removeWallet(Wallet)} on it if you wish to keep the Wallet but lose the PeerGroup.</p>
 */
public void addWallet(Wallet wallet){
  lock.lock();
  try {
    checkNotNull(wallet);
    checkState(!wallets.contains(wallet));
    wallets.add(wallet);
    wallet.setTransactionBroadcaster(this);
    wallet.addEventListener(walletEventListener);
    addPeerFilterProvider(wallet);
  }
  finally {
    lock.unlock();
  }
}
Program: 85767
Project: 85767
Buggy source:
protected void handleNewPeer(final Peer peer){
  int newSize=-1;
  lock.lock();
  try {
    log.info("String_Node_Str",peer);
    pendingPeers.remove(peer);
    peers.add(peer);
    newSize=peers.size();
    try {
      if (bloomFilter != null)       peer.setBloomFilter(bloomFilter);
    }
 catch (    IOException e) {
    }
    peer.setDownloadData(false);
    for (    Wallet wallet : wallets)     peer.addWallet(wallet);
    Peer newDownloadPeer=selectDownloadPeer(peers);
    if (downloadPeer != newDownloadPeer) {
      setDownloadPeer(newDownloadPeer);
      boolean shouldDownloadChain=downloadListener != null && chain != null;
      if (shouldDownloadChain) {
        startBlockChainDownloadFromPeer(downloadPeer);
      }
    }
    peer.addEventListener(getDataListener,Threading.SAME_THREAD);
    announcePendingWalletTransactions(wallets,Collections.singletonList(peer));
    for (    ListenerRegistration<PeerEventListener> registration : peerEventListeners) {
      peer.addEventListener(registration.listener,registration.executor);
    }
    setupPingingForNewPeer(peer);
  }
  finally {
    lock.unlock();
  }
  final int fNewSize=newSize;
  for (  final ListenerRegistration<PeerEventListener> registration : peerEventListeners) {
    registration.executor.execute(new Runnable(){
      @Override public void run(){
        registration.listener.onPeerConnected(peer,fNewSize);
      }
    }
);
  }
}

Fixed version (ground truth):
protected void handleNewPeer(final Peer peer){
  int newSize=-1;
  lock.lock();
  try {
    log.info("String_Node_Str",peer);
    pendingPeers.remove(peer);
    peers.add(peer);
    newSize=peers.size();
    try {
      if (bloomFilter != null)       peer.setBloomFilter(bloomFilter);
    }
 catch (    IOException e) {
    }
    peer.setDownloadData(false);
    for (    Wallet wallet : wallets)     peer.addWallet(wallet);
    Peer newDownloadPeer=selectDownloadPeer(peers);
    if (downloadPeer != newDownloadPeer) {
      setDownloadPeer(newDownloadPeer);
      boolean shouldDownloadChain=downloadListener != null && chain != null;
      if (shouldDownloadChain) {
        startBlockChainDownloadFromPeer(downloadPeer);
      }
    }
    peer.addEventListener(getDataListener,Threading.SAME_THREAD);
    for (    ListenerRegistration<PeerEventListener> registration : peerEventListeners) {
      peer.addEventListener(registration.listener,registration.executor);
    }
    setupPingingForNewPeer(peer);
  }
  finally {
    lock.unlock();
  }
  final int fNewSize=newSize;
  for (  final ListenerRegistration<PeerEventListener> registration : peerEventListeners) {
    registration.executor.execute(new Runnable(){
      @Override public void run(){
        registration.listener.onPeerConnected(peer,fNewSize);
      }
    }
);
  }
}
Program: 85768
Project: 85768
Buggy source:
/** 
 * Unlinks the given wallet so it no longer receives broadcast transactions or has its transactions announced.
 */
public void removeWallet(Wallet wallet){
  wallets.remove(checkNotNull(wallet));
  peerFilterProviders.remove(wallet);
  wallet.removeEventListener(walletEventListener);
}

Fixed version (ground truth):
/** 
 * Unlinks the given wallet so it no longer receives broadcast transactions or has its transactions announced.
 */
public void removeWallet(Wallet wallet){
  wallets.remove(checkNotNull(wallet));
  peerFilterProviders.remove(wallet);
  wallet.removeEventListener(walletEventListener);
  wallet.setTransactionBroadcaster(null);
}
Program: 85769
Project: 85769
Buggy source:
/** 
 * <p>Specifies that the given   {@link TransactionBroadcaster}, typically a   {@link PeerGroup}, should be used for sending transactions to the Bitcoin network by default. Some sendCoins methods let you specify a broadcaster explicitly, in that case, they don't use this broadcaster. If null is specified then the wallet won't attempt to broadcast transactions itself.</p> <p>You don't normally need to call this. A   {@link PeerGroup} will automatically set itself as the walletsbroadcaster when you use  {@link PeerGroup#addWallet(Wallet)}. A wallet can use the broadcaster when you ask it to send money, but in future also at other times to implement various features that may require asynchronous re-organisation of the wallet contents on the block chain. For instance, in future the wallet may choose to optimise itself to reduce fees or improve privacy.</p>
 */
public void setTransactionBroadcaster(@Nullable com.google.bitcoin.core.TransactionBroadcaster broadcaster){
  vTransactionBroadcaster=broadcaster;
}

Fixed version (ground truth):
/** 
 * <p>Specifies that the given   {@link TransactionBroadcaster}, typically a   {@link PeerGroup}, should be used for sending transactions to the Bitcoin network by default. Some sendCoins methods let you specify a broadcaster explicitly, in that case, they don't use this broadcaster. If null is specified then the wallet won't attempt to broadcast transactions itself.</p> <p>You don't normally need to call this. A   {@link PeerGroup} will automatically set itself as the walletsbroadcaster when you use  {@link PeerGroup#addWallet(Wallet)}. A wallet can use the broadcaster when you ask it to send money, but in future also at other times to implement various features that may require asynchronous re-organisation of the wallet contents on the block chain. For instance, in future the wallet may choose to optimise itself to reduce fees or improve privacy.</p>
 */
public void setTransactionBroadcaster(@Nullable com.google.bitcoin.core.TransactionBroadcaster broadcaster){
  lock.lock();
  try {
    if (vTransactionBroadcaster == broadcaster)     return;
    vTransactionBroadcaster=broadcaster;
    if (broadcaster == null)     return;
    for (    Transaction tx : pending.values()) {
      checkState(tx.getConfidence().getConfidenceType() == ConfidenceType.PENDING);
      if (tx.getConfidence().numBroadcastPeers() == 0) {
        log.info("String_Node_Str",tx.getHash());
        broadcaster.broadcastTransaction(tx);
      }
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 85773
Project: 85773
Buggy source:
public int getSerializedSize(){
  int size=memoizedSerializedSize;
  if (size != -1)   return size;
  size=0;
  if (((bitField0_ & 0x00000001) == 0x00000001)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(1,id_);
  }
  if (((bitField0_ & 0x00000002) == 0x00000002)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(2,contractTransaction_);
  }
  if (((bitField0_ & 0x00000004) == 0x00000004)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(3,refundTransaction_);
  }
  if (((bitField0_ & 0x00000008) == 0x00000008)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(4,myKey_);
  }
  if (((bitField0_ & 0x00000010) == 0x00000010)) {
    size+=com.google.protobuf.CodedOutputStream.computeUInt64Size(5,valueToMe_);
  }
  if (((bitField0_ & 0x00000020) == 0x00000020)) {
    size+=com.google.protobuf.CodedOutputStream.computeUInt64Size(6,refundFees_);
  }
  size+=getUnknownFields().getSerializedSize();
  memoizedSerializedSize=size;
  return size;
}

Fixed version (ground truth):
public int getSerializedSize(){
  int size=memoizedSerializedSize;
  if (size != -1)   return size;
  size=0;
  if (((bitField0_ & 0x00000001) == 0x00000001)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(1,id_);
  }
  if (((bitField0_ & 0x00000002) == 0x00000002)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(2,contractTransaction_);
  }
  if (((bitField0_ & 0x00000004) == 0x00000004)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(3,refundTransaction_);
  }
  if (((bitField0_ & 0x00000008) == 0x00000008)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(4,myKey_);
  }
  if (((bitField0_ & 0x00000010) == 0x00000010)) {
    size+=com.google.protobuf.CodedOutputStream.computeUInt64Size(5,valueToMe_);
  }
  if (((bitField0_ & 0x00000020) == 0x00000020)) {
    size+=com.google.protobuf.CodedOutputStream.computeUInt64Size(6,refundFees_);
  }
  if (((bitField0_ & 0x00000040) == 0x00000040)) {
    size+=com.google.protobuf.CodedOutputStream.computeBytesSize(7,closeTransactionHash_);
  }
  size+=getUnknownFields().getSerializedSize();
  memoizedSerializedSize=size;
  return size;
}
Program: 85774
Project: 85774
Buggy source:
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
  getSerializedSize();
  if (((bitField0_ & 0x00000001) == 0x00000001)) {
    output.writeBytes(1,id_);
  }
  if (((bitField0_ & 0x00000002) == 0x00000002)) {
    output.writeBytes(2,contractTransaction_);
  }
  if (((bitField0_ & 0x00000004) == 0x00000004)) {
    output.writeBytes(3,refundTransaction_);
  }
  if (((bitField0_ & 0x00000008) == 0x00000008)) {
    output.writeBytes(4,myKey_);
  }
  if (((bitField0_ & 0x00000010) == 0x00000010)) {
    output.writeUInt64(5,valueToMe_);
  }
  if (((bitField0_ & 0x00000020) == 0x00000020)) {
    output.writeUInt64(6,refundFees_);
  }
  getUnknownFields().writeTo(output);
}

Fixed version (ground truth):
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
  getSerializedSize();
  if (((bitField0_ & 0x00000001) == 0x00000001)) {
    output.writeBytes(1,id_);
  }
  if (((bitField0_ & 0x00000002) == 0x00000002)) {
    output.writeBytes(2,contractTransaction_);
  }
  if (((bitField0_ & 0x00000004) == 0x00000004)) {
    output.writeBytes(3,refundTransaction_);
  }
  if (((bitField0_ & 0x00000008) == 0x00000008)) {
    output.writeBytes(4,myKey_);
  }
  if (((bitField0_ & 0x00000010) == 0x00000010)) {
    output.writeUInt64(5,valueToMe_);
  }
  if (((bitField0_ & 0x00000020) == 0x00000020)) {
    output.writeUInt64(6,refundFees_);
  }
  if (((bitField0_ & 0x00000040) == 0x00000040)) {
    output.writeBytes(7,closeTransactionHash_);
  }
  getUnknownFields().writeTo(output);
}
Program: 85775
Project: 85775
Buggy source:
public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel buildPartial(){
  com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result=new com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel(this);
  int from_bitField0_=bitField0_;
  int to_bitField0_=0;
  if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
    to_bitField0_|=0x00000001;
  }
  result.id_=id_;
  if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
    to_bitField0_|=0x00000002;
  }
  result.contractTransaction_=contractTransaction_;
  if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
    to_bitField0_|=0x00000004;
  }
  result.refundTransaction_=refundTransaction_;
  if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
    to_bitField0_|=0x00000008;
  }
  result.myKey_=myKey_;
  if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
    to_bitField0_|=0x00000010;
  }
  result.valueToMe_=valueToMe_;
  if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
    to_bitField0_|=0x00000020;
  }
  result.refundFees_=refundFees_;
  result.bitField0_=to_bitField0_;
  onBuilt();
  return result;
}

Fixed version (ground truth):
public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel buildPartial(){
  com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result=new com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel(this);
  int from_bitField0_=bitField0_;
  int to_bitField0_=0;
  if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
    to_bitField0_|=0x00000001;
  }
  result.id_=id_;
  if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
    to_bitField0_|=0x00000002;
  }
  result.contractTransaction_=contractTransaction_;
  if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
    to_bitField0_|=0x00000004;
  }
  result.refundTransaction_=refundTransaction_;
  if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
    to_bitField0_|=0x00000008;
  }
  result.myKey_=myKey_;
  if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
    to_bitField0_|=0x00000010;
  }
  result.valueToMe_=valueToMe_;
  if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
    to_bitField0_|=0x00000020;
  }
  result.refundFees_=refundFees_;
  if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
    to_bitField0_|=0x00000040;
  }
  result.closeTransactionHash_=closeTransactionHash_;
  result.bitField0_=to_bitField0_;
  onBuilt();
  return result;
}
Program: 85776
Project: 85776
Buggy source:
private StoredClientPaymentChannel(com.google.protobuf.CodedInputStream input,com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
  initFields();
  int mutable_bitField0_=0;
  com.google.protobuf.UnknownFieldSet.Builder unknownFields=com.google.protobuf.UnknownFieldSet.newBuilder();
  try {
    boolean done=false;
    while (!done) {
      int tag=input.readTag();
switch (tag) {
case 0:
        done=true;
      break;
default :
{
      if (!parseUnknownField(input,unknownFields,extensionRegistry,tag)) {
        done=true;
      }
      break;
    }
case 10:
{
    bitField0_|=0x00000001;
    id_=input.readBytes();
    break;
  }
case 18:
{
  bitField0_|=0x00000002;
  contractTransaction_=input.readBytes();
  break;
}
case 26:
{
bitField0_|=0x00000004;
refundTransaction_=input.readBytes();
break;
}
case 34:
{
bitField0_|=0x00000008;
myKey_=input.readBytes();
break;
}
case 40:
{
bitField0_|=0x00000010;
valueToMe_=input.readUInt64();
break;
}
case 48:
{
bitField0_|=0x00000020;
refundFees_=input.readUInt64();
break;
}
}
}
}
 catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
}
catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this);
}
 finally {
this.unknownFields=unknownFields.build();
makeExtensionsImmutable();
}
}

Fixed version (ground truth):
private StoredClientPaymentChannel(com.google.protobuf.CodedInputStream input,com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
  initFields();
  int mutable_bitField0_=0;
  com.google.protobuf.UnknownFieldSet.Builder unknownFields=com.google.protobuf.UnknownFieldSet.newBuilder();
  try {
    boolean done=false;
    while (!done) {
      int tag=input.readTag();
switch (tag) {
case 0:
        done=true;
      break;
default :
{
      if (!parseUnknownField(input,unknownFields,extensionRegistry,tag)) {
        done=true;
      }
      break;
    }
case 10:
{
    bitField0_|=0x00000001;
    id_=input.readBytes();
    break;
  }
case 18:
{
  bitField0_|=0x00000002;
  contractTransaction_=input.readBytes();
  break;
}
case 26:
{
bitField0_|=0x00000004;
refundTransaction_=input.readBytes();
break;
}
case 34:
{
bitField0_|=0x00000008;
myKey_=input.readBytes();
break;
}
case 40:
{
bitField0_|=0x00000010;
valueToMe_=input.readUInt64();
break;
}
case 48:
{
bitField0_|=0x00000020;
refundFees_=input.readUInt64();
break;
}
case 58:
{
bitField0_|=0x00000040;
closeTransactionHash_=input.readBytes();
break;
}
}
}
}
 catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
}
catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this);
}
 finally {
this.unknownFields=unknownFields.build();
makeExtensionsImmutable();
}
}
Program: 85777
Project: 85777
Buggy source:
public Builder clear(){
  super.clear();
  id_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000001);
  contractTransaction_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000002);
  refundTransaction_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000004);
  myKey_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000008);
  valueToMe_=0L;
  bitField0_=(bitField0_ & ~0x00000010);
  refundFees_=0L;
  bitField0_=(bitField0_ & ~0x00000020);
  return this;
}

Fixed version (ground truth):
public Builder clear(){
  super.clear();
  id_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000001);
  contractTransaction_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000002);
  refundTransaction_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000004);
  myKey_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000008);
  valueToMe_=0L;
  bitField0_=(bitField0_ & ~0x00000010);
  refundFees_=0L;
  bitField0_=(bitField0_ & ~0x00000020);
  closeTransactionHash_=com.google.protobuf.ByteString.EMPTY;
  bitField0_=(bitField0_ & ~0x00000040);
  return this;
}
Program: 85778
Project: 85778
Buggy source:
public com.google.protobuf.ExtensionRegistry assignDescriptors(com.google.protobuf.Descriptors.FileDescriptor root){
  descriptor=root;
  internal_static_paymentchannels_StoredClientPaymentChannels_descriptor=getDescriptor().getMessageTypes().get(0);
  internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable=new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_paymentchannels_StoredClientPaymentChannels_descriptor,new java.lang.String[]{"String_Node_Str"});
  internal_static_paymentchannels_StoredClientPaymentChannel_descriptor=getDescriptor().getMessageTypes().get(1);
  internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable=new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_paymentchannels_StoredClientPaymentChannel_descriptor,new java.lang.String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  return null;
}

Fixed version (ground truth):
public com.google.protobuf.ExtensionRegistry assignDescriptors(com.google.protobuf.Descriptors.FileDescriptor root){
  descriptor=root;
  internal_static_paymentchannels_StoredClientPaymentChannels_descriptor=getDescriptor().getMessageTypes().get(0);
  internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable=new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_paymentchannels_StoredClientPaymentChannels_descriptor,new java.lang.String[]{"String_Node_Str"});
  internal_static_paymentchannels_StoredClientPaymentChannel_descriptor=getDescriptor().getMessageTypes().get(1);
  internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable=new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_paymentchannels_StoredClientPaymentChannel_descriptor,new java.lang.String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  return null;
}
Program: 85779
Project: 85779
Buggy source:
private void initFields(){
  id_=com.google.protobuf.ByteString.EMPTY;
  contractTransaction_=com.google.protobuf.ByteString.EMPTY;
  refundTransaction_=com.google.protobuf.ByteString.EMPTY;
  myKey_=com.google.protobuf.ByteString.EMPTY;
  valueToMe_=0L;
  refundFees_=0L;
}

Fixed version (ground truth):
private void initFields(){
  id_=com.google.protobuf.ByteString.EMPTY;
  contractTransaction_=com.google.protobuf.ByteString.EMPTY;
  refundTransaction_=com.google.protobuf.ByteString.EMPTY;
  myKey_=com.google.protobuf.ByteString.EMPTY;
  valueToMe_=0L;
  refundFees_=0L;
  closeTransactionHash_=com.google.protobuf.ByteString.EMPTY;
}
Program: 85781
Project: 85781
Buggy source:
/** 
 * Sets this channel's state in   {@link StoredPaymentChannelClientStates} to unopened so this channel can be reopenedlater.
 * @see PaymentChannelClientState#storeChannelInWallet(Sha256Hash)
 */
public synchronized void disconnectFromChannel(){
  if (storedChannel == null)   return;
synchronized (storedChannel) {
    storedChannel.active=false;
  }
  storedChannel=null;
}

Fixed version (ground truth):
/** 
 * Sets this channel's state in   {@link StoredPaymentChannelClientStates} to unopened so this channel can be reopenedlater.
 * @see PaymentChannelClientState#storeChannelInWallet(Sha256Hash)
 */
public synchronized void disconnectFromChannel(){
  if (storedChannel == null)   return;
synchronized (storedChannel) {
    storedChannel.active=false;
  }
}
Program: 85784
Project: 85784
Buggy source:
/** 
 * Alias for TestNet2Params.get(), use that instead. 
 */
public static NetworkParameters testNet2(){
  return TestNet2Params.get();
}

Fixed version (ground truth):
/** 
 * Alias for TestNet2Params.get(), use that instead. 
 */
@Deprecated public static NetworkParameters testNet2(){
  return TestNet2Params.get();
}
Program: 85785
Project: 85785
Buggy source:
/** 
 * Alias for TestNet3Params.get(), use that instead. 
 */
public static NetworkParameters testNet3(){
  return TestNet3Params.get();
}

Fixed version (ground truth):
/** 
 * Alias for TestNet3Params.get(), use that instead. 
 */
@Deprecated public static NetworkParameters testNet3(){
  return TestNet3Params.get();
}
Program: 85786
Project: 85786
Buggy source:
/** 
 * Returns a testnet params modified to allow any difficulty target. 
 */
public static NetworkParameters unitTests(){
  return UnitTestParams.get();
}

Fixed version (ground truth):
/** 
 * Returns a testnet params modified to allow any difficulty target. 
 */
@Deprecated public static NetworkParameters unitTests(){
  return UnitTestParams.get();
}
Program: 85787
Project: 85787
Buggy source:
/** 
 * Alias for MainNetParams.get(), use that instead 
 */
public static NetworkParameters prodNet(){
  return MainNetParams.get();
}

Fixed version (ground truth):
/** 
 * Alias for MainNetParams.get(), use that instead 
 */
@Deprecated public static NetworkParameters prodNet(){
  return MainNetParams.get();
}
Program: 85788
Project: 85788
Buggy source:
/** 
 * Alias for TestNet3Params.get(), use that instead. 
 */
public static NetworkParameters testNet(){
  return TestNet3Params.get();
}

Fixed version (ground truth):
/** 
 * Alias for TestNet3Params.get(), use that instead. 
 */
@Deprecated public static NetworkParameters testNet(){
  return TestNet3Params.get();
}
Program: 85790
Project: 85790
Buggy source:
public MainNetParams(){
  super();
  interval=INTERVAL;
  targetTimespan=TARGET_TIMESPAN;
  proofOfWorkLimit=Utils.decodeCompactBits(0x1d00ffffL);
  acceptableAddressCodes=new int[]{0};
  dumpedPrivateKeyHeader=128;
  addressHeader=0;
  port=8333;
  packetMagic=0xf9beb4d9L;
  genesisBlock.setDifficultyTarget(0x1d00ffffL);
  genesisBlock.setTime(1231006505L);
  genesisBlock.setNonce(2083236893);
  id=ID_PRODNET;
  subsidyDecreaseBlockCount=210000;
  spendableCoinbaseDepth=100;
  String genesisHash=genesisBlock.getHashAsString();
  checkState(genesisHash.equals("String_Node_Str"),genesisHash);
  checkpoints.put(91722,new Sha256Hash("String_Node_Str"));
  checkpoints.put(91812,new Sha256Hash("String_Node_Str"));
  checkpoints.put(91842,new Sha256Hash("String_Node_Str"));
  checkpoints.put(91880,new Sha256Hash("String_Node_Str"));
  checkpoints.put(200000,new Sha256Hash("String_Node_Str"));
  dnsSeeds=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
}

Fixed version (ground truth):
public MainNetParams(){
  super();
  interval=INTERVAL;
  targetTimespan=TARGET_TIMESPAN;
  proofOfWorkLimit=Utils.decodeCompactBits(0x1d00ffffL);
  acceptableAddressCodes=new int[]{0};
  dumpedPrivateKeyHeader=128;
  addressHeader=0;
  port=8333;
  packetMagic=0xf9beb4d9L;
  genesisBlock.setDifficultyTarget(0x1d00ffffL);
  genesisBlock.setTime(1231006505L);
  genesisBlock.setNonce(2083236893);
  id=ID_MAINNET;
  subsidyDecreaseBlockCount=210000;
  spendableCoinbaseDepth=100;
  String genesisHash=genesisBlock.getHashAsString();
  checkState(genesisHash.equals("String_Node_Str"),genesisHash);
  checkpoints.put(91722,new Sha256Hash("String_Node_Str"));
  checkpoints.put(91812,new Sha256Hash("String_Node_Str"));
  checkpoints.put(91842,new Sha256Hash("String_Node_Str"));
  checkpoints.put(91880,new Sha256Hash("String_Node_Str"));
  checkpoints.put(200000,new Sha256Hash("String_Node_Str"));
  dnsSeeds=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
}
Program: 85791
Project: 85791
Buggy source:
@VisibleForTesting synchronized void doStoreChannelInWallet(Sha256Hash id){
  StoredPaymentChannelClientStates channels=(StoredPaymentChannelClientStates)wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID);
  checkState(channels.getChannel(id,multisigContract.getHash()) == null);
  storedChannel=new StoredClientChannel(id,multisigContract,refundTx,myKey,valueToMe,refundFees);
  channels.putChannel(storedChannel);
  wallet.addOrUpdateExtension(channels);
}

Fixed version (ground truth):
@VisibleForTesting synchronized void doStoreChannelInWallet(Sha256Hash id){
  StoredPaymentChannelClientStates channels=(StoredPaymentChannelClientStates)wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID);
  checkState(channels.getChannel(id,multisigContract.getHash()) == null);
  storedChannel=new StoredClientChannel(id,multisigContract,refundTx,myKey,valueToMe,refundFees,true);
  channels.putChannel(storedChannel);
  wallet.addOrUpdateExtension(channels);
}
Program: 85792
Project: 85792
Buggy source:
@Override public void deserializeWalletExtension(Wallet containingWallet,byte[] data) throws Exception {
  lock.lock();
  try {
    checkState(this.containingWallet == null || this.containingWallet == containingWallet);
    this.containingWallet=containingWallet;
    NetworkParameters params=containingWallet.getParams();
    ClientState.StoredClientPaymentChannels states=ClientState.StoredClientPaymentChannels.parseFrom(data);
    for (    ClientState.StoredClientPaymentChannel storedState : states.getChannelsList()) {
      Transaction refundTransaction=new Transaction(params,storedState.getRefundTransaction().toByteArray());
      refundTransaction.getConfidence().setSource(TransactionConfidence.Source.SELF);
      StoredClientChannel channel=new StoredClientChannel(new Sha256Hash(storedState.getId().toByteArray()),new Transaction(params,storedState.getContractTransaction().toByteArray()),refundTransaction,new ECKey(storedState.getMyKey().toByteArray(),null),BigInteger.valueOf(storedState.getValueToMe()),BigInteger.valueOf(storedState.getRefundFees()));
      putChannel(channel,false);
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override public void deserializeWalletExtension(Wallet containingWallet,byte[] data) throws Exception {
  lock.lock();
  try {
    checkState(this.containingWallet == null || this.containingWallet == containingWallet);
    this.containingWallet=containingWallet;
    NetworkParameters params=containingWallet.getParams();
    ClientState.StoredClientPaymentChannels states=ClientState.StoredClientPaymentChannels.parseFrom(data);
    for (    ClientState.StoredClientPaymentChannel storedState : states.getChannelsList()) {
      Transaction refundTransaction=new Transaction(params,storedState.getRefundTransaction().toByteArray());
      refundTransaction.getConfidence().setSource(TransactionConfidence.Source.SELF);
      StoredClientChannel channel=new StoredClientChannel(new Sha256Hash(storedState.getId().toByteArray()),new Transaction(params,storedState.getContractTransaction().toByteArray()),refundTransaction,new ECKey(new BigInteger(1,storedState.getMyKey().toByteArray()),null,true),BigInteger.valueOf(storedState.getValueToMe()),BigInteger.valueOf(storedState.getRefundFees()),false);
      putChannel(channel,false);
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 85793
Project: 85793
Buggy source:
StoredClientChannel(Sha256Hash id,Transaction contract,Transaction refund,ECKey myKey,BigInteger valueToMe,BigInteger refundFees){
  this.id=id;
  this.contract=contract;
  this.refund=refund;
  this.myKey=myKey;
  this.valueToMe=valueToMe;
  this.refundFees=refundFees;
  this.active=true;
}

Fixed version (ground truth):
StoredClientChannel(Sha256Hash id,Transaction contract,Transaction refund,ECKey myKey,BigInteger valueToMe,BigInteger refundFees,boolean active){
  this.id=id;
  this.contract=contract;
  this.refund=refund;
  this.myKey=myKey;
  this.valueToMe=valueToMe;
  this.refundFees=refundFees;
  this.active=active;
}
Program: 85795
Project: 85795
Buggy source:
@Before public void setUp() throws Exception {
  super.setUp();
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  wallet.addExtension(new StoredPaymentChannelClientStates(new TransactionBroadcaster(){
    @Override public ListenableFuture<Transaction> broadcastTransaction(    Transaction tx){
      fail();
      return null;
    }
  }
,wallet));
  chain=new BlockChain(params,wallet,blockStore);
  serverWallet=new Wallet(params);
  serverWallet.addKey(new ECKey());
  chain.addWallet(serverWallet);
  fail=new AtomicBoolean(false);
  broadcasts=new LinkedBlockingQueue<Transaction>();
  broadcastTxPause=new Semaphore(0);
  mockBroadcaster=new TransactionBroadcaster(){
    @Override public ListenableFuture<Transaction> broadcastTransaction(    Transaction tx){
      broadcastTxPause.acquireUninterruptibly();
      SettableFuture<Transaction> future=SettableFuture.create();
      future.set(tx);
      broadcasts.add(tx);
      return future;
    }
  }
;
  Threading.warnOnLockCycles();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  super.setUp();
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  sendMoneyToWallet(Utils.COIN,AbstractBlockChain.NewBlockType.BEST_CHAIN);
  wallet.addExtension(new StoredPaymentChannelClientStates(failBroadcaster,wallet));
  chain=new BlockChain(params,wallet,blockStore);
  serverWallet=new Wallet(params);
  serverWallet.addExtension(new StoredPaymentChannelServerStates(serverWallet,failBroadcaster));
  serverWallet.addKey(new ECKey());
  chain.addWallet(serverWallet);
  fail=new AtomicBoolean(false);
  broadcasts=new LinkedBlockingQueue<Transaction>();
  broadcastTxPause=new Semaphore(0);
  mockBroadcaster=new TransactionBroadcaster(){
    @Override public ListenableFuture<Transaction> broadcastTransaction(    Transaction tx){
      broadcastTxPause.acquireUninterruptibly();
      SettableFuture<Transaction> future=SettableFuture.create();
      future.set(tx);
      broadcasts.add(tx);
      return future;
    }
  }
;
  Threading.warnOnLockCycles();
}