nus-yam/ex-repair huggingface dataset:
Program: 112676
Project: 112676
Buggy source:
private void persistEventsToMongo(List<StratioStreamingMessage> collected_events){
  long time=System.currentTimeMillis();
  Map<String,BulkWriteOperation> elementsToInsert=new HashMap<String,BulkWriteOperation>();
  for (  StratioStreamingMessage event : collected_events) {
    BasicDBObject object=new BasicDBObject("String_Node_Str",time);
    for (    ColumnNameTypeValue columnNameTypeValue : event.getColumns()) {
      object.append(columnNameTypeValue.getColumn(),columnNameTypeValue.getValue());
    }
    BulkWriteOperation bulkInsertOperation=elementsToInsert.get(event.getStreamName());
    if (bulkInsertOperation == null) {
      bulkInsertOperation=streamingDb.getCollection(event.getStreamName()).initializeUnorderedBulkOperation();
      elementsToInsert.put(event.getStreamName(),bulkInsertOperation);
      streamingDb.getCollection(event.getStreamName()).createIndex(new BasicDBObject("String_Node_Str",-1));
    }
    bulkInsertOperation.insert(object);
  }
  for (  Entry<String,BulkWriteOperation> stratioStreamingMessage : elementsToInsert.entrySet()) {
    stratioStreamingMessage.getValue().execute();
  }
}

Fixed version (ground truth):
private void persistEventsToMongo(List<StratioStreamingMessage> collectedEvents){
  long time=System.currentTimeMillis();
  Map<String,BulkWriteOperation> elementsToInsert=new HashMap<String,BulkWriteOperation>();
  for (  StratioStreamingMessage event : collectedEvents) {
    BasicDBObject object=new BasicDBObject("String_Node_Str",time);
    for (    ColumnNameTypeValue columnNameTypeValue : event.getColumns()) {
      object.append(columnNameTypeValue.getColumn(),columnNameTypeValue.getValue());
    }
    BulkWriteOperation bulkInsertOperation=elementsToInsert.get(event.getStreamName());
    if (bulkInsertOperation == null) {
      bulkInsertOperation=streamingDb.getCollection(event.getStreamName()).initializeUnorderedBulkOperation();
      elementsToInsert.put(event.getStreamName(),bulkInsertOperation);
      streamingDb.getCollection(event.getStreamName()).createIndex(new BasicDBObject("String_Node_Str",-1));
    }
    bulkInsertOperation.insert(object);
  }
  for (  Entry<String,BulkWriteOperation> stratioStreamingMessage : elementsToInsert.entrySet()) {
    stratioStreamingMessage.getValue().execute();
  }
}
Program: 112677
Project: 112677
Buggy source:
public NodeSnapshot(String nodeID,byte[] data){
  super();
  this.nodeID=nodeID;
  this.data=data;
}

Fixed version (ground truth):
public NodeSnapshot(String nodeID,byte[] data){
  super();
  this.nodeID=nodeID;
  this.data=data.clone();
}
Program: 112678
Project: 112678
Buggy source:
public StreamToMongoCallback(StreamDefinition streamDefinition,String mongoHost,int mongoPort,String username,String password) throws UnknownHostException {
  this.streamDefinition=streamDefinition;
  running=Boolean.TRUE;
  List<ServerAddress> adresses=Arrays.asList(new ServerAddress(mongoHost,mongoPort));
  if (username != null && password != null) {
    mongoClient=new MongoClient(adresses,Arrays.asList(MongoCredential.createPlainCredential(username,"String_Node_Str",password.toCharArray())));
  }
 else {
    logger.warn("String_Node_Str",username,password);
    mongoClient=new MongoClient(adresses);
  }
  streamingDb=mongoClient.getDB("String_Node_Str");
}

Fixed version (ground truth):
public StreamToMongoCallback(StreamDefinition streamDefinition,String mongoHost,int mongoPort,String username,String password) throws UnknownHostException {
  this.streamDefinition=streamDefinition;
  running=Boolean.TRUE;
  List<ServerAddress> adresses=Arrays.asList(new ServerAddress(mongoHost,mongoPort));
  if (username != null && password != null) {
    mongoClient=new MongoClient(adresses,Arrays.asList(MongoCredential.createPlainCredential(username,"String_Node_Str",password.toCharArray())));
  }
 else {
    logger.warn("String_Node_Str",username,password);
    mongoClient=new MongoClient(adresses);
  }
  streamingDb=mongoClient.getDB(STREAMING.STREAMING_KEYSPACE_NAME);
}
Program: 112679
Project: 112679
Buggy source:
private void persistEventsToMongo(List<StratioStreamingMessage> collected_events){
  long time=System.currentTimeMillis();
  Map<String,BulkWriteOperation> elementsToInsert=new HashMap<String,BulkWriteOperation>();
  for (  StratioStreamingMessage event : collected_events) {
    BasicDBObject object=new BasicDBObject("String_Node_Str",time);
    for (    ColumnNameTypeValue columnNameTypeValue : event.getColumns()) {
      object.append(columnNameTypeValue.getColumn(),columnNameTypeValue.getValue());
    }
    BulkWriteOperation bulkInsertOperation=elementsToInsert.get(event.getStreamName());
    if (bulkInsertOperation == null) {
      bulkInsertOperation=elementsToInsert.put(event.getStreamName(),streamingDb.getCollection(event.getStreamName()).initializeUnorderedBulkOperation());
      streamingDb.getCollection(event.getStreamName()).createIndex(new BasicDBObject("String_Node_Str",-1));
    }
    bulkInsertOperation.insert(object);
  }
  for (  Entry<String,BulkWriteOperation> stratioStreamingMessage : elementsToInsert.entrySet()) {
    stratioStreamingMessage.getValue().execute();
  }
}

