Program: 112824
Project: 112824
Buggy source:
/** 
 * Called when this minion takes damage Always use this function to take damage... it properly notifies all others of its damage and possibly of its death
 * @param damage The amount of damage to take
 * @param attackerPlayerIndex The player index of the attacker.  This is needed to do things like +spell damage.
 * @param thisPlayerIndex The player index of this minion
 * @param thisMinionIndex The minion index of this minion
 * @param boardState 
 * @param deck
 * @param isSpellDamage True if this is a spell damage
 * @throws HSInvalidPlayerIndexException
 */
public void takeDamage(byte damage,int attackerPlayerIndex,int thisPlayerIndex,int thisMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck,boolean isSpellDamage) throws HSInvalidPlayerIndexException {
  if (!divineShield_) {
    byte totalDamage=isSpellDamage ? (byte)(damage + boardState.data_.getSpellDamage(attackerPlayerIndex)) : damage;
    health_=(byte)(health_ - totalDamage);
    HearthTreeNode<BoardState> toRet=boardState;
    toRet=toRet.data_.getHero_p0().minionDamagedEvent(0,0,thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionDamagedEvent(0,j + 1,thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionDamagedEvent(1,0,thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionDamagedEvent(1,j + 1,thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    if (health_ <= 0) {
      this.destroyed(thisPlayerIndex,thisMinionIndex,boardState,deck);
    }
  }
 else {
    divineShield_=false;
  }
}

Fixed version (ground truth):
/** 
 * Called when this minion takes damage Always use this function to take damage... it properly notifies all others of its damage and possibly of its death
 * @param damage The amount of damage to take
 * @param attackerPlayerIndex The player index of the attacker.  This is needed to do things like +spell damage.
 * @param thisPlayerIndex The player index of this minion
 * @param thisMinionIndex The minion index of this minion
 * @param boardState 
 * @param deck
 * @param isSpellDamage True if this is a spell damage
 * @throws HSInvalidPlayerIndexException
 */
public void takeDamage(byte damage,int attackerPlayerIndex,int thisPlayerIndex,int thisMinionIndex,HearthTreeNode<BoardState> boardState,Deck deck,boolean isSpellDamage) throws HSInvalidPlayerIndexException {
  if (!divineShield_) {
    byte totalDamage=isSpellDamage ? (byte)(damage + boardState.data_.getSpellDamage(attackerPlayerIndex)) : damage;
    health_=(byte)(health_ - totalDamage);
    HearthTreeNode<BoardState> toRet=boardState;
    toRet=toRet.data_.getHero_p0().minionDamagedEvent(0,0,thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p0(); ++j) {
      toRet=toRet.data_.getMinion_p0(j).minionDamagedEvent(0,j + 1,thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    toRet=toRet.data_.getHero_p1().minionDamagedEvent(1,0,thisPlayerIndex,thisMinionIndex,toRet,deck);
    for (int j=0; j < toRet.data_.getNumMinions_p1(); ++j) {
      toRet=toRet.data_.getMinion_p1(j).minionDamagedEvent(1,j + 1,thisPlayerIndex,thisMinionIndex,toRet,deck);
    }
    if (health_ <= 0) {
      this.destroyed(thisPlayerIndex,thisMinionIndex,boardState,deck);
    }
  }
 else {
    if (damage > 0)     divineShield_=false;
  }
}