nus-yam/ex-repair huggingface dataset:
Program: 112711
Project: 112711
Buggy source:
/** 
 * Draw a card whenever this minion takes damage
 */
@Override public HearthTreeNode minionDeadEvent(PlayerSide thisMinionPlayerSide,PlayerSide deadMinionPlayerSide,Minion deadMinion,HearthTreeNode boardState){
  if (this.isInHand()) {
    return boardState;
  }
  if (!MekgineerThermaplugg.filter.targetMatches(thisMinionPlayerSide,this,deadMinionPlayerSide,deadMinion,boardState.data_)) {
    return boardState;
  }
  if (!this.isAlive()) {
    return boardState;
  }
  EffectCharacter<Minion> effect=new EffectCharacterSummon<>(new LeperGnome());
  return effect.applyEffect(thisMinionPlayerSide,this,thisMinionPlayerSide,this,boardState);
}

Fixed version (ground truth):
/** 
 * Draw a card whenever this minion takes damage
 */
@Override public HearthTreeNode minionDeadEvent(PlayerSide thisMinionPlayerSide,PlayerSide deadMinionPlayerSide,Minion deadMinion,HearthTreeNode boardState){
  if (this.isInHand()) {
    return boardState;
  }
  if (!MekgineerThermaplugg.filter.targetMatches(thisMinionPlayerSide,this,deadMinionPlayerSide,deadMinion,boardState.data_)) {
    return boardState;
  }
  if (!this.isAlive() || boardState.data_.modelForSide(thisMinionPlayerSide).isBoardFull()) {
    return boardState;
  }
  EffectCharacter<Minion> effect=new EffectCharacterSummon<>(new LeperGnome());
  return effect.applyEffect(thisMinionPlayerSide,this,thisMinionPlayerSide,this,boardState);
}
Program: 112712
Project: 112712
Buggy source:
/** 
 * Draw a card whenever this minion takes damage
 */
@Override public HearthTreeNode minionDeadEvent(PlayerSide thisMinionPlayerSide,PlayerSide deadMinionPlayerSide,Minion deadMinion,HearthTreeNode boardState){
  if (this.setInHand()) {
    return boardState;
  }
  if (!MekgineerThermaplugg.filter.targetMatches(thisMinionPlayerSide,this,deadMinionPlayerSide,deadMinion,boardState.data_)) {
    return boardState;
  }
  if (!this.isAlive() || boardState.data_.modelForSide(thisMinionPlayerSide).isBoardFull()) {
    return boardState;
  }
  EffectCharacter<Minion> effect=new EffectCharacterSummon<>(new LeperGnome());
  return effect.applyEffect(thisMinionPlayerSide,this,thisMinionPlayerSide,this,boardState);
}

Fixed version (ground truth):
/** 
 * Draw a card whenever this minion takes damage
 */
@Override public HearthTreeNode minionDeadEvent(PlayerSide thisMinionPlayerSide,PlayerSide deadMinionPlayerSide,Minion deadMinion,HearthTreeNode boardState){
  if (this.setInHand()) {
    return boardState;
  }
  if (!MekgineerThermaplugg.filter.targetMatches(thisMinionPlayerSide,this,deadMinionPlayerSide,deadMinion,boardState.data_)) {
    return boardState;
  }
  if (!this.isAlive() || boardState.data_.modelForSide(thisMinionPlayerSide).isBoardFull()) {
    return boardState;
  }
  if (boardState.data_.modelForSide(thisMinionPlayerSide).getNumMinions() >= 7) {
    return boardState;
  }
  EffectCharacter<Minion> effect=new EffectCharacterSummon<>(new LeperGnome());
  return effect.applyEffect(thisMinionPlayerSide,this,thisMinionPlayerSide,this,boardState);
}
Program: 112713
Project: 112713
Buggy source:
@Test public void checkIncludeSpecifiedCardsLimitedCopies(){
  Random gen=new Random();
  ImplementedCard card1, card2;
  card1=referenceCards.get(gen.nextInt(referenceCards.size()));
  card2=referenceCards.get(gen.nextInt(referenceCards.size()));
  DeckFactoryBuilder builder=new DeckFactoryBuilder();
  builder.includeSpecificCards(card1,card2);
  Deck testDeck=builder.buildDeckFactory().generateRandomDeck();
  boolean test1Passed=false;
  boolean test2Passed=false;
  for (int i=0; i < 30; i++)   if (testDeck.drawCard(i).getName().equals(card1.name_))   test1Passed=true;
 else   if (testDeck.drawCard(i).getName().equals(card2.name_))   test2Passed=true;
  assertTrue(test1Passed);
  assertTrue(test2Passed);
}