Fixed version (ground truth):
private void persistEventsToMongo(List<StratioStreamingMessage> collected_events){
  long time=System.currentTimeMillis();
  Map<String,BulkWriteOperation> elementsToInsert=new HashMap<String,BulkWriteOperation>();
  for (  StratioStreamingMessage event : collected_events) {
    BasicDBObject object=new BasicDBObject("String_Node_Str",time);
    for (    ColumnNameTypeValue columnNameTypeValue : event.getColumns()) {
      object.append(columnNameTypeValue.getColumn(),columnNameTypeValue.getValue());
    }
    BulkWriteOperation bulkInsertOperation=elementsToInsert.get(event.getStreamName());
    if (bulkInsertOperation == null) {
      bulkInsertOperation=streamingDb.getCollection(event.getStreamName()).initializeUnorderedBulkOperation();
      elementsToInsert.put(event.getStreamName(),bulkInsertOperation);
      streamingDb.getCollection(event.getStreamName()).createIndex(new BasicDBObject("String_Node_Str",-1));
    }
    bulkInsertOperation.insert(object);
  }
  for (  Entry<String,BulkWriteOperation> stratioStreamingMessage : elementsToInsert.entrySet()) {
    stratioStreamingMessage.getValue().execute();
  }
}
Program: 112680
Project: 112680
Buggy source:
public ActionBaseFunction(SiddhiManager siddhiManager,String zookeeperHost){
  this.stopValidators=new HashSet<>();
  this.startValidators=new HashSet<>();
  this.siddhiManager=siddhiManager;
  this.zookeeperHost=zookeeperHost;
  startValidators.add(new StreamAllowedValidation(getSiddhiManager()));
  stopValidators.add(new StreamAllowedValidation(getSiddhiManager()));
  addStartRequestsValidations(startValidators);
  addStopRequestsValidations(stopValidators);
}

Fixed version (ground truth):
public ActionBaseFunction(SiddhiManager siddhiManager,String zookeeperHost){
  this.stopValidators=new LinkedHashSet<>();
  this.startValidators=new LinkedHashSet<>();
  this.siddhiManager=siddhiManager;
  this.zookeeperHost=zookeeperHost;
  startValidators.add(new StreamAllowedValidation(getSiddhiManager()));
  stopValidators.add(new StreamAllowedValidation(getSiddhiManager()));
  addStartRequestsValidations(startValidators);
  addStopRequestsValidations(stopValidators);
}
Program: 112682
Project: 112682
Buggy source:
public StreamToIndexerCallback(StreamDefinition streamDefinition,String elasticSearchHost,int elasticSearchPort){
  this.streamDefinition=streamDefinition;
  Settings settings=ImmutableSettings.settingsBuilder().put("String_Node_Str",true).build();
  this.elasticSearchClient=new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(elasticSearchHost,elasticSearchPort));
  running=Boolean.FALSE;
}

Fixed version (ground truth):
public StreamToIndexerCallback(StreamDefinition streamDefinition,String elasticSearchHost,int elasticSearchPort){
  this.streamDefinition=streamDefinition;
  Settings settings=ImmutableSettings.settingsBuilder().put("String_Node_Str",true).build();
  this.elasticSearchClient=new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(elasticSearchHost,elasticSearchPort));
  running=Boolean.TRUE;
}
Program: 112683
Project: 112683
Buggy source:
@Override public Void call(JavaRDD<StratioStreamingMessage> rdd) throws Exception {
  for (  StratioStreamingMessage message : rdd.collect()) {
    try {
      if (validOperation(message)) {
        boolean defaultResponse=false;
        if (getStartOperationCommand() != null && getStartOperationCommand().equalsIgnoreCase(message.getOperation())) {
          defaultResponse=startAction(message);
        }
 else         if (getStopOperationCommand() != null && getStopOperationCommand().equalsIgnoreCase(message.getOperation())) {
          defaultResponse=stopAction(message);
        }
        if (defaultResponse) {
          ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.OK));
        }
      }
    }
 catch (    RequestValidationException e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(e.getCode(),e.getMessage()));
    }
catch (    Exception e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.KO_GENERAL_ERROR,e.getMessage()));
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call(JavaRDD<StratioStreamingMessage> rdd) throws Exception {
  for (  StratioStreamingMessage message : rdd.collect()) {
    try {
      boolean defaultResponse=false;
      if (getStartOperationCommand() != null && getStartOperationCommand().equalsIgnoreCase(message.getOperation())) {
        if (validOperation(message,startValidators)) {
          defaultResponse=startAction(message);
        }
      }
 else       if (getStopOperationCommand() != null && getStopOperationCommand().equalsIgnoreCase(message.getOperation())) {
        if (validOperation(message,stopValidators)) {
          defaultResponse=stopAction(message);
        }
      }
      if (defaultResponse) {
        ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.OK));
      }
    }
 catch (    RequestValidationException e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(e.getCode(),e.getMessage()));
    }
catch (    Exception e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.KO_GENERAL_ERROR,e.getMessage()));
    }
  }
  return null;
}
Program: 112684
Project: 112684
Buggy source:
private boolean validOperation(StratioStreamingMessage request) throws Exception {
  log.debug("String_Node_Str",request.getRequest_id(),request.getSession_id());
  for (  RequestValidation validation : validators) {
    try {
      validation.validate(request);
    }
 catch (    RequestValidationException e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(request,new ActionCallbackDto(e.getCode(),e.getMessage()));
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean validOperation(StratioStreamingMessage request,Set<RequestValidation> validators) throws Exception {
  log.debug("String_Node_Str",request.getRequest_id(),request.getSession_id());
  for (  RequestValidation validation : validators) {
    try {
      validation.validate(request);
    }
 catch (    RequestValidationException e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(request,new ActionCallbackDto(e.getCode(),e.getMessage()));
      return false;
    }
  }
  return true;
}
Program: 112685
Project: 112685
Buggy source:
public ActionBaseFunction(SiddhiManager siddhiManager,String zookeeperHost){
  this.validators=new HashSet<>();
  this.siddhiManager=siddhiManager;
  this.zookeeperHost=zookeeperHost;
  validators.add(new StreamAllowedValidation(getSiddhiManager()));
  addRequestsValidations(validators);
}

Fixed version (ground truth):
public ActionBaseFunction(SiddhiManager siddhiManager,String zookeeperHost){
  this.stopValidators=new HashSet<>();
  this.startValidators=new HashSet<>();
  this.siddhiManager=siddhiManager;
  this.zookeeperHost=zookeeperHost;
  startValidators.add(new StreamAllowedValidation(getSiddhiManager()));
  stopValidators.add(new StreamAllowedValidation(getSiddhiManager()));
  addStartRequestsValidations(startValidators);
  addStopRequestsValidations(stopValidators);
}
Program: 112686
Project: 112686
Buggy source:
@Override public Void call(JavaRDD<StratioStreamingMessage> rdd) throws Exception {
  for (  StratioStreamingMessage message : rdd.collect()) {
    try {
      if (validOperation(message)) {
        boolean defaultResponse=false;
        if (getStartOperationCommand() != null && getStartOperationCommand().equals(message.getOperation())) {
          defaultResponse=startAction(message);
        }
 else         if (getStopOperationCommand() != null && getStopOperationCommand().equals(message.getOperation())) {
          defaultResponse=stopAction(message);
        }
        if (defaultResponse) {
          ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.OK));
        }
      }
    }
 catch (    RequestValidationException e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(e.getCode(),e.getMessage()));
    }
catch (    Exception e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.KO_GENERAL_ERROR,e.getMessage()));
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call(JavaRDD<StratioStreamingMessage> rdd) throws Exception {
  for (  StratioStreamingMessage message : rdd.collect()) {
    try {
      if (validOperation(message)) {
        boolean defaultResponse=false;
        if (getStartOperationCommand() != null && getStartOperationCommand().equalsIgnoreCase(message.getOperation())) {
          defaultResponse=startAction(message);
        }
 else         if (getStopOperationCommand() != null && getStopOperationCommand().equalsIgnoreCase(message.getOperation())) {
          defaultResponse=stopAction(message);
        }
        if (defaultResponse) {
          ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.OK));
        }
      }
    }
 catch (    RequestValidationException e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(e.getCode(),e.getMessage()));
    }
