nus-yam/ex-repair huggingface dataset:
Program: 112863
Project: 112863
Buggy source:
/** 
 * Use the card on the given target Summons either Huffer, Leokk, or Misha
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (minionIndex > 0 || playerIndex == 1) {
    return null;
  }
  int numMinions=boardState.data_.getNumMinions_p0();
  if (numMinions >= 7)   return null;
  double rnd=Math.random();
  Minion minion=null;
  if (rnd < 0.333333333333333333333333333) {
    minion=new Huffer();
  }
 else   if (rnd > 0.66666666666666666666666666666) {
    minion=new Leokk();
  }
 else {
    minion=new Misha();
  }
  boardState.data_.placeCard_hand_p0(minion);
  HearthTreeNode<BoardState> toRet=minion.useOn(boardState.data_.getNumCards_hand() - 1,playerIndex,numMinions + 1,boardState,deck);
  return super.use_core(thisCardIndex,playerIndex,minionIndex,toRet,deck);
}

Fixed version (ground truth):
/** 
 * Use the card on the given target Summons either Huffer, Leokk, or Misha
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (minionIndex > 0 || playerIndex == 1) {
    return null;
  }
  int numMinions=boardState.data_.getNumMinions_p0();
  if (numMinions >= 7)   return null;
  double rnd=Math.random();
  Minion minion=null;
  if (rnd < 0.333333333333333333333333333) {
    minion=new Huffer();
  }
 else   if (rnd > 0.66666666666666666666666666666) {
    minion=new Leokk();
  }
 else {
    minion=new Misha();
  }
  boardState.data_.setMana_p0(boardState.data_.getMana_p0() + 3);
  boardState.data_.placeCard_hand_p0(minion);
  HearthTreeNode<BoardState> toRet=minion.useOn(boardState.data_.getNumCards_hand() - 1,playerIndex,numMinions + 1,boardState,deck);
  return super.use_core(thisCardIndex,playerIndex,minionIndex,toRet,deck);
}
Program: 112864
Project: 112864
Buggy source:
@Test public void test1() throws HSInvalidPlayerIndexException {
  Card theCard=board.data_.getCard_hand_p0(0);
  HearthTreeNode<BoardState> ret=theCard.useOn(0,0,0,board,deck);
  assertFalse(ret == null);
  assertEquals(board.data_.getNumCards_hand(),0);
  assertEquals(board.data_.getNumMinions_p0(),3);
  assertEquals(board.data_.getNumMinions_p1(),2);
  assertEquals(board.data_.getHero_p0().getHealth(),30);
  assertEquals(board.data_.getHero_p1().getHealth(),30);
  assertEquals(board.data_.getMinion_p0(0).getHealth(),health0);
  assertEquals(board.data_.getMinion_p0(1).getHealth(),health1 - 1);
  assertEquals(board.data_.getMinion_p1(0).getHealth(),health0);
  assertEquals(board.data_.getMinion_p1(1).getHealth(),health1 - 1);
  if (board.data_.getMinion_p0(2) instanceof Leokk) {
    assertEquals(board.data_.getMinion_p0(0).getAttack(),attack0 + 1);
    assertEquals(board.data_.getMinion_p0(1).getAttack(),attack0 + 1);
  }
 else {
    assertEquals(board.data_.getMinion_p0(0).getAttack(),attack0);
    assertEquals(board.data_.getMinion_p0(1).getAttack(),attack0);
  }
  assertEquals(board.data_.getMinion_p1(0).getAttack(),attack0);
  assertEquals(board.data_.getMinion_p1(1).getAttack(),attack0);
}

Fixed version (ground truth):
@Test public void test1() throws HSInvalidPlayerIndexException {
  Card theCard=board.data_.getCard_hand_p0(0);
  HearthTreeNode<BoardState> ret=theCard.useOn(0,0,0,board,deck);
  assertFalse(ret == null);
  assertEquals(0,board.data_.getNumCards_hand());
  assertEquals(1,board.data_.getMana_p0());
  assertEquals(3,board.data_.getNumMinions_p0());
  assertEquals(2,board.data_.getNumMinions_p1());
  assertEquals(30,board.data_.getHero_p0().getHealth());
  assertEquals(30,board.data_.getHero_p1().getHealth());
  assertEquals(health0,board.data_.getMinion_p0(0).getHealth());
  assertEquals(health1 - 1,board.data_.getMinion_p0(1).getHealth());
  assertEquals(health0,board.data_.getMinion_p1(0).getHealth());
  assertEquals(health1 - 1,board.data_.getMinion_p1(1).getHealth());
  if (board.data_.getMinion_p0(2) instanceof Leokk) {
    assertEquals(board.data_.getMinion_p0(0).getAttack(),attack0 + 1);
    assertEquals(board.data_.getMinion_p0(1).getAttack(),attack0 + 1);
  }
 else {
    assertEquals(board.data_.getMinion_p0(0).getAttack(),attack0);
    assertEquals(board.data_.getMinion_p0(1).getAttack(),attack0);
  }
  assertEquals(board.data_.getMinion_p1(0).getAttack(),attack0);
  assertEquals(board.data_.getMinion_p1(1).getAttack(),attack0);
}
Program: 112865
Project: 112865
Buggy source:
/** 
 * Use the weapon card
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (this.hasBeenUsed()) {
    return null;
  }
  this.hasBeenUsed(true);
  if (playerIndex == 1 || minionIndex > 0) {
    return null;
  }
  HearthTreeNode<BoardState> toRet=boardState;
  if (toRet != null) {
    toRet.data_.getHero_p0().setAttack(this.weaponDamage_);
    toRet.data_.getHero_p0().setWeaponCharge(this.weaponCharge_);
  }
  return super.use_core(thisCardIndex,playerIndex,minionIndex,toRet,deck);
}

Fixed version (ground truth):
/** 
 * Use the weapon card
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (this.hasBeenUsed()) {
    return null;
  }
  if (playerIndex == 1 || minionIndex > 0) {
    return null;
  }
  HearthTreeNode<BoardState> toRet=boardState;
  if (toRet != null) {
    toRet.data_.getHero_p0().setAttack(this.weaponDamage_);
    toRet.data_.getHero_p0().setWeaponCharge(this.weaponCharge_);
    this.hasBeenUsed(true);
  }
  return super.use_core(thisCardIndex,playerIndex,minionIndex,toRet,deck);
}
Program: 112866
Project: 112866
Buggy source:
/** 
 * Use the card on the given target
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
public HearthTreeNode<BoardState> useOn(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  HearthTreeNode<BoardState> toRet=this.use_core(thisCardIndex,playerIndex,minionIndex,boardState,deck);
  if (toRet != null) {
    for (int j=0; j < toRet.data_.getNumCards_hand(); ++j) {
      toRet=toRet.data_.getCard_hand_p0(j).otherCardUsedEvent(j,toRet,deck);
    }
    toRet=toRet.data_.getHero_p0().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).otherCardUsedEvent(j,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).otherCardUsedEvent(j,toRet,deck);
    }
  }
  return toRet;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
public HearthTreeNode<BoardState> useOn(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  HearthTreeNode<BoardState> toRet=this.use_core(thisCardIndex,playerIndex,minionIndex,boardState,deck);
  if (toRet != null) {
    for (int j=0; j < toRet.data_.getNumCards_hand(); ++j) {
      toRet=toRet.data_.getCard_hand_p0(j).otherCardUsedEvent(j,toRet,deck);
    }
    toRet=toRet.data_.getHero_p0().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).otherCardUsedEvent(j,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).otherCardUsedEvent(j,toRet,deck);
    }
  }
  return toRet;
}
Program: 112867
Project: 112867
Buggy source:
/** 
 * Use the card on the given target This is the core implementation of card's ability
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  boardState.data_.setMana_p0(boardState.data_.getMana_p0() - this.mana_);
  boardState.data_.removeCard_hand(thisCardIndex);
  return boardState;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target This is the core implementation of card's ability
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  boardState.data_.setMana_p0(boardState.data_.getMana_p0() - this.mana_);
  boardState.data_.removeCard_hand(thisCardIndex);
  return boardState;
}
Program: 112868
Project: 112868
Buggy source:
public void takeHeal(byte healAmount,int thisMinionIndex,int thisPlayerIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  if (health_ < maxHealth_) {
    if (health_ + healAmount > maxHealth_)     health_=maxHealth_;
 else     health_=(byte)(health_ + healAmount);
    HearthTreeNode<BoardState> toRet=boardState;
    toRet=toRet.data_.getHero_p0().minionHealedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionHealedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionHealedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionHealedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
  }
}

Fixed version (ground truth):
public void takeHeal(byte healAmount,int thisPlayerIndex,int thisMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (health_ < maxHealth_) {
    if (health_ + healAmount > maxHealth_)     health_=maxHealth_;
 else     health_=(byte)(health_ + healAmount);
    HearthTreeNode<BoardState> toRet=boardState;
    toRet=toRet.data_.getHero_p0().minionHealedEvent(0,0,thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionHealedEvent(0,j + 1,thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionHealedEvent(0,0,thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionHealedEvent(0,j + 1,thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
  }
}
Program: 112869
Project: 112869
Buggy source:
/** 
 * Use the card on the given target
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  if (hasBeenUsed_) {
    return null;
  }
  if (playerIndex == 1 || minionIndex == 0)   return null;
  if (boardState.data_.getNumMinions_p0() < 7) {
    if (!charge_) {
      hasAttacked_=true;
    }
    hasBeenUsed_=true;
    boardState.data_.placeMinion_p0(this,minionIndex - 1);
    boardState.data_.setMana_p0(boardState.data_.getMana_p0() - this.mana_);
    boardState.data_.removeCard_hand(thisCardIndex);
    return boardState;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Use the card on the given target
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (hasBeenUsed_) {
    return null;
  }
  if (playerIndex == 1 || minionIndex == 0)   return null;
  if (boardState.data_.getNumMinions_p0() < 7) {
    if (!charge_) {
      hasAttacked_=true;
    }
    hasBeenUsed_=true;
    boardState.data_.placeMinion_p0(this,minionIndex - 1);
    boardState.data_.setMana_p0(boardState.data_.getMana_p0() - this.mana_);
    boardState.data_.removeCard_hand(thisCardIndex);
    return boardState;
  }
 else {
    return null;
  }
}
Program: 112870
Project: 112870
Buggy source:
/** 
 * Attack with the minion
 * @param thisMinionIndex Attacking minion's index (note: attacking player index is assumed to be 0)
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
public final HearthTreeNode<BoardState> attack(int thisMinionIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  HearthTreeNode<BoardState> toRet=boardState;
  if (playerIndex == 0 && toRet != null) {
    toRet=toRet.data_.getHero_p0().minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    }
  }
  toRet=this.attack_core(thisMinionIndex,playerIndex,minionIndex,boardState,deck);
  return toRet;
}

Fixed version (ground truth):
/** 
 * Attack with the minion
 * @param thisMinionIndex Attacking minion's index (note: attacking player index is assumed to be 0)
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
public final HearthTreeNode<BoardState> attack(int thisMinionIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  HearthTreeNode<BoardState> toRet=boardState;
  if (toRet != null) {
    toRet=toRet.data_.getHero_p0().minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionAttackingEvent(0,thisMinionIndex,playerIndex,minionIndex,toRet,deck);
    }
  }
  toRet=this.attack_core(thisMinionIndex,playerIndex,minionIndex,boardState,deck);
  return toRet;
}
Program: 112871
Project: 112871
Buggy source:
/** 
 * Use the card on the given target
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override public final HearthTreeNode<BoardState> useOn(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  HearthTreeNode<BoardState> toRet=super.useOn(thisCardIndex,playerIndex,minionIndex,boardState,deck);
  if (playerIndex == 0 && toRet != null) {
    toRet=toRet.data_.getHero_p0().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionCreatedEvent(playerIndex,minionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionCreatedEvent(playerIndex,minionIndex,toRet,deck);
    }
  }
  return toRet;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override public final HearthTreeNode<BoardState> useOn(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  HearthTreeNode<BoardState> toRet=super.useOn(thisCardIndex,playerIndex,minionIndex,boardState,deck);
  if (playerIndex == 0 && toRet != null) {
    toRet=toRet.data_.getHero_p0().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionCreatedEvent(playerIndex,minionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().otherCardUsedEvent(0,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionCreatedEvent(playerIndex,minionIndex,toRet,deck);
    }
  }
  return toRet;
}
Program: 112872
Project: 112872
Buggy source:
public void takeDamage(byte damage,int thisMinionIndex,int thisPlayerIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  if (!divineShield_) {
    health_=(byte)(health_ - damage);
    HearthTreeNode<BoardState> toRet=boardState;
    toRet=toRet.data_.getHero_p0().minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    if (health_ <= 0) {
      toRet=toRet.data_.getHero_p0().minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
        toRet=toRet.data_.getMinion_p0(j).minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      }
      toRet=toRet.data_.getHero_p1().minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
        toRet=toRet.data_.getMinion_p1(j).minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      }
    }
  }
 else {
    divineShield_=false;
  }
}

Fixed version (ground truth):
public void takeDamage(byte damage,int thisPlayerIndex,int thisMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (!divineShield_) {
    health_=(byte)(health_ - damage);
    HearthTreeNode<BoardState> toRet=boardState;
    toRet=toRet.data_.getHero_p0().minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionDamagedEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    if (health_ <= 0) {
      toRet=toRet.data_.getHero_p0().minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
        toRet=toRet.data_.getMinion_p0(j).minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      }
      toRet=toRet.data_.getHero_p1().minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
        toRet=toRet.data_.getMinion_p1(j).minionDeadEvent(thisPlayerIndex,thisMinionIndex,toRet,deck);
      }
    }
  }
 else {
    divineShield_=false;
  }
}
Program: 112874
Project: 112874
Buggy source:
/** 
 * Called whenever another character (including the hero) is healed
 * @param playerIndex The index of the healed minion's player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the healed minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
protected HearthTreeNode<BoardState> minionHealedEvent(int healedMinionPlayerIndex,int healedMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  return boardState;
}

Fixed version (ground truth):
/** 
 * Called whenever another character (including the hero) is healed
 * @param playerIndex The index of the healed minion's player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the healed minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
protected HearthTreeNode<BoardState> minionHealedEvent(int thisMinionPlayerIndex,int thisMinionIndex,int healedMinionPlayerIndex,int healedMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  return boardState;
}
Program: 112875
Project: 112875
Buggy source:
/** 
 * Use the card on the given target This is an abstract function, at least conceptually.
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override public HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  boardState.data_.setMana_p0(boardState.data_.getMana_p0() - this.mana_);
  boardState.data_.removeCard_hand(thisCardIndex);
  return boardState;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target This is an abstract function, at least conceptually.
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  boardState.data_.setMana_p0(boardState.data_.getMana_p0() - this.mana_);
  boardState.data_.removeCard_hand(thisCardIndex);
  return boardState;
}
Program: 112876
Project: 112876
Buggy source:
public void attack(Minion minion,int targetPlayerIndex,int targetMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  minion.takeDamage(damage_,targetPlayerIndex,targetMinionIndex,boardState,deck);
}

Fixed version (ground truth):
public void attack(Minion minion,int targetPlayerIndex,int targetMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  minion.takeDamage(damage_,targetPlayerIndex,targetMinionIndex,boardState,deck);
}
Program: 112878
Project: 112878
Buggy source:
/** 
 * Use the card on the given target This card heals the target minion up to full health and gives it taunt.  Cannot be used on heroes.
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override public HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  if (minionIndex == 0) {
    return null;
  }
  Minion targetMinion;
  if (playerIndex == 0) {
    targetMinion=boardState.data_.getMinion_p0(minionIndex - 1);
  }
 else {
    targetMinion=boardState.data_.getMinion_p1(minionIndex - 1);
  }
  targetMinion.setHealth(targetMinion.getMaxHealth());
  targetMinion.setTaunt(true);
  return super.useOn(thisCardIndex,playerIndex,minionIndex,boardState,deck);
}

Fixed version (ground truth):
/** 
 * Use the card on the given target This card heals the target minion up to full health and gives it taunt.  Cannot be used on heroes.
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (minionIndex == 0) {
    return null;
  }
  Minion targetMinion;
  if (playerIndex == 0) {
    targetMinion=boardState.data_.getMinion_p0(minionIndex - 1);
  }
 else {
    targetMinion=boardState.data_.getMinion_p1(minionIndex - 1);
  }
  targetMinion.setHealth(targetMinion.getMaxHealth());
  targetMinion.setTaunt(true);
  return super.use_core(thisCardIndex,playerIndex,minionIndex,boardState,deck);
}
Program: 112879
Project: 112879
Buggy source:
/** 
 * Use the card on the given target This card damages all enemy minions by 1
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override public HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  if (playerIndex == 0) {
    return null;
  }
  if (minionIndex > 0) {
    return null;
  }
  Iterator<Minion> iter=boardState.data_.getMinions_p1().iterator();
  while (iter.hasNext()) {
    Minion targetMinion=iter.next();
    targetMinion.setHealth((byte)(targetMinion.getHealth() - 1));
    if (targetMinion.getHealth() <= 0) {
      iter.remove();
    }
  }
  return super.useOn(thisCardIndex,playerIndex,minionIndex,boardState,deck);
}

Fixed version (ground truth):
/** 
 * Use the card on the given target This card damages all enemy minions by 1
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (playerIndex == 0) {
    return null;
  }
  if (minionIndex > 0) {
    return null;
  }
  Iterator<Minion> iter=boardState.data_.getMinions_p1().iterator();
  while (iter.hasNext()) {
    Minion targetMinion=iter.next();
    targetMinion.setHealth((byte)(targetMinion.getHealth() - 1));
    if (targetMinion.getHealth() <= 0) {
      iter.remove();
    }
  }
  return super.use_core(thisCardIndex,playerIndex,minionIndex,boardState,deck);
}
Program: 112880
Project: 112880
Buggy source:
/** 
 * Use the card on the given target This card draws 2 cards from the deck.
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override public HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck){
  if (playerIndex == 1 || minionIndex > 0) {
    return null;
  }
  for (int index=0; index < 2; ++index) {
    Card card=deck.drawCard(boardState.data_.getDeckPos_p0());
    if (card == null) {
      byte fatigueDamage=boardState.data_.getFatigueDamage_p0();
      boardState.data_.setFatigueDamage_p0((byte)(fatigueDamage + 1));
      boardState.data_.getHero_p0().setHealth((byte)(boardState.data_.getHero_p0().getHealth() - fatigueDamage));
    }
 else {
      boardState.data_.placeCard_hand_p0(card);
      boardState.data_.setDeckPos_p0(boardState.data_.getDeckPos_p0() + 1);
    }
  }
  return super.useOn(thisCardIndex,playerIndex,minionIndex,boardState,deck);
}

Fixed version (ground truth):
/** 
 * Use the card on the given target This card draws 2 cards from the deck.
 * @param thisCardIndex The index (position) of the card in the hand
 * @param playerIndex The index of the target player.  0 if targeting yourself or your own minions, 1 if targeting the enemy
 * @param minionIndex The index of the target minion.
 * @param boardState The BoardState before this card has performed its action.  It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
@Override protected HearthTreeNode<BoardState> use_core(int thisCardIndex,int playerIndex,int minionIndex,HearthTreeNode<BoardState> boardState,Deck deck) throws HSInvalidPlayerIndexException {
  if (playerIndex == 1 || minionIndex > 0) {
    return null;
  }
  for (int index=0; index < 2; ++index) {
    Card card=deck.drawCard(boardState.data_.getDeckPos_p0());
    if (card == null) {
      byte fatigueDamage=boardState.data_.getFatigueDamage_p0();
      boardState.data_.setFatigueDamage_p0((byte)(fatigueDamage + 1));
      boardState.data_.getHero_p0().setHealth((byte)(boardState.data_.getHero_p0().getHealth() - fatigueDamage));
    }
 else {
      boardState.data_.placeCard_hand_p0(card);
      boardState.data_.setDeckPos_p0(boardState.data_.getDeckPos_p0() + 1);
    }
  }
  return super.use_core(thisCardIndex,playerIndex,minionIndex,boardState,deck);
}
Program: 112882
Project: 112882
Buggy source:
/** 
 * Object2Parcelable
 * @param obj
 * @return
 */