Fixed version (ground truth):
@Test public void checkIncludeSpecifiedCardsLimitedCopies(){
  Random gen=new Random();
  ImplementedCard card1, card2;
  card1=referenceCards.get(gen.nextInt(referenceCards.size()));
  card2=referenceCards.get(gen.nextInt(referenceCards.size()));
  DeckFactoryBuilder builder=new DeckFactoryBuilder();
  builder.includeSpecificCards(card1,card2);
  Deck testDeck=builder.buildDeckFactory().generateRandomDeck();
  boolean test1Passed=false;
  boolean test2Passed=false;
  for (int i=0; i < 30; i++) {
    if (testDeck.drawCard(i).getName().equals(card1.name_))     test1Passed=true;
    if (testDeck.drawCard(i).getName().equals(card2.name_))     test2Passed=true;
  }
  assertTrue(card1.name_,test1Passed);
  assertTrue(card2.name_,test2Passed);
}
Program: 112714
Project: 112714
Buggy source:
@Test public void checkIncludeSpecifiedCardsUnlimitedCopies(){
  Random gen=new Random();
  ImplementedCard card1, card2;
  card1=referenceCards.get(gen.nextInt(referenceCards.size()));
  card2=referenceCards.get(gen.nextInt(referenceCards.size()));
  DeckFactoryBuilder builder=new DeckFactoryBuilder();
  builder.includeSpecificCards(card1,card2);
  builder.allowUnlimitedCopiesOfCards();
  Deck testDeck=builder.buildDeckFactory().generateRandomDeck();
  boolean test1Passed=false;
  boolean test2Passed=false;
  for (int i=0; i < 30; i++)   if (testDeck.drawCard(i).getName().equals(card1.name_))   test1Passed=true;
 else   if (testDeck.drawCard(i).getName().equals(card2.name_))   test2Passed=true;
  assertTrue(test1Passed);
  assertTrue(test2Passed);
}

Fixed version (ground truth):
@Test public void checkIncludeSpecifiedCardsUnlimitedCopies(){
  Random gen=new Random();
  ImplementedCard card1, card2;
  card1=referenceCards.get(gen.nextInt(referenceCards.size()));
  card2=referenceCards.get(gen.nextInt(referenceCards.size()));
  DeckFactoryBuilder builder=new DeckFactoryBuilder();
  builder.includeSpecificCards(card1,card2);
  builder.allowUnlimitedCopiesOfCards();
  Deck testDeck=builder.buildDeckFactory().generateRandomDeck();
  boolean test1Passed=false;
  boolean test2Passed=false;
  for (int i=0; i < 30; i++) {
    if (testDeck.drawCard(i).getName().equals(card1.name_))     test1Passed=true;
    if (testDeck.drawCard(i).getName().equals(card2.name_))     test2Passed=true;
  }
  assertTrue(card1.name_,test1Passed);
  assertTrue(card2.name_,test2Passed);
}
Program: 112715
Project: 112715
Buggy source:
/** 
 * Battlecry: Gain +1 Health for each card in your hand.
 */
@Override public EffectCharacter<Minion> getBattlecryEffect(){
  return (  PlayerSide originSide,  Minion origin,  PlayerSide targetSide,  int minionPlacementIndex,  HearthTreeNode boardState) -> {
    this.addHealth((byte)boardState.data_.getCurrentPlayer().getHand().size());
    return boardState;
  }
;
}

Fixed version (ground truth):
/** 
 * Battlecry: Gain +1 Health for each card in your hand.
 */
@Override public EffectCharacter<Minion> getBattlecryEffect(){
  return (  PlayerSide originSide,  Minion origin,  PlayerSide targetSide,  int minionPlacementIndex,  HearthTreeNode boardState) -> {
    this.addHealth((byte)boardState.data_.getCurrentPlayer().getHand().size());
    this.addMaxHealth((byte)boardState.data_.getCurrentPlayer().getHand().size());
    return boardState;
  }
;
}
Program: 112716
Project: 112716
Buggy source:
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState,boolean singleRealizationOnly){
  List<BoardModel.CharacterLocation> locations=new ArrayList<>();
  for (  BoardModel.CharacterLocation location : boardState.data_) {
    if (this.filter.targetMatches(playerSide,origin,location.getPlayerSide(),location.getIndex(),boardState.data_)) {
      locations.add(location);
    }
  }
switch (locations.size()) {
case 0:
    break;
case 1:
  this.effect.applyEffect(playerSide,origin,locations.get(0).getPlayerSide(),locations.get(0).getIndex(),boardState);
break;
default :
RandomEffectNode rngNode=new RandomEffectNode(boardState,boardState.getAction());
for (BoardModel.CharacterLocation location : locations) {
HearthTreeNode newState=new HearthTreeNode(rngNode.data_.deepCopy());
this.cleanupBoard(playerSide,origin,boardState.data_,newState.data_);
this.effect.applyEffect(playerSide,origin,location.getPlayerSide(),location.getIndex(),newState);
rngNode.addChild(newState);
}
boardState=rngNode;
break;
}
return boardState;
}

Fixed version (ground truth):
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState,boolean singleRealizationOnly){
  List<BoardModel.CharacterLocation> locations=new ArrayList<>();
  for (  BoardModel.CharacterLocation location : boardState.data_) {
    if (this.filter.targetMatches(playerSide,origin,location.getPlayerSide(),location.getIndex(),boardState.data_)) {
      locations.add(location);
    }
  }
switch (locations.size()) {
case 0:
    break;
case 1:
  this.effect.applyEffect(playerSide,origin,locations.get(0).getPlayerSide(),locations.get(0).getIndex(),boardState);
break;
default :
RandomEffectNode rngNode=new RandomEffectNode(boardState,boardState.getAction());
for (BoardModel.CharacterLocation location : locations) {
HearthTreeNode newState=new HearthTreeNode(rngNode.data_.deepCopy());
if (origin instanceof Minion) {
Card originReferenceInNewState=newState.data_.modelForSide(playerSide).getCharacter(boardState.data_.modelForSide(playerSide).getIndexForCharacter((Minion)origin));
this.effect.applyEffect(playerSide,origin,location.getPlayerSide(),location.getIndex(),newState);
this.cleanupBoard(originReferenceInNewState,newState.data_);
}
 else {
this.effect.applyEffect(playerSide,origin,location.getPlayerSide(),location.getIndex(),newState);
}
BoardStateFactoryBase.handleDeadMinions(newState,singleRealizationOnly);
rngNode.addChild(newState);
}
boardState=rngNode;
break;
}
return boardState;
}
Program: 112717
Project: 112717
Buggy source:
private void cleanupBoard(PlayerSide originSide,Card origin,BoardModel parent,BoardModel child){
  if (origin instanceof Minion) {
    int originIndex=parent.modelForSide(originSide).getIndexForCharacter((Minion)origin);
    child.removeMinion(originSide,originIndex - 1);
  }
}