catch (    Exception e) {
      log.error("String_Node_Str",e);
      ackStreamingOperation(message,new ActionCallbackDto(REPLY_CODES.KO_GENERAL_ERROR,e.getMessage()));
    }
  }
  return null;
}
Program: 112687
Project: 112687
Buggy source:
public HearthTreeNode heroAbilityUsedEvent(PlayerSide thisMinionPlayerSide,PlayerSide heroAbilityUsedSide,Minion heroAbilityTargetCharacter,HearthTreeNode boardState){
  EffectCharacter<T> effect=this.getInspireEffect();
  FilterCharacterInterface filter=this.getInspireFilter();
  HearthTreeNode toRet=boardState;
  ArrayList<BoardModel.MinionPlayerPair> minions=new ArrayList<>();
  for (  BoardModel.MinionPlayerPair mp : toRet.data_.getAllMinionsFIFOList()) {
    minions.add(mp);
  }
  for (  BoardModel.MinionPlayerPair mp : minions) {
    if (mp.getPlayerSide() == PlayerSide.CURRENT_PLAYER && filter.targetMatches(thisMinionPlayerSide,this,mp.getPlayerSide(),mp.getMinion(),boardState.data_)) {
      toRet=effect.applyEffect(mp.getPlayerSide(),mp.getMinion(),toRet);
    }
  }
  if (filter.targetMatches(thisMinionPlayerSide,this,PlayerSide.CURRENT_PLAYER,toRet.data_.getCharacter(PlayerSide.CURRENT_PLAYER,CharacterIndex.HERO),boardState.data_)) {
    toRet=effect.applyEffect(PlayerSide.CURRENT_PLAYER,toRet.data_.getCharacter(PlayerSide.CURRENT_PLAYER,CharacterIndex.HERO),toRet);
  }
  return toRet;
}

Fixed version (ground truth):
public HearthTreeNode heroAbilityUsedEvent(PlayerSide thisMinionPlayerSide,PlayerSide heroAbilityUsedSide,Minion heroAbilityTargetCharacter,HearthTreeNode boardState){
  EffectCharacter<T> effect=this.getInspireEffect();
  FilterCharacterInterface filter=this.getInspireFilter();
  HearthTreeNode toRet=boardState;
  ArrayList<BoardModel.MinionPlayerPair> minions=new ArrayList<>();
  for (  BoardModel.MinionPlayerPair mp : toRet.data_.getAllMinionsFIFOList()) {
    minions.add(mp);
  }
  for (  BoardModel.MinionPlayerPair mp : minions) {
    if (mp.getPlayerSide() == PlayerSide.CURRENT_PLAYER && filter.targetMatches(thisMinionPlayerSide,this,mp.getPlayerSide(),mp.getMinion(),boardState.data_)) {
      HearthTreeNode tempNode=effect.applyEffect(mp.getPlayerSide(),mp.getMinion(),toRet);
      if (tempNode != null)       toRet=tempNode;
    }
  }
  if (filter.targetMatches(thisMinionPlayerSide,this,PlayerSide.CURRENT_PLAYER,toRet.data_.getCharacter(PlayerSide.CURRENT_PLAYER,CharacterIndex.HERO),boardState.data_)) {
    toRet=effect.applyEffect(PlayerSide.CURRENT_PLAYER,toRet.data_.getCharacter(PlayerSide.CURRENT_PLAYER,CharacterIndex.HERO),toRet);
  }
  return toRet;
}
Program: 112688
Project: 112688
Buggy source:
@Override public int hashCode(){
  int result=super.hashCode();
  result=31 * result + (taunt_ ? 1 : 0);
  result=31 * result + (divineShield_ ? 1 : 0);
  result=31 * result + (windFury_ ? 1 : 0);
  result=31 * result + (charge_ ? 1 : 0);
  result=31 * result + (hasAttacked_ ? 1 : 0);
  result=31 * result + (hasWindFuryAttacked_ ? 1 : 0);
  result=31 * result + (frozen_ ? 1 : 0);
  result=31 * result + (silenced_ ? 1 : 0);
  result=31 * result + (stealthedUntilRevealed ? 1 : 0);
  result=31 * result + (stealthedUntilNextTurn ? 1 : 0);
  result=31 * result + (heroTargetable_ ? 1 : 0);
  result=31 * result + health_;
  result=31 * result + maxHealth_;
  result=31 * result + this.getBaseHealth();
  result=31 * result + auraHealth_;
  result=31 * result + attack_;
  result=31 * result + this.getBaseAttack();
  result=31 * result + extraAttackUntilTurnEnd_;
  result=31 * result + auraAttack_;
  result=31 * result + (destroyOnTurnStart_ ? 1 : 0);
  result=31 * result + (destroyOnTurnEnd_ ? 1 : 0);
  result=31 * result + spellDamage_;
  result=31 * result + (deathrattleAction_ != null ? deathrattleAction_.hashCode() : 0);
  result=31 * result + (this.getPlacementImportant() ? 1 : 0);
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=super.hashCode();
  result=31 * result + (taunt_ ? 1 : 0);
  result=31 * result + (divineShield_ ? 1 : 0);
  result=31 * result + (windFury_ ? 1 : 0);
  result=31 * result + (charge_ ? 1 : 0);
  result=31 * result + (hasAttacked_ ? 1 : 0);
  result=31 * result + (hasWindFuryAttacked_ ? 1 : 0);
  result=31 * result + (frozen_ ? 1 : 0);
  result=31 * result + (silenced_ ? 1 : 0);
  result=31 * result + (stealthedUntilRevealed ? 1 : 0);
  result=31 * result + (stealthedUntilNextTurn ? 1 : 0);
  result=31 * result + (heroTargetable_ ? 1 : 0);
  result=31 * result + health_;
  result=31 * result + maxHealth_;
  result=31 * result + this.getBaseHealth();
  result=31 * result + auraHealth_;
  result=31 * result + attack_;
  result=31 * result + this.getBaseAttack();
  result=31 * result + extraAttackUntilTurnEnd_;
  result=31 * result + auraAttack_;
  result=31 * result + (destroyOnTurnStart_ ? 1 : 0);
  result=31 * result + (destroyOnTurnEnd_ ? 1 : 0);
  result=31 * result + spellDamage_;
  result=31 * result + (immune_ ? 1 : 0);
  result=31 * result + (cantAttack ? 1 : 0);
  result=31 * result + (deathrattleAction_ != null ? deathrattleAction_.hashCode() : 0);
  result=31 * result + (this.getPlacementImportant() ? 1 : 0);
  return result;
}
Program: 112689
Project: 112689
Buggy source:
/** 
 * Deep copy of the object Note: the event actions are not actually deep copied.
 */