public static Parcelable convertParcelable(Object obj){
  ProxyInfo pi=new ProxyInfo(obj.getClass().getCanonicalName());
  try {
    Class<?> clazz=Class.forName(pi.getFullName());
    Constructor<?> constructor=clazz.getConstructor(obj.getClass());
    return (Parcelable)constructor.newInstance(obj);
  }
 catch (  Exception e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Object2Parcelable
 * @param obj
 * @return
 */
public static Parcelable convertParcelable(Object obj){
  if (obj instanceof Parcelable) {
    return (Parcelable)obj;
  }
  ProxyInfo pi=new ProxyInfo(obj.getClass().getCanonicalName());
  try {
    Class<?> clazz=Class.forName(pi.getFullName());
    Constructor<?> constructor=clazz.getConstructor(obj.getClass());
    return (Parcelable)constructor.newInstance(obj);
  }
 catch (  Exception e) {
  }
  return null;
}
Program: 112883
Project: 112883
Buggy source:
private static void log(String log){
  Log.i("String_Node_Str",log);
}

Fixed version (ground truth):
private static void log(String log){
}
Program: 112884
Project: 112884
Buggy source:
@Override public void onClick(View v){
  Intent intent=new Intent(this,ShowUserActivity.class);
  User user=new User();
  user.setName("String_Node_Str");
  user.setAge(18);
  user.setBalance(100.85);
  user.setId(11111l);
  user.setList(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  user.setVip(true);
  HashMap<Integer,String> map=new HashMap<Integer,String>();
  map.put(1,"String_Node_Str");
  map.put(2,"String_Node_Str");
  user.setMap(map);
  user.setStrArray(new String[]{"String_Node_Str","String_Node_Str"});
  user.setIntArray(new int[]{1,2,3,4,5});
  intent.putExtra("String_Node_Str",PG.createParcelable(user));
  startActivity(intent);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  User user=new User();
  user.setName("String_Node_Str");
  user.setAge(18);
  user.setBalance(100.85);
  user.setId(11111l);
  user.setList(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  user.setVip(true);
  HashMap<Integer,String> map=new HashMap<Integer,String>();
  map.put(1,"String_Node_Str");
  map.put(2,"String_Node_Str");
  user.setMap(map);
  user.setStrArray(new String[]{"String_Node_Str","String_Node_Str"});
  user.setIntArray(new int[]{1,2,3,4,5});
  Intent intent=new Intent(this,ShowUserActivity.class);
  intent.putExtra("String_Node_Str",PG.createParcelable(user));
  startActivity(intent);
}
Program: 112885
Project: 112885
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  User user=getIntent().getParcelableExtra("String_Node_Str");
  TextView tv=(TextView)findViewById(R.id.textView);
  tv.setText(user.toString());
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  TextView tv=(TextView)findViewById(R.id.textView);
  User user=getIntent().getParcelableExtra("String_Node_Str");
  tv.setText(user.toString());
}
Program: 112886
Project: 112886
Buggy source:
@Override public GeoWaveMetadata apply(final Result result){
  return new GeoWaveMetadata(result.getRow(),columnQualifier,null,getMergedStats(result,clientsideStatsMerge));
}

Fixed version (ground truth):
@Override public GeoWaveMetadata apply(final Result result){
  byte[] resultantCQ;
  if (columnQualifier == null) {
    NavigableMap<byte[],byte[]> familyMap=result.getFamilyMap(columnFamily);
    if (familyMap != null && !familyMap.isEmpty()) {
      resultantCQ=familyMap.firstKey();
    }
 else {
      resultantCQ=new byte[0];
    }
  }
 else {
    resultantCQ=columnQualifier;
  }
  return new GeoWaveMetadata(result.getRow(),resultantCQ,null,getMergedStats(result,clientsideStatsMerge));
}
Program: 112888
Project: 112888
Buggy source:
private void initContext(){
  if (jsc == null) {
    String jar="String_Node_Str";
    try {
      jar=KMeansRunner.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    }
 catch (    final URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
    SparkConf addonOptions=new SparkConf();
    addonOptions=addonOptions.setAppName(appName).setMaster(master).set("String_Node_Str",host).set("String_Node_Str",jar);
    session=GeoWaveSparkConf.createDefaultSession(addonOptions);
    jsc=JavaSparkContext.fromSparkContext(session.sparkContext());
  }
}

Fixed version (ground truth):
private void initContext(){
  if (jsc == null) {
    String jar="String_Node_Str";
    try {
      jar=KMeansRunner.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    }
 catch (    final URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
    session=GeoWaveSparkConf.createSessionFromParams(appName,master,host,jar);
    jsc=JavaSparkContext.fromSparkContext(session.sparkContext());
  }
}
Program: 112889
Project: 112889
Buggy source:
private void initContext(){
  if (session == null) {
    String jar="String_Node_Str";
    try {
      jar=KMeansRunner.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    }
 catch (    final URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
    SparkConf addonOptions=new SparkConf();
    addonOptions=addonOptions.setAppName(appName).setMaster(master).set("String_Node_Str",host).set("String_Node_Str",jar);
    session=GeoWaveSparkConf.createDefaultSession(addonOptions);
  }
}

Fixed version (ground truth):
private void initContext(){
  if (session == null) {
    String jar="String_Node_Str";
    try {
      jar=SqlQueryRunner.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    }
 catch (    final URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
    session=GeoWaveSparkConf.createSessionFromParams(appName,master,host,jar);
  }
}
Program: 112890
Project: 112890
Buggy source:
private void initContext(){
  if (session == null) {
    String jar="String_Node_Str";
    try {
      jar=SpatialJoinRunner.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    }
 catch (    final URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
    SparkConf addonOptions=new SparkConf();
    addonOptions=addonOptions.setAppName(appName).setMaster(master).set("String_Node_Str",host).set("String_Node_Str",jar);
    if (partCount != -1) {
      addonOptions=addonOptions.set("String_Node_Str",partCount.toString());
    }
    session=GeoWaveSparkConf.createDefaultSession(addonOptions);
  }
  sc=session.sparkContext();
}

Fixed version (ground truth):
private void initContext(){
  if (session == null) {
    String jar="String_Node_Str";
    try {
      jar=SpatialJoinRunner.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    }
 catch (    final URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
    SparkConf addonOptions=new SparkConf();
    addonOptions=addonOptions.setAppName(appName).setMaster(master).set("String_Node_Str",jar);
    if (master != "String_Node_Str") {
      addonOptions=addonOptions.set("String_Node_Str",host);
    }
    if (partCount != -1) {
      addonOptions=addonOptions.set("String_Node_Str",partCount.toString());
    }
    session=GeoWaveSparkConf.createDefaultSession(addonOptions);
  }
  sc=session.sparkContext();
}
Program: 112893
Project: 112893
Buggy source:
private List<QueryRequest> addQueryRanges(final String tableName,final SinglePartitionQueryRanges r,final List<ByteArrayId> adapterIds,final AdapterStore adapterStore){
  List<QueryRequest> retVal=new ArrayList<>();
  final ByteArrayId partitionKey=r.getPartitionKey();
  final byte[] partitionId=((partitionKey == null) || (partitionKey.getBytes().length == 0)) ? DynamoDBWriter.EMPTY_PARTITION_KEY : partitionKey.getBytes();
  if ((adapterIds == null || adapterIds.isEmpty()) && (adapterStore != null)) {
    final CloseableIterator<DataAdapter<?>> adapters=adapterStore.getAdapters();
    final List<ByteArrayId> adapterIDList=new ArrayList<ByteArrayId>();
    adapters.forEachRemaining(new Consumer<DataAdapter<?>>(){
      @Override public void accept(      final DataAdapter<?> t){
        adapterIDList.add(t.getAdapterId());
      }
    }
);
    adapterIds.addAll(adapterIDList);
  }
  for (  final ByteArrayId adapterId : adapterIds) {
    final Collection<ByteArrayRange> sortKeyRanges=r.getSortKeyRanges();
    if (sortKeyRanges != null && !sortKeyRanges.isEmpty()) {
      sortKeyRanges.forEach((sortKeyRange -> retVal.add(getQuery(tableName,partitionId,sortKeyRange,adapterId))));
    }
 else {
      retVal.add(getQuery(tableName,partitionId,null,adapterId));
    }
  }
  return retVal;
}

Fixed version (ground truth):
private List<QueryRequest> addQueryRanges(final String tableName,final SinglePartitionQueryRanges r,List<ByteArrayId> adapterIds,final AdapterStore adapterStore){
  List<QueryRequest> retVal=new ArrayList<>();
  final ByteArrayId partitionKey=r.getPartitionKey();
  final byte[] partitionId=((partitionKey == null) || (partitionKey.getBytes().length == 0)) ? DynamoDBWriter.EMPTY_PARTITION_KEY : partitionKey.getBytes();
  if ((adapterIds == null || adapterIds.isEmpty()) && (adapterStore != null)) {
    final CloseableIterator<DataAdapter<?>> adapters=adapterStore.getAdapters();
    adapterIds=new ArrayList<>();
    final List<ByteArrayId> adapterIDList=new ArrayList<ByteArrayId>();
    adapters.forEachRemaining(new Consumer<DataAdapter<?>>(){
      @Override public void accept(      final DataAdapter<?> t){
        adapterIDList.add(t.getAdapterId());
      }
    }
);
    adapterIds.addAll(adapterIDList);
  }
  for (  final ByteArrayId adapterId : adapterIds) {
    final Collection<ByteArrayRange> sortKeyRanges=r.getSortKeyRanges();
    if (sortKeyRanges != null && !sortKeyRanges.isEmpty()) {
      sortKeyRanges.forEach((sortKeyRange -> retVal.add(getQuery(tableName,partitionId,sortKeyRange,adapterId))));
    }
 else {
      retVal.add(getQuery(tableName,partitionId,null,adapterId));
    }
  }
  return retVal;
}