Fixed version (ground truth):
private void cleanupBoard(Card originReferenceInNewState,BoardModel newState){
  if (originReferenceInNewState instanceof Minion) {
    newState.removeMinion((Minion)originReferenceInNewState);
  }
}
Program: 112718
Project: 112718
Buggy source:
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState,boolean singleRealizationOnly){
  HearthTreeNode toRet=super.performAction(origin,playerSide,boardState,singleRealizationOnly);
  PlayerModel targetPlayer=toRet.data_.modelForSide(playerSide);
  int targetIndex=targetPlayer.getNumMinions();
  if (origin instanceof Minion) {
    targetIndex=targetPlayer.getIndexForCharacter((Minion)origin) - 1;
    toRet.data_.removeMinion((Minion)origin);
  }
  int numMinionsToActuallySummon=numMinions_;
  if (targetPlayer.isBoardFull()) {
    numMinionsToActuallySummon=7 - targetPlayer.getNumMinions();
  }
  for (int index=0; index < numMinionsToActuallySummon; ++index) {
    try {
      Minion newMinion=minionClass_.newInstance();
      toRet=newMinion.summonMinion(playerSide,targetIndex,toRet,false,true);
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return toRet;
}

Fixed version (ground truth):
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState,boolean singleRealizationOnly){
  HearthTreeNode toRet=super.performAction(origin,playerSide,boardState,singleRealizationOnly);
  PlayerModel targetPlayer=toRet.data_.modelForSide(playerSide);
  int targetIndex=targetPlayer.getNumMinions();
  if (origin instanceof Minion) {
    targetIndex=targetPlayer.getIndexForCharacter((Minion)origin) - 1;
    toRet.data_.removeMinion((Minion)origin);
  }
  int numMinionsToActuallySummon=numMinions_;
  if (targetPlayer.getNumEmptyBoardSpace() < numMinionsToActuallySummon) {
    numMinionsToActuallySummon=targetPlayer.getNumEmptyBoardSpace();
  }
  for (int index=0; index < numMinionsToActuallySummon; ++index) {
    try {
      Minion newMinion=minionClass_.newInstance();
      toRet=newMinion.summonMinion(playerSide,targetIndex,toRet,false,true);
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return toRet;
}
Program: 112719
Project: 112719
Buggy source:
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState,boolean singleRealizationOnly){
  PlayerModel owner=boardState.data_.modelForSide(playerSide);
  PlayerModel opposing=boardState.data_.modelForSide(playerSide.getOtherPlayer());
  List<Minion> friendlyTargets=new ArrayList<>();
  for (  Minion minion : owner.getMinions()) {
    if (this.filter.targetMatches(playerSide,origin,playerSide,minion,boardState.data_)) {
      friendlyTargets.add(minion);
    }
  }
  List<Minion> enemyTargets=new ArrayList<>();
  for (  Minion minion : opposing.getMinions()) {
    if (this.filter.targetMatches(playerSide,origin,playerSide.getOtherPlayer(),minion,boardState.data_)) {
      enemyTargets.add(minion);
    }
  }
  int totalTargets=friendlyTargets.size() + enemyTargets.size();
  Minion targetMinion;
switch (totalTargets) {
case 0:
    break;
case 1:
  targetMinion=friendlyTargets.size() > 0 ? friendlyTargets.get(0) : enemyTargets.get(0);
this.effect.applyEffect(playerSide,origin,playerSide,targetMinion,boardState);
break;
default :
RandomEffectNode rngNode=new RandomEffectNode(boardState,boardState.getAction());
for (Minion possibleTarget : friendlyTargets) {
int targetIndex=owner.getIndexForCharacter(possibleTarget);
HearthTreeNode newState=new HearthTreeNode(rngNode.data_.deepCopy());
this.cleanupBoard(playerSide,origin,boardState.data_,newState.data_);
this.effect.applyEffect(playerSide,origin,playerSide,targetIndex,newState);
rngNode.addChild(newState);
}
for (Minion possibleTarget : enemyTargets) {
int targetIndex=opposing.getIndexForCharacter(possibleTarget);
HearthTreeNode newState=new HearthTreeNode(rngNode.data_.deepCopy());
this.cleanupBoard(playerSide,origin,boardState.data_,newState.data_);
this.effect.applyEffect(playerSide,origin,playerSide.getOtherPlayer(),targetIndex,newState);
rngNode.addChild(newState);
}
boardState=rngNode;
break;
}
return boardState;
}

Fixed version (ground truth):
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState,boolean singleRealizationOnly){
  List<BoardModel.CharacterLocation> locations=new ArrayList<>();
  for (  BoardModel.CharacterLocation location : boardState.data_) {
    if (this.filter.targetMatches(playerSide,origin,location.getPlayerSide(),location.getIndex(),boardState.data_)) {
      locations.add(location);
    }
  }
switch (locations.size()) {
case 0:
    break;
case 1:
  this.effect.applyEffect(playerSide,origin,locations.get(0).getPlayerSide(),locations.get(0).getIndex(),boardState);
break;
default :
RandomEffectNode rngNode=new RandomEffectNode(boardState,boardState.getAction());
for (BoardModel.CharacterLocation location : locations) {
HearthTreeNode newState=new HearthTreeNode(rngNode.data_.deepCopy());
this.cleanupBoard(playerSide,origin,boardState.data_,newState.data_);
this.effect.applyEffect(playerSide,origin,location.getPlayerSide(),location.getIndex(),newState);
rngNode.addChild(newState);
}
boardState=rngNode;
break;
}
return boardState;
}
Program: 112721
Project: 112721
Buggy source:
@Override public HearthTreeNode useUntargetableBattlecry_core(int minionPlacementIndex,HearthTreeNode boardState,boolean singleRealizationOnly){
  return this.effectAllUsingFilter(this.getAoeEffect(),this.getAoeFilter(),boardState);
}

Fixed version (ground truth):
@Override public HearthTreeNode useUntargetableBattlecry_core(int minionPlacementIndex,HearthTreeNode boardState,boolean singleRealizationOnly){
  return this.effectAllUsingFilter(ColdlightSeer.effect,ColdlightSeer.filter,boardState);
}
Program: 112722
Project: 112722
Buggy source:
/** 
 * Battlecry: Heals friendly characters for 2
 */
@Override public HearthTreeNode useUntargetableBattlecry_core(int minionPlacementIndex,HearthTreeNode boardState,boolean singleRealizationOnly){
  return this.effectAllUsingFilter(this.getAoeEffect(),this.getAoeFilter(),boardState);
}

Fixed version (ground truth):
/** 
 * Battlecry: Heals friendly characters for 2
 */
@Override public HearthTreeNode useUntargetableBattlecry_core(int minionPlacementIndex,HearthTreeNode boardState,boolean singleRealizationOnly){
  return this.effectAllUsingFilter(DarkscaleHealer.effect,DarkscaleHealer.filter,boardState);
}
Program: 112723
Project: 112723
Buggy source:
@Override public HearthTreeNode startTurn(PlayerSide thisMinionPlayerIndex,HearthTreeNode boardModel) throws HSException {
  HearthTreeNode toRet=boardModel;
  if (thisMinionPlayerIndex == PlayerSide.CURRENT_PLAYER) {
    toRet=this.effectAllUsingFilter(this.getAoeEffect(),this.getAoeFilter(),toRet);
  }
  return super.startTurn(thisMinionPlayerIndex,toRet);
}

Fixed version (ground truth):
@Override public HearthTreeNode startTurn(PlayerSide thisMinionPlayerIndex,HearthTreeNode boardModel) throws HSException {
  HearthTreeNode toRet=boardModel;
  if (thisMinionPlayerIndex == PlayerSide.CURRENT_PLAYER) {
    toRet=this.effectAllUsingFilter(Doomsayer.effect,Doomsayer.filter,toRet);
  }
  return super.startTurn(thisMinionPlayerIndex,toRet);
}
Program: 112724
Project: 112724
Buggy source:
/** 
 * Battlecry: Deals 1 damage to all characters
 */
@Override public HearthTreeNode useUntargetableBattlecry_core(int minionPlacementIndex,HearthTreeNode boardState,boolean singleRealizationOnly){
  return this.effectAllUsingFilter(this.getAoeEffect(),this.getAoeFilter(),boardState);
}

Fixed version (ground truth):
/** 
 * Battlecry: Deals 1 damage to all characters
 */
@Override public HearthTreeNode useUntargetableBattlecry_core(int minionPlacementIndex,HearthTreeNode boardState,boolean singleRealizationOnly){
  return this.effectAllUsingFilter(DreadInfernal.effect,DreadInfernal.filter,boardState);
}
Program: 112725
Project: 112725
Buggy source:
/** 
 * Use a targetable battlecry. This will add battlecry nodes to boardState as children.
 * @param side
 * @param targetMinion
 * @param boardState
 * @param deckPlayer0
 * @param deckPlayer1
 * @return
 * @throws HSException
 */
public HearthTreeNode useTargetableBattlecry(PlayerSide side,Minion targetMinion,HearthTreeNode boardState,Deck deckPlayer0,Deck deckPlayer1,boolean singleRealizationOnly) throws HSException {
  if (this instanceof MinionTargetableBattlecry) {
    MinionTargetableBattlecry battlecryMinion=(MinionTargetableBattlecry)this;
    HearthTreeNode node=new HearthTreeNode(boardState.data_.deepCopy());
    int targetMinionIndex=side.getPlayer(boardState).getMinions().indexOf(targetMinion);
    if (targetMinionIndex >= 0) {
      node=battlecryMinion.useTargetableBattlecry_core(side,side.getPlayer(node).getMinions().get(targetMinionIndex),node,deckPlayer0,deckPlayer1);
    }
 else     if (targetMinion instanceof Hero) {
      node=battlecryMinion.useTargetableBattlecry_core(side,side.getPlayer(node).getHero(),node,deckPlayer0,deckPlayer1);
    }
 else {
      node=null;
    }
    if (node != null) {
      node=BoardStateFactoryBase.handleDeadMinions(node,deckPlayer0,deckPlayer1,singleRealizationOnly);
      boardState.addChild(node);
    }
  }
  return boardState;
}

Fixed version (ground truth):
/** 
 * Use a targetable battlecry. This will add battlecry nodes to boardState as children.
 * @param side
 * @param targetMinion
 * @param boardState
 * @param deckPlayer0
 * @param deckPlayer1
 * @return
 * @throws HSException
 */
public HearthTreeNode useTargetableBattlecry(PlayerSide side,Minion targetMinion,HearthTreeNode boardState,Deck deckPlayer0,Deck deckPlayer1,boolean singleRealizationOnly) throws HSException {
  if (this instanceof MinionTargetableBattlecry) {
    HearthTreeNode node=new HearthTreeNode(boardState.data_.deepCopy());
    int originMinionIndex=PlayerSide.CURRENT_PLAYER.getPlayer(boardState).getMinions().indexOf(this);
    MinionTargetableBattlecry battlecryMinion=(MinionTargetableBattlecry)PlayerSide.CURRENT_PLAYER.getPlayer(node).getMinions().get(originMinionIndex);
    int targetMinionIndex=side.getPlayer(boardState).getMinions().indexOf(targetMinion);
    if (targetMinionIndex >= 0) {
      node=battlecryMinion.useTargetableBattlecry_core(side,side.getPlayer(node).getMinions().get(targetMinionIndex),node,deckPlayer0,deckPlayer1);
    }
 else     if (targetMinion instanceof Hero) {
      node=battlecryMinion.useTargetableBattlecry_core(side,side.getPlayer(node).getHero(),node,deckPlayer0,deckPlayer1);
    }
 else {
      node=null;
    }
    if (node != null) {
      node=BoardStateFactoryBase.handleDeadMinions(node,deckPlayer0,deckPlayer1,singleRealizationOnly);
      boardState.addChild(node);
    }
  }
  return boardState;
}
Program: 112726
Project: 112726
Buggy source:
@Override public HearthTreeNode performAction(Minion minion,PlayerSide playerSide,HearthTreeNode boardState,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=super.performAction(minion,playerSide,boardState,deckPlayer0,deckPlayer1);
  for (int index=0; index < numMinions_; ++index) {
    try {
      Minion newMinion=(Minion)minionClass_.newInstance();
      Minion placementTarget=toRet.data_.getCharacter(playerSide,toRet.data_.getMinions(playerSide).indexOf(minion));
      toRet.data_.removeMinion(minion);
      toRet=newMinion.summonMinion(playerSide,placementTarget,toRet,deckPlayer0,deckPlayer1,false,true);
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new HSException();
    }
  }
  return toRet;
}

Fixed version (ground truth):
@Override public HearthTreeNode performAction(Minion minion,PlayerSide playerSide,HearthTreeNode boardState,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=super.performAction(minion,playerSide,boardState,deckPlayer0,deckPlayer1);
  Minion placementTarget=toRet.data_.getCharacter(playerSide,toRet.data_.getMinions(playerSide).indexOf(minion));
  toRet.data_.removeMinion(minion);
  int numMinionsToActuallySummon=numMinions_;
  if (playerSide.getPlayer(toRet).getMinions().size() + numMinions_ > 7)   numMinionsToActuallySummon=7 - playerSide.getPlayer(toRet).getMinions().size();
  for (int index=0; index < numMinionsToActuallySummon; ++index) {
    try {
      Minion newMinion=(Minion)minionClass_.newInstance();
      toRet=newMinion.summonMinion(playerSide,placementTarget,toRet,deckPlayer0,deckPlayer1,false,true);
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new HSException();
    }
  }
  return toRet;
}
Program: 112729
Project: 112729
Buggy source:
/** 
 * Returns whether this card can be used on the given target or not This function is an optional optimization feature. Some cards in Hearthstone have limited targets; Shadow Bolt cannot be used on heroes, Mind Blast can only target enemy heroes, etc. Even in this situation though, BoardStateFactory will still try to play non- sensical moves because it doesn't know that such moves are invalid until it tries to play them. The problem is, the BoardStateFactory has to go and make a deep copy of the current BoardState before it can go and try to play the invalid move, and it turns out that 98% of execution time in HearthSim is BoardStateFactory calling BoardState.deepCopy(). By overriding this function and returning false on appropriate occasions, we can save some calls to deepCopy and get better performance out of the code. By default, this function only checks mana cost.
 * @param playerSide
 * @param boardModel
 * @return
 */
public boolean canBeUsedOn(PlayerSide playerSide,Minion minion,BoardModel boardModel){
  return (this.getManaCost(PlayerSide.CURRENT_PLAYER,boardModel) <= boardModel.getCurrentPlayer().getMana());
}

Fixed version (ground truth):
/** 
 * Returns whether this card can be used on the given target or not This function is an optional optimization feature. Some cards in Hearthstone have limited targets; Shadow Bolt cannot be used on heroes, Mind Blast can only target enemy heroes, etc. Even in this situation though, BoardStateFactory will still try to play non- sensical moves because it doesn't know that such moves are invalid until it tries to play them. The problem is, the BoardStateFactory has to go and make a deep copy of the current BoardState before it can go and try to play the invalid move, and it turns out that 98% of execution time in HearthSim is BoardStateFactory calling BoardState.deepCopy(). By overriding this function and returning false on appropriate occasions, we can save some calls to deepCopy and get better performance out of the code. By default, this function only checks mana cost.
 * @param playerSide
 * @param boardModel
 * @return
 */
public boolean canBeUsedOn(PlayerSide playerSide,Minion minion,BoardModel boardModel){
  return this.getManaCost(PlayerSide.CURRENT_PLAYER,boardModel) <= boardModel.getCurrentPlayer().getMana();
}
Program: 112730
Project: 112730
Buggy source:
protected HearthTreeNode notifyMinionSummon(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionSummonedInterface> matches=new ArrayList<MinionSummonedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionSummonedInterface) {
    matches.add((MinionSummonedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionSummonedInterface) {
        matches.add((MinionSummonedInterface)minion);
      }
    }
  }
  for (  MinionSummonedInterface match : matches) {
    toRet=match.minionSummonEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionSummonedInterface) {
    matches.add((MinionSummonedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionSummonedInterface) {
        matches.add((MinionSummonedInterface)minion);
      }
    }
  }
  for (  MinionSummonedInterface match : matches) {
    toRet=match.minionSummonEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}

Fixed version (ground truth):
protected HearthTreeNode notifyMinionSummon(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionSummonedInterface> matches=new ArrayList<MinionSummonedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionSummonedInterface) {
    matches.add((MinionSummonedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionSummonedInterface) {
      matches.add((MinionSummonedInterface)minion);
    }
  }
  for (  MinionSummonedInterface match : matches) {
    toRet=match.minionSummonEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionSummonedInterface) {
    matches.add((MinionSummonedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionSummonedInterface) {
      matches.add((MinionSummonedInterface)minion);
    }
  }
  for (  MinionSummonedInterface match : matches) {
    toRet=match.minionSummonEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}
Program: 112731
Project: 112731
Buggy source:
protected HearthTreeNode notifyMinionPlayed(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionPlayedInterface> matches=new ArrayList<MinionPlayedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionPlayedInterface) {
    matches.add((MinionPlayedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionPlayedInterface) {
        matches.add((MinionPlayedInterface)minion);
      }
    }
  }
  for (  MinionPlayedInterface match : matches) {
    toRet=match.minionPlayedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionPlayedInterface) {
    matches.add((MinionPlayedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionPlayedInterface) {
        matches.add((MinionPlayedInterface)minion);
      }
    }
  }
  for (  MinionPlayedInterface match : matches) {
    toRet=match.minionPlayedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}

Fixed version (ground truth):
protected HearthTreeNode notifyMinionPlayed(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionPlayedInterface> matches=new ArrayList<MinionPlayedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionPlayedInterface) {
    matches.add((MinionPlayedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionPlayedInterface) {
      matches.add((MinionPlayedInterface)minion);
    }
  }
  for (  MinionPlayedInterface match : matches) {
    toRet=match.minionPlayedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionPlayedInterface) {
    matches.add((MinionPlayedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionPlayedInterface) {
      matches.add((MinionPlayedInterface)minion);
    }
  }
  for (  MinionPlayedInterface match : matches) {
    toRet=match.minionPlayedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}
Program: 112732
Project: 112732
Buggy source:
protected HearthTreeNode notifyMinionHealed(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionHealedInterface> matches=new ArrayList<MinionHealedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionHealedInterface) {
    matches.add((MinionHealedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionHealedInterface) {
        matches.add((MinionHealedInterface)minion);
      }
    }
  }
  for (  MinionHealedInterface match : matches) {
    toRet=match.minionHealedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionHealedInterface) {
    matches.add((MinionHealedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionHealedInterface) {
        matches.add((MinionHealedInterface)minion);
      }
    }
  }
  for (  MinionHealedInterface match : matches) {
    toRet=match.minionHealedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}

Fixed version (ground truth):
protected HearthTreeNode notifyMinionHealed(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionHealedInterface> matches=new ArrayList<MinionHealedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionHealedInterface) {
    matches.add((MinionHealedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionHealedInterface) {
      matches.add((MinionHealedInterface)minion);
    }
  }
  for (  MinionHealedInterface match : matches) {
    toRet=match.minionHealedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionHealedInterface) {
    matches.add((MinionHealedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionHealedInterface) {
      matches.add((MinionHealedInterface)minion);
    }
  }
  for (  MinionHealedInterface match : matches) {
    toRet=match.minionHealedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}
Program: 112733
Project: 112733
Buggy source:
protected HearthTreeNode notifyMinionPlacement(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionPlacedInterface> matches=new ArrayList<MinionPlacedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionPlacedInterface) {
    matches.add((MinionPlacedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionPlacedInterface) {
        matches.add((MinionPlacedInterface)minion);
      }
    }
  }
  for (  MinionPlacedInterface match : matches) {
    toRet=match.minionPlacedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionPlacedInterface) {
    matches.add((MinionPlacedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionPlacedInterface) {
        matches.add((MinionPlacedInterface)minion);
      }
    }
  }
  for (  MinionPlacedInterface match : matches) {
    toRet=match.minionPlacedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}

Fixed version (ground truth):
protected HearthTreeNode notifyMinionPlacement(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionPlacedInterface> matches=new ArrayList<MinionPlacedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionPlacedInterface) {
    matches.add((MinionPlacedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionPlacedInterface) {
      matches.add((MinionPlacedInterface)minion);
    }
  }
  for (  MinionPlacedInterface match : matches) {
    toRet=match.minionPlacedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionPlacedInterface) {
    matches.add((MinionPlacedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionPlacedInterface) {
      matches.add((MinionPlacedInterface)minion);
    }
  }
  for (  MinionPlacedInterface match : matches) {
    toRet=match.minionPlacedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}
Program: 112734
Project: 112734
Buggy source:
protected HearthTreeNode notifyMinionDamaged(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionDamagedInterface> matches=new ArrayList<MinionDamagedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionDamagedInterface) {
    matches.add((MinionDamagedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionDamagedInterface) {
        matches.add((MinionDamagedInterface)minion);
      }
    }
  }
  for (  MinionDamagedInterface match : matches) {
    toRet=match.minionDamagedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionDamagedInterface) {
    matches.add((MinionDamagedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionDamagedInterface) {
        matches.add((MinionDamagedInterface)minion);
      }
    }
  }
  for (  MinionDamagedInterface match : matches) {
    toRet=match.minionDamagedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}

Fixed version (ground truth):
protected HearthTreeNode notifyMinionDamaged(HearthTreeNode boardState,PlayerSide targetSide,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionDamagedInterface> matches=new ArrayList<MinionDamagedInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionDamagedInterface) {
    matches.add((MinionDamagedInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionDamagedInterface) {
      matches.add((MinionDamagedInterface)minion);
    }
  }
  for (  MinionDamagedInterface match : matches) {
    toRet=match.minionDamagedEvent(PlayerSide.CURRENT_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionDamagedInterface) {
    matches.add((MinionDamagedInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionDamagedInterface) {
      matches.add((MinionDamagedInterface)minion);
    }
  }
  for (  MinionDamagedInterface match : matches) {
    toRet=match.minionDamagedEvent(PlayerSide.WAITING_PLAYER,targetSide,this,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}
Program: 112735
Project: 112735
Buggy source:
protected HearthTreeNode notifyMinionDead(PlayerSide deadMinionPlayerSide,Minion deadMinion,HearthTreeNode boardState,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionDeadInterface> matches=new ArrayList<MinionDeadInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionDeadInterface) {
    matches.add((MinionDeadInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionDeadInterface) {
        matches.add((MinionDeadInterface)minion);
      }
    }
  }
  for (  MinionDeadInterface match : matches) {
    toRet=match.minionDeadEvent(PlayerSide.CURRENT_PLAYER,deadMinionPlayerSide,deadMinion,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionDeadInterface) {
    matches.add((MinionDeadInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced()) {
      if (minion instanceof MinionDeadInterface) {
        matches.add((MinionDeadInterface)minion);
      }
    }
  }
  for (  MinionDeadInterface match : matches) {
    toRet=match.minionDeadEvent(PlayerSide.WAITING_PLAYER,deadMinionPlayerSide,deadMinion,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}

Fixed version (ground truth):
protected HearthTreeNode notifyMinionDead(PlayerSide deadMinionPlayerSide,Minion deadMinion,HearthTreeNode boardState,Deck deckPlayer0,Deck deckPlayer1) throws HSException {
  HearthTreeNode toRet=boardState;
  ArrayList<MinionDeadInterface> matches=new ArrayList<MinionDeadInterface>();
  Card hero=toRet.data_.getCurrentPlayerHero();
  if (hero instanceof MinionDeadInterface) {
    matches.add((MinionDeadInterface)hero);
  }
  for (  Minion minion : PlayerSide.CURRENT_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionDeadInterface) {
      matches.add((MinionDeadInterface)minion);
    }
  }
  for (  MinionDeadInterface match : matches) {
    toRet=match.minionDeadEvent(PlayerSide.CURRENT_PLAYER,deadMinionPlayerSide,deadMinion,toRet,deckPlayer0,deckPlayer1);
  }
  matches.clear();
  hero=toRet.data_.getWaitingPlayerHero();
  if (hero instanceof MinionDeadInterface) {
    matches.add((MinionDeadInterface)hero);
  }
  for (  Minion minion : PlayerSide.WAITING_PLAYER.getPlayer(toRet).getMinions()) {
    if (!minion.isSilenced() && minion instanceof MinionDeadInterface) {
      matches.add((MinionDeadInterface)minion);
    }
  }
  for (  MinionDeadInterface match : matches) {
    toRet=match.minionDeadEvent(PlayerSide.WAITING_PLAYER,deadMinionPlayerSide,deadMinion,toRet,deckPlayer0,deckPlayer1);
  }
  return toRet;
}
Program: 112736
Project: 112736
Buggy source:
public Game(PlayerModel playerModel0,PlayerModel playerModel1,ArtificialPlayer ai0,ArtificialPlayer ai1,boolean shufflePlayOrder){
  playerGoingFirst=playerModel0;
  playerGoingSecond=playerModel1;
  aiForPlayerGoingFirst=ai0;
  aiForPlayerGoingSecond=ai1;
  if (shufflePlayOrder && Math.random() > 0.5) {
    playerGoingFirst=playerModel1;
    playerGoingSecond=playerModel0;
    aiForPlayerGoingFirst=ai1;
    aiForPlayerGoingSecond=ai0;
  }
  log.debug("String_Node_Str",shufflePlayOrder);
  log.debug("String_Node_Str",playerGoingFirst.getPlayerId());
  boardModel=new BoardModel(playerGoingFirst,playerGoingSecond);
}

Fixed version (ground truth):
public Game(PlayerModel playerModel0,PlayerModel playerModel1,ArtificialPlayer ai0,ArtificialPlayer ai1,boolean shufflePlayOrder){
  this(playerModel0,playerModel1,ai0,ai1,(shufflePlayOrder && Math.random() >= 0.5) ? 0 : 1);
}
Program: 112737
Project: 112737
Buggy source:
public void setWindfury(boolean value){
  windFury_=value;
}

Fixed version (ground truth):
public void setWindfury(boolean value){
  windFury_=value;
  if (hasAttacked_) {
    hasAttacked_=false;
    hasWindFuryAttacked_=true;
  }
}
Program: 112738
Project: 112738
Buggy source:
@Test @Ignore("String_Node_Str") public void testWindfuryPostAttack() throws HSException {
  Minion target=board.data_.getCharacter(PlayerSide.WAITING_PLAYER,0);
  HearthTreeNode ret=raptor.attack(PlayerSide.WAITING_PLAYER,target,board,null,null);
  assertEquals(board,ret);
  assertFalse(raptor.canAttack());
  assertEquals(30,board.data_.getCurrentPlayerHero().getHealth());
  assertEquals(27,board.data_.getWaitingPlayerHero().getHealth());
  raptor.setWindfury(true);
  assertTrue(raptor.canAttack());
  ret=raptor.attack(PlayerSide.WAITING_PLAYER,target,board,null,null);
  assertEquals(board,ret);
  assertFalse(raptor.canAttack());
  assertEquals(30,board.data_.getCurrentPlayerHero().getHealth());
  assertEquals(24,board.data_.getWaitingPlayerHero().getHealth());
}

Fixed version (ground truth):
@Test public void testWindfuryPostAttack() throws HSException {
  Minion target=board.data_.getCharacter(PlayerSide.WAITING_PLAYER,0);
  HearthTreeNode ret=raptor.attack(PlayerSide.WAITING_PLAYER,target,board,null,null);
  assertEquals(board,ret);
  assertFalse(raptor.canAttack());
  assertEquals(30,board.data_.getCurrentPlayerHero().getHealth());
  assertEquals(27,board.data_.getWaitingPlayerHero().getHealth());
  raptor.setWindfury(true);
  assertTrue(raptor.canAttack());
  ret=raptor.attack(PlayerSide.WAITING_PLAYER,target,board,null,null);
  assertEquals(board,ret);
  assertFalse(raptor.canAttack());
  assertEquals(30,board.data_.getCurrentPlayerHero().getHealth());
  assertEquals(24,board.data_.getWaitingPlayerHero().getHealth());
}
Program: 112739
Project: 112739
Buggy source:
public GameResult runGame() throws HSException {
  curTurn_=0;
  boardModel_.placeCardHandCurrentPlayer(0);
  boardModel_.placeCardHandCurrentPlayer(1);
  boardModel_.placeCardHandCurrentPlayer(2);
  boardModel_.setDeckPos_p0(3);
  boardModel_.placeCardHandWaitingPlayer(0);
  boardModel_.placeCardHandWaitingPlayer(1);
  boardModel_.placeCardHandWaitingPlayer(2);
  boardModel_.placeCardHandWaitingPlayer(3);
  boardModel_.placeCardHandWaitingPlayer(new TheCoin());
  boardModel_.setDeckPos_p1(4);
  GameRecord record=new GameSimpleRecord();
  record.put(0,PlayerSide.CURRENT_PLAYER,(BoardModel)boardModel_.deepCopy(),null);
  record.put(0,PlayerSide.CURRENT_PLAYER,(BoardModel)boardModel_.flipPlayers().deepCopy(),null);
  GameResult gameResult;
  for (int turnCount=0; turnCount < maxTurns_; ++turnCount) {
    log.debug("String_Node_Str" + turnCount);
    long turnStart=System.currentTimeMillis();
    gameResult=playTurn(turnCount,record,aiForPlayerGoingFirst);
    if (gameResult != null)     return gameResult;
    gameResult=playTurn(turnCount,record,aiForPlayerGoingSecond);
    if (gameResult != null)     return gameResult;
    long turnEnd=System.currentTimeMillis();
    long turnDelta=turnEnd - turnStart;
    if (turnDelta > aiForPlayerGoingFirst.getMaxThinkTime() / 2) {
      log.warn("String_Node_Str",turnDelta,aiForPlayerGoingFirst.getMaxThinkTime());
    }
 else {
      log.debug("String_Node_Str",turnDelta);
    }
  }
  return new GameResult(playerGoingFirst.getPlayerId(),-1,0,record);
}

Fixed version (ground truth):
public GameResult runGame() throws HSException {
  curTurn_=0;
  boardModel.placeCardHandCurrentPlayer(0);
  boardModel.placeCardHandCurrentPlayer(1);
  boardModel.placeCardHandCurrentPlayer(2);
  boardModel.setDeckPos_p0(3);
  boardModel.placeCardHandWaitingPlayer(0);
  boardModel.placeCardHandWaitingPlayer(1);
  boardModel.placeCardHandWaitingPlayer(2);
  boardModel.placeCardHandWaitingPlayer(3);
  boardModel.placeCardHandWaitingPlayer(new TheCoin());
  boardModel.setDeckPos_p1(4);
  GameRecord record=new GameSimpleRecord();
  record.put(0,PlayerSide.CURRENT_PLAYER,(BoardModel)boardModel.deepCopy(),null);
  record.put(0,PlayerSide.CURRENT_PLAYER,(BoardModel)boardModel.flipPlayers().deepCopy(),null);
  GameResult gameResult;
  for (int turnCount=0; turnCount < maxTurns_; ++turnCount) {
    log.debug("String_Node_Str" + turnCount);
    long turnStart=System.currentTimeMillis();
    gameResult=playTurn(turnCount,record,aiForPlayerGoingFirst);
    if (gameResult != null)     return gameResult;
    gameResult=playTurn(turnCount,record,aiForPlayerGoingSecond);
    if (gameResult != null)     return gameResult;
    long turnEnd=System.currentTimeMillis();
    long turnDelta=turnEnd - turnStart;
    if (turnDelta > aiForPlayerGoingFirst.getMaxThinkTime() / 2) {
      log.warn("String_Node_Str",turnDelta,aiForPlayerGoingFirst.getMaxThinkTime());
    }
 else {
      log.debug("String_Node_Str",turnDelta);
    }
  }
  return new GameResult(playerGoingFirst.getPlayerId(),-1,0,record);
}