@Override public Card deepCopy(){
  Minion minion=(Minion)super.deepCopy();
  minion.attack_=attack_;
  minion.health_=health_;
  minion.extraAttackUntilTurnEnd_=extraAttackUntilTurnEnd_;
  minion.auraAttack_=auraAttack_;
  minion.maxHealth_=maxHealth_;
  minion.auraHealth_=auraHealth_;
  minion.spellDamage_=spellDamage_;
  minion.taunt_=taunt_;
  minion.divineShield_=divineShield_;
  minion.windFury_=windFury_;
  minion.charge_=charge_;
  minion.hasAttacked_=hasAttacked_;
  minion.hasWindFuryAttacked_=hasWindFuryAttacked_;
  minion.frozen_=frozen_;
  minion.silenced_=silenced_;
  minion.stealthedUntilRevealed=stealthedUntilRevealed;
  minion.stealthedUntilNextTurn=stealthedUntilNextTurn;
  minion.heroTargetable_=heroTargetable_;
  minion.destroyOnTurnStart_=destroyOnTurnStart_;
  minion.destroyOnTurnEnd_=destroyOnTurnEnd_;
  minion.deathrattleAction_=deathrattleAction_;
  minion.inHand=inHand;
  minion.hasBeenUsed=hasBeenUsed;
  return minion;
}

Fixed version (ground truth):
/** 
 * Deep copy of the object Note: the event actions are not actually deep copied.
 */
@Override public Card deepCopy(){
  Minion minion=(Minion)super.deepCopy();
  minion.attack_=attack_;
  minion.health_=health_;
  minion.extraAttackUntilTurnEnd_=extraAttackUntilTurnEnd_;
  minion.auraAttack_=auraAttack_;
  minion.maxHealth_=maxHealth_;
  minion.auraHealth_=auraHealth_;
  minion.spellDamage_=spellDamage_;
  minion.taunt_=taunt_;
  minion.divineShield_=divineShield_;
  minion.windFury_=windFury_;
  minion.charge_=charge_;
  minion.hasAttacked_=hasAttacked_;
  minion.hasWindFuryAttacked_=hasWindFuryAttacked_;
  minion.frozen_=frozen_;
  minion.silenced_=silenced_;
  minion.stealthedUntilRevealed=stealthedUntilRevealed;
  minion.stealthedUntilNextTurn=stealthedUntilNextTurn;
  minion.heroTargetable_=heroTargetable_;
  minion.destroyOnTurnStart_=destroyOnTurnStart_;
  minion.destroyOnTurnEnd_=destroyOnTurnEnd_;
  minion.deathrattleAction_=deathrattleAction_;
  minion.immune_=immune_;
  minion.cantAttack=cantAttack;
  minion.inHand=inHand;
  minion.hasBeenUsed=hasBeenUsed;
  return minion;
}
Program: 112691
Project: 112691
Buggy source:
@Override public int hashCode(){
  int result=this.getName() != null ? this.getName().hashCode() : 0;
  result=31 * result + this.getBaseManaCost();
  result=31 * result + (hasBeenUsed ? 1 : 0);
  result=31 * result + (inHand ? 1 : 0);
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=this.getName() != null ? this.getName().hashCode() : 0;
  result=31 * result + this.getBaseManaCost();
  result=31 * result + (hasBeenUsed ? 1 : 0);
  result=31 * result + (inHand ? 1 : 0);
  result=31 * result + (deathrattleTriggered ? 1 : 0);
  return result;
}
Program: 112692
Project: 112692
Buggy source:
@Override public Card deepCopy(){
  Card copy=null;
  try {
    copy=getClass().newInstance();
  }
 catch (  InstantiationException e) {
    Card.log.error("String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    Card.log.error("String_Node_Str",e);
  }
  if (copy == null) {
    throw new RuntimeException("String_Node_Str");
  }
  copy.hasBeenUsed=this.hasBeenUsed;
  copy.inHand=this.inHand;
  copy.manaDelta=this.manaDelta;
  return copy;
}

Fixed version (ground truth):
@Override public Card deepCopy(){
  Card copy=null;
  try {
    copy=getClass().newInstance();
  }
 catch (  InstantiationException e) {
    Card.log.error("String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    Card.log.error("String_Node_Str",e);
  }
  if (copy == null) {
    throw new RuntimeException("String_Node_Str");
  }
  copy.hasBeenUsed=this.hasBeenUsed;
  copy.inHand=this.inHand;
  copy.manaDelta=this.manaDelta;
  copy.deathrattleTriggered=deathrattleTriggered;
  return copy;
}
Program: 112693
Project: 112693
Buggy source:
@Override public boolean equals(Object other){
  if (other == null) {
    return false;
  }
  if (this.getClass() != other.getClass()) {
    return false;
  }
  if (this.getManaDelta() != ((Card)other).getManaDelta())   return false;
  if (this.getBaseManaCost() != ((Card)other).getBaseManaCost())   return false;
  if (hasBeenUsed != ((Card)other).hasBeenUsed)   return false;
  if (inHand != ((Card)other).inHand)   return false;
  if (this.getName() == null) {
    if (((Card)other).getName() != null) {
      return false;
    }
  }
 else   if (!this.getName().equals(((Card)other).getName())) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  if (other == null) {
    return false;
  }
  if (this.getClass() != other.getClass()) {
    return false;
  }
  if (this.getManaDelta() != ((Card)other).getManaDelta())   return false;
  if (this.getBaseManaCost() != ((Card)other).getBaseManaCost())   return false;
  if (hasBeenUsed != ((Card)other).hasBeenUsed)   return false;
  if (inHand != ((Card)other).inHand)   return false;
  if (deathrattleTriggered != ((Card)other).deathrattleTriggered)   return false;
  if (this.getName() == null) {
    if (((Card)other).getName() != null) {
      return false;
    }
  }
 else   if (!this.getName().equals(((Card)other).getName())) {
    return false;
  }
  return true;
}
Program: 112694
Project: 112694
Buggy source:
protected void initFromImplementedCard(ImplementedCardList.ImplementedCard implementedCard){
  this.hasBeenUsed=false;
  this.inHand=true;
}

Fixed version (ground truth):
protected void initFromImplementedCard(ImplementedCardList.ImplementedCard implementedCard){
  this.hasBeenUsed=false;
  this.inHand=true;
  this.deathrattleTriggered=false;
}
Program: 112695
Project: 112695
Buggy source:
/** 
 * Battlecry: Destroy your opponent's weapon
 */
@Override public EffectCharacter getBattlecryEffect(){
  return (originSide,origin,targetSide,targetCharacterIndex,boardState) -> {
    HearthTreeNode toRet=boardState;
    Hero theHero=toRet.data_.getCurrentPlayer().getHero();
    WeaponCard newWeapon=new BattleAxe();
    newWeapon.hasBeenUsed(true);
    DeathrattleAction action=theHero.setWeapon(newWeapon);
    if (action != null) {
      toRet=action.performAction(null,PlayerSide.CURRENT_PLAYER,toRet);
    }
    return toRet;
  }
;
}

Fixed version (ground truth):
@Override public EffectCharacter getBattlecryEffect(){
  return (originSide,origin,targetSide,targetCharacterIndex,boardState) -> {
    HearthTreeNode toRet=boardState;
    Hero theHero=toRet.data_.getCurrentPlayer().getHero();
    WeaponCard newWeapon=new BattleAxe();
    newWeapon.hasBeenUsed(true);
    DeathrattleAction action=theHero.setWeapon(newWeapon);
    if (action != null) {
      toRet=action.performAction(null,PlayerSide.CURRENT_PLAYER,toRet);
    }
    return toRet;
  }
;
}
Program: 112696
Project: 112696
Buggy source:
/** 
 * Called when this minion dies (destroyAndNotify) <p> Always use this function to "kill" minions
 * @param thisPlayerSide
 * @param boardState
 * @throws HSInvalidPlayerIndexException
 */
public HearthTreeNode destroyAndNotify(PlayerSide thisPlayerSide,HearthTreeNode boardState){
  health_=0;
  HearthTreeNode toRet=boardState;
  if (deathrattleAction_ != null) {
    toRet=deathrattleAction_.performAction(this,thisPlayerSide,toRet);
  }
  toRet=toRet.notifyMinionDead(thisPlayerSide,this);
  return toRet;
}

Fixed version (ground truth):
/** 
 * Called when this minion dies (destroyAndNotify) <p> Always use this function to "kill" minions
 * @param thisPlayerSide
 * @param boardState
 * @throws HSInvalidPlayerIndexException
 */
public HearthTreeNode destroyAndNotify(PlayerSide thisPlayerSide,HearthTreeNode boardState){
  health_=0;
  HearthTreeNode toRet=boardState;
  if (deathrattleAction_ != null) {
    toRet=deathrattleAction_.performAction(this,thisPlayerSide,toRet);
  }
  if (toRet != null)   toRet=toRet.notifyMinionDead(thisPlayerSide,this);
 else   return boardState;
  return toRet;
}
Program: 112697
Project: 112697
Buggy source:
/** 
 * Perform the action
 * @param origin      The minion that is performing the action (aka, the dying minion)
 * @param playerSide
 * @param boardState
 */
public HearthTreeNode performAction(T origin,PlayerSide playerSide,HearthTreeNode boardState){
  return boardState;
}

Fixed version (ground truth):
/** 
 * Perform the action
 * @param origin      The minion that is performing the action (aka, the dying minion)
 * @param playerSide
 * @param boardState
 */
public HearthTreeNode performAction(T origin,PlayerSide playerSide,HearthTreeNode boardState){
  if (origin == null)   return boardState;
  if (origin.isDeathrattleTriggered())   return null;
 else   origin.setDeathrattleTriggered(true);
  return boardState;
}
Program: 112698
Project: 112698
Buggy source:
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState){
  HearthTreeNode toRet=super.performAction(origin,playerSide,boardState);
  PlayerModel targetPlayer=toRet.data_.modelForSide(playerSide);
  PlayerSide targetPlayerSide=playerSide;
  if (sideToSummon == PlayerSide.WAITING_PLAYER) {
    targetPlayer=toRet.data_.modelForSide(playerSide.getOtherPlayer());
    targetPlayerSide=playerSide.getOtherPlayer();
  }
  CharacterIndex targetIndex=CharacterIndex.fromInteger(targetPlayer.getNumMinions());
  if (origin instanceof Minion && targetPlayerSide == playerSide) {
    targetIndex=targetPlayer.getIndexForCharacter((Minion)origin);
    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();
      if (sideToSummon == PlayerSide.WAITING_PLAYER)       toRet=newMinion.summonMinion(targetPlayerSide,targetIndex,toRet,false);
 else       toRet=newMinion.summonMinion(targetPlayerSide,targetIndex.indexToLeft(),toRet,false);
    }
 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){
  HearthTreeNode toRet=super.performAction(origin,playerSide,boardState);
  if (toRet == null)   return boardState;
  PlayerModel targetPlayer=toRet.data_.modelForSide(playerSide);
  PlayerSide targetPlayerSide=playerSide;
  if (sideToSummon == PlayerSide.WAITING_PLAYER) {
    targetPlayer=toRet.data_.modelForSide(playerSide.getOtherPlayer());
    targetPlayerSide=playerSide.getOtherPlayer();
  }
  CharacterIndex targetIndex=CharacterIndex.fromInteger(targetPlayer.getNumMinions());
  if (origin instanceof Minion && targetPlayerSide == playerSide) {
    targetIndex=targetPlayer.getIndexForCharacter((Minion)origin);
    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();
      if (sideToSummon == PlayerSide.WAITING_PLAYER)       toRet=newMinion.summonMinion(targetPlayerSide,targetIndex,toRet,false);
 else       toRet=newMinion.summonMinion(targetPlayerSide,targetIndex.indexToLeft(),toRet,false);
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return toRet;
}
Program: 112699
Project: 112699
Buggy source:
public void applyAurasToCardInHand(PlayerSide targetSide,Card target){
  Iterator<CharacterIndex.CharacterLocation> characterIterator=this.characterIterator();
  while (characterIterator.hasNext()) {
    CharacterIndex.CharacterLocation location=characterIterator.next();
    Minion character=this.getCharacter(location);
    if (character instanceof ActiveEffectHand) {
      ActiveEffectHand activeEffect=(ActiveEffectHand)character;
      if (activeEffect.isActive(location.getPlayerSide(),character,this)) {
        FilterHand filter=activeEffect.getActiveFilter();
        SimpleEffectHand effect=activeEffect.getActiveEffect();
        if (filter.targetMatches(location.getPlayerSide(),character,targetSide,target,this)) {
          effect.applyEffect(location.getPlayerSide(),character,targetSide,target,this);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void applyAurasToCardInHand(PlayerSide targetSide,Card target){
  if (target == null)   return;
  Iterator<CharacterIndex.CharacterLocation> characterIterator=this.characterIterator();
  while (characterIterator.hasNext()) {
    CharacterIndex.CharacterLocation location=characterIterator.next();
    Minion character=this.getCharacter(location);
    if (character instanceof ActiveEffectHand) {
      ActiveEffectHand activeEffect=(ActiveEffectHand)character;
      if (activeEffect.isActive(location.getPlayerSide(),character,this)) {
        FilterHand filter=activeEffect.getActiveFilter();
        SimpleEffectHand effect=activeEffect.getActiveEffect();
        if (filter.targetMatches(location.getPlayerSide(),character,targetSide,target,this)) {
          effect.applyEffect(location.getPlayerSide(),character,targetSide,target,this);
        }
      }
    }
  }
}
Program: 112700
Project: 112700
Buggy source:
@Override public HearthTreeNode minionSummonEvent(PlayerSide thisMinionPlayerSide,PlayerSide summonedMinionPlayerSide,Minion summonedMinion,HearthTreeNode boardState){
  if (!ShipsCannon.triggerFilter.targetMatches(thisMinionPlayerSide,this,summonedMinionPlayerSide,summonedMinion,boardState.data_)) {
    return boardState;
  }
  Collection<HearthTreeNode> rngChildren=this.effectRandomCharacterUsingFilter(ShipsCannon.effect,null,ShipsCannon.effectFilter,boardState);
  return this.createRngNodeWithChildren(boardState,rngChildren);
}

Fixed version (ground truth):
@Override public HearthTreeNode minionSummonEvent(PlayerSide thisMinionPlayerSide,PlayerSide summonedMinionPlayerSide,Minion summonedMinion,HearthTreeNode boardState){
  if (!ShipsCannon.triggerFilter.targetMatches(thisMinionPlayerSide,this,summonedMinionPlayerSide,summonedMinion,boardState.data_)) {
    return boardState;
  }
  Collection<HearthTreeNode> rngChildren=this.effectRandomCharacterUsingFilter(ShipsCannon.effect,null,ShipsCannon.effectFilter,summonedMinionPlayerSide,boardState);
  return this.createRngNodeWithChildren(boardState,rngChildren);
}
Program: 112701
Project: 112701
Buggy source:
/** 
 * Places a minion on the board via a summon effect This function is meant to be used when summoning minions through means other than a direct card usage.
 * @param targetSide
 * @param targetIndex The target character (can be a Hero). The new minion is always placed to the right of (higher index) the target minion. If the target minion is a hero, then it is placed at the left-most position.
 * @param boardState The BoardState before this card has performed its action. It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 * @throws HSException
 */
protected HearthTreeNode summonMinion_core(PlayerSide targetSide,CharacterIndex targetIndex,HearthTreeNode boardState){
  boardState.data_.placeMinion(targetSide,this,targetIndex);
  if (!charge_) {
    hasAttacked_=true;
  }
  hasBeenUsed=true;
  return boardState;
}

Fixed version (ground truth):
/** 
 * Places a minion on the board via a summon effect This function is meant to be used when summoning minions through means other than a direct card usage.
 * @param targetSide
 * @param targetIndex The target character (can be a Hero). The new minion is always placed to the right of (higher index) the target minion. If the target minion is a hero, then it is placed at the left-most position.
 * @param boardState The BoardState before this card has performed its action. It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 * @throws HSException
 */
protected HearthTreeNode summonMinion_core(PlayerSide targetSide,CharacterIndex targetIndex,HearthTreeNode boardState){
  if (boardState.data_.modelForSide(targetSide).getNumMinions() < targetIndex.getInt()) {
    targetIndex=CharacterIndex.fromInteger(boardState.data_.modelForSide(targetSide).getNumMinions());
  }
  boardState.data_.placeMinion(targetSide,this,targetIndex);
  if (!charge_) {
    hasAttacked_=true;
  }
  hasBeenUsed=true;
  return boardState;
}
Program: 112702
Project: 112702
Buggy source:
/** 
 * Use the card on the given target Summons either Huffer, Leokk, or Misha
 * @param side
 * @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 Collection<HearthTreeNode> createChildren(PlayerSide originSide,int originIndex,HearthTreeNode boardState){
  HearthTreeNode newState;
  ArrayList<HearthTreeNode> children=new ArrayList<>();
  for (  Minion minion : new Minion[]{new Huffer(),new Leokk(),new Misha()}) {
    newState=new HearthTreeNode(boardState.data_.deepCopy());
    newState.data_.modelForSide(originSide).getHand().remove(originIndex);
    newState=minion.summonMinionAtEnd(originSide,newState,false);
    children.add(newState);
  }
  return children;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target Summons either Huffer, Leokk, or Misha
 * @param originSide
 * @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 Collection<HearthTreeNode> createChildren(PlayerSide originSide,int originIndex,HearthTreeNode boardState){
  HearthTreeNode newState;
  ArrayList<HearthTreeNode> children=new ArrayList<>();
  for (  Minion minion : new Minion[]{new Huffer(),new Leokk(),new Misha()}) {
    newState=new HearthTreeNode(boardState.data_.deepCopy());
    newState.data_.modelForSide(originSide).getHand().remove(originIndex);
    newState=minion.summonMinionAtEnd(originSide,newState,false);
    if (newState != null)     children.add(newState);
  }
  return children;
}
Program: 112703
Project: 112703
Buggy source:
@Override public HearthTreeNode applyEffect(PlayerSide targetSide,HearthTreeNode boardState){
  if (boardState.data_.modelForSide(targetSide).isHandFull()) {
    return null;
  }
  try {
    Card newCard=this.cardClass.newInstance();
    boardState.data_.placeCardHand(targetSide,newCard);
  }
 catch (  InstantiationException|IllegalAccessException e) {
    logger.error("String_Node_Str",e);
  }
  return boardState;
}

Fixed version (ground truth):
@Override public HearthTreeNode applyEffect(PlayerSide targetSide,HearthTreeNode boardState){
  if (boardState.data_.modelForSide(targetSide).isHandFull()) {
    return boardState;
  }
  try {
    Card newCard=this.cardClass.newInstance();
    boardState.data_.placeCardHand(targetSide,newCard);
  }
 catch (  InstantiationException|IllegalAccessException e) {
    logger.error("String_Node_Str",e);
  }
  return boardState;
}
Program: 112704
Project: 112704
Buggy source:
@Override public HearthTreeNode applyEffect(PlayerSide originSide,Card origin,PlayerSide targetSide,HearthTreeNode boardState){
  WeaponCard newWeapon=this.weapon;
  if (origin == null) {
    newWeapon=weapon.deepCopy();
  }
  newWeapon.hasBeenUsed(true);
  DeathrattleAction weaponDeathrattle=boardState.data_.getCurrentPlayer().getHero().setWeapon(newWeapon);
  if (weaponDeathrattle != null) {
    boardState=weaponDeathrattle.performAction(origin,targetSide,boardState);
  }
  return boardState;
}

Fixed version (ground truth):
@Override public HearthTreeNode applyEffect(PlayerSide originSide,Card origin,PlayerSide targetSide,HearthTreeNode boardState){
  WeaponCard newWeapon=this.weapon;
  if (origin == null) {
    newWeapon=weapon.deepCopy();
  }
  newWeapon.hasBeenUsed(true);
  DeathrattleAction weaponDeathrattle=boardState.data_.getCurrentPlayer().getHero().setWeapon(newWeapon);
  if (weaponDeathrattle != null) {
    boardState=weaponDeathrattle.performAction(null,targetSide,boardState);
  }
  return boardState;
}
Program: 112705
Project: 112705
Buggy source:
/** 
 * Handles dead minions For each dead minion, the function calls its deathrattle in the correct order, and then removes the dead minions from the board.
 * @return true if there are dead minions left (minions might have died during deathrattle). false otherwise.
 * @throws HSException
 */
public static HearthTreeNode handleDeadMinions(HearthTreeNode boardState){
  HearthTreeNode toRet=boardState;
  IdentityLinkedList<BoardModel.MinionPlayerPair> deadMinions=new IdentityLinkedList<>();
  for (  BoardModel.MinionPlayerPair minionIdPair : toRet.data_.getAllMinionsFIFOList()) {
    if (minionIdPair.getMinion().getTotalHealth() <= 0) {
      deadMinions.add(minionIdPair);
    }
  }
  for (  BoardModel.MinionPlayerPair minionIdPair : deadMinions) {
    PlayerSide playerSide=minionIdPair.getPlayerSide();
    toRet=minionIdPair.getMinion().destroyAndNotify(playerSide,toRet);
    toRet.data_.removeMinion(minionIdPair);
  }
  if (toRet.data_.hasDeadMinions())   return BoardStateFactoryBase.handleDeadMinions(toRet);
 else   return toRet;
}

Fixed version (ground truth):
/** 
 * Handles dead minions For each dead minion, the function calls its deathrattle in the correct order, and then removes the dead minions from the board.
 * @return true if there are dead minions left (minions might have died during deathrattle). false otherwise.
 * @throws HSException
 */
public static HearthTreeNode handleDeadMinions(HearthTreeNode boardState){
  HearthTreeNode toRet=boardState;
  IdentityLinkedList<BoardModel.MinionPlayerPair> deadMinions=new IdentityLinkedList<>();
  for (  BoardModel.MinionPlayerPair minionIdPair : toRet.data_.getAllMinionsFIFOList()) {
    if (minionIdPair.getMinion().getTotalHealth() <= 0) {
      deadMinions.add(minionIdPair);
    }
  }
  for (  BoardModel.MinionPlayerPair minionIdPair : deadMinions) {
    PlayerSide playerSide=minionIdPair.getPlayerSide();
    toRet=minionIdPair.getMinion().destroyAndNotify(playerSide,toRet);
  }
  for (  BoardModel.MinionPlayerPair minionIdPair : deadMinions) {
    toRet.data_.removeMinion(minionIdPair);
  }
  if (toRet.data_.hasDeadMinions())   return BoardStateFactoryBase.handleDeadMinions(toRet);
 else   return toRet;
}
Program: 112706
Project: 112706
Buggy source:
/** 
 * Called at the start of the turn <p> This function is called at the start of the turn. Any derived class must override it to implement whatever "start of the turn" effect the card has.
 */
@Override public HearthTreeNode startTurn(PlayerSide thisMinionPlayerIndex,HearthTreeNode boardModel) throws HSException {
  if (destroyOnTurnStart_) {
    this.setHealth((byte)-99);
  }
  if (stealthedUntilNextTurn)   this.setStealthedUntilNextTurn(false);
  return boardModel;
}

Fixed version (ground truth):
/** 
 * Called at the start of the turn <p> This function is called at the start of the turn. Any derived class must override it to implement whatever "start of the turn" effect the card has.
 */
@Override public HearthTreeNode startTurn(PlayerSide thisMinionPlayerIndex,HearthTreeNode boardModel) throws HSException {
  if (destroyOnTurnStart_) {
    this.setHealth((byte)-99);
  }
  if (stealthedUntilNextTurn && thisMinionPlayerIndex == PlayerSide.CURRENT_PLAYER)   this.setStealthedUntilNextTurn(false);
  return boardModel;
}
Program: 112707
Project: 112707
Buggy source:
protected HearthTreeNode createNodeWithChildren(HearthTreeNode boardState,Collection<HearthTreeNode> children){
  if (children != null) {
    if (children.size() == 1) {
      boardState=children.stream().findAny().get();
    }
 else     if (children.size() > 1) {
      boardState.addChildren(children);
    }
  }
  return boardState;
}

Fixed version (ground truth):
protected HearthTreeNode createNodeWithChildren(HearthTreeNode boardState,Collection<HearthTreeNode> children){
  if (children != null) {
    boardState.addChildren(children);
  }
  return boardState;
}
Program: 112708
Project: 112708
Buggy source:
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState){
  HearthTreeNode toRet=super.performAction(origin,playerSide,boardState);
  if (playerSide == PlayerSide.CURRENT_PLAYER) {
    if (toRet instanceof CardDrawNode) {
      ((CardDrawNode)toRet).addNumCardsToDraw(numCards_);
    }
 else {
      toRet=new CardDrawNode(toRet,numCards_);
    }
  }
 else {
    toRet.data_.drawCardFromWaitingPlayerDeck(numCards_);
  }
  return toRet;
}

Fixed version (ground truth):
@Override public HearthTreeNode performAction(Card origin,PlayerSide playerSide,HearthTreeNode boardState){
  HearthTreeNode toRet=super.performAction(origin,playerSide,boardState);
  if (toRet == null)   return null;
  if (playerSide == PlayerSide.CURRENT_PLAYER) {
    if (toRet instanceof CardDrawNode) {
      ((CardDrawNode)toRet).addNumCardsToDraw(numCards_);
    }
 else {
      toRet=new CardDrawNode(toRet,numCards_);
    }
  }
 else {
    toRet.data_.drawCardFromWaitingPlayerDeck(numCards_);
  }
  return toRet;
}
Program: 112709
Project: 112709
Buggy source:
/** 
 * Use the card on the given target Transform a minion into 1/1 sheep
 * @param side
 * @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 EffectCharacter getTargetableEffect(){
  if (this.effect == null) {
    this.effect=(originSide,origin,targetSide,targetCharacterIndex,boardState) -> {
      Sheep sheep=new Sheep();
      boardState.data_.removeMinion(targetSide,targetCharacterIndex);
      boardState.data_.placeMinion(targetSide,sheep,targetCharacterIndex);
      return boardState;
    }
;
  }
  return this.effect;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target Transform a minion into 1/1 sheep
 * @param side
 * @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 EffectCharacter getTargetableEffect(){
  if (this.effect == null) {
    this.effect=(originSide,origin,targetSide,targetCharacterIndex,boardState) -> {
      Sheep sheep=new Sheep();
      boardState.data_.removeMinion(targetSide,targetCharacterIndex);
      boardState.data_.placeMinion(targetSide,sheep,targetCharacterIndex.indexToLeft());
      return boardState;
    }
;
  }
  return this.effect;
}
Program: 112710
Project: 112710
Buggy source:
@Override public HearthTreeNode minionSummonEvent(PlayerSide thisMinionPlayerSide,PlayerSide summonedMinionPlayerSide,Minion summonedMinion,HearthTreeNode boardState){
  if (!KnifeJuggler.triggerFilter.targetMatches(thisMinionPlayerSide,this,summonedMinionPlayerSide,summonedMinion,boardState.data_)) {
    return boardState;
  }
  Collection<HearthTreeNode> rngChildren=this.effectRandomCharacterUsingFilter(KnifeJuggler.effect,null,KnifeJuggler.effectFilter,boardState);
  return this.createRngNodeWithChildren(boardState,rngChildren);
}

Fixed version (ground truth):
@Override public HearthTreeNode minionSummonEvent(PlayerSide thisMinionPlayerSide,PlayerSide summonedMinionPlayerSide,Minion summonedMinion,HearthTreeNode boardState){
  if (!KnifeJuggler.triggerFilter.targetMatches(thisMinionPlayerSide,this,summonedMinionPlayerSide,summonedMinion,boardState.data_)) {
    return boardState;
  }
  Collection<HearthTreeNode> rngChildren=this.effectRandomCharacterUsingFilter(KnifeJuggler.effect,null,KnifeJuggler.effectFilter,thisMinionPlayerSide,boardState);
  return this.createRngNodeWithChildren(boardState,rngChildren);
}