nus-yam/ex-repair huggingface dataset:
Program: 159543
Project: 159543
Buggy source:
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (super.applies(event,source,game) && event instanceof DamageEvent) {
    Permanent targetPermanent=game.getPermanent(getTargetPointer().getFirst(game,source));
    if (event.getSourceId().equals(targetPermanent.getId()) || event.getTargetId().equals(targetPermanent.getId())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (super.applies(event,source,game) && event instanceof DamageEvent) {
    Permanent targetPermanent=game.getPermanent(this.getTargetPointer().getFirst(game,source));
    if (targetPermanent != null && (event.getSourceId().equals(targetPermanent.getId()) || event.getTargetId().equals(targetPermanent.getId()))) {
      return true;
    }
  }
  return false;
}
Program: 159545
Project: 159545
Buggy source:
protected SpellsCostReductionEffect(SpellsCostReductionEffect effect){
  super(effect);
  this.filter=effect.filter;
  this.amount=effect.amount;
}

Fixed version (ground truth):
protected SpellsCostReductionEffect(SpellsCostReductionEffect effect){
  super(effect);
  this.filter=effect.filter;
  this.amount=effect.amount;
  this.manaCostsToReduce=effect.manaCostsToReduce;
}
Program: 159546
Project: 159546
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Card card=game.getCard(source.getFirstTarget());
  if (card != null) {
    EmptyToken token=new EmptyToken();
    CardUtil.copyTo(token).from(card);
    if (!token.getCardType().contains(CardType.ENCHANTMENT)) {
      token.getCardType().add(CardType.ENCHANTMENT);
    }
    token.addAbility(HasteAbility.getInstance());
    token.putOntoBattlefield(1,game,source.getSourceId(),source.getControllerId());
    ExileTargetEffect exileEffect=new ExileTargetEffect();
    exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
    DelayedTriggeredAbility delayedAbility=new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
    delayedAbility.setSourceId(source.getSourceId());
    delayedAbility.setControllerId(source.getControllerId());
    game.addDelayedTriggeredAbility(delayedAbility);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=game.getPermanent(source.getFirstTarget());
  if (permanent == null) {
    permanent=(Permanent)game.getLastKnownInformation(source.getFirstTarget(),Zone.BATTLEFIELD);
  }
  if (permanent != null) {
    EmptyToken token=new EmptyToken();
    CardUtil.copyTo(token).from(permanent);
    if (!token.getCardType().contains(CardType.ENCHANTMENT)) {
      token.getCardType().add(CardType.ENCHANTMENT);
    }
    token.addAbility(HasteAbility.getInstance());
    token.putOntoBattlefield(1,game,source.getSourceId(),source.getControllerId());
    ExileTargetEffect exileEffect=new ExileTargetEffect();
    exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
    DelayedTriggeredAbility delayedAbility=new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
    delayedAbility.setSourceId(source.getSourceId());
    delayedAbility.setControllerId(source.getControllerId());
    game.addDelayedTriggeredAbility(delayedAbility);
    return true;
  }
  return false;
}
Program: 159547
Project: 159547
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  MageObject mageObject=game.getObject(source.getSourceId());
  if (player != null && mageObject != null) {
    String message=new StringBuilder(getCostText()).append("String_Node_Str").append(executingEffect.getText(source.getModes().getMode())).append("String_Node_Str").toString();
    message=CardUtil.replaceSourceName(message,mageObject.getName());
    if (player.chooseUse(executingEffect.getOutcome(),message,game)) {
      cost.clearPaid();
      if (cost.pay(source,game,source.getSourceId(),source.getControllerId(),false)) {
        executingEffect.setTargetPointer(this.targetPointer);
        return executingEffect.apply(game,source);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  MageObject mageObject=game.getObject(source.getSourceId());
  if (player != null && mageObject != null) {
    String message;
    if (chooseUseText == null) {
      message=new StringBuilder(getCostText()).append("String_Node_Str").append(executingEffect.getText(source.getModes().getMode())).append("String_Node_Str").toString();
    }
 else {
      message=chooseUseText;
    }
    message=CardUtil.replaceSourceName(message,mageObject.getName());
    if (player.chooseUse(executingEffect.getOutcome(),message,game)) {
      cost.clearPaid();
      if (cost.pay(source,game,source.getSourceId(),source.getControllerId(),false)) {
        executingEffect.setTargetPointer(this.targetPointer);
        return executingEffect.apply(game,source);
      }
    }
    return true;
  }
  return false;
}
Program: 159548
Project: 159548
Buggy source:
public DoIfCostPaid(final DoIfCostPaid effect){
  super(effect);
  this.executingEffect=(OneShotEffect)effect.executingEffect.copy();
  this.cost=effect.cost.copy();
}

Fixed version (ground truth):
public DoIfCostPaid(final DoIfCostPaid effect){
  super(effect);
  this.executingEffect=(OneShotEffect)effect.executingEffect.copy();
  this.cost=effect.cost.copy();
  this.chooseUseText=effect.chooseUseText;
}
Program: 159549
Project: 159549
Buggy source:
private void copyFromToken(Token token,Game game){
  this.name=token.getName();
  this.abilities.clear();
  for (  Ability ability : token.getAbilities()) {
    this.addAbility(ability,game);
  }
  this.manaCost.clear();
  for (  ManaCost cost : token.getManaCost()) {
    this.getManaCost().add(cost.copy());
  }
  this.cardType=token.getCardType();
  this.color=token.getColor();
  this.power=token.getPower();
  this.toughness=token.getToughness();
  this.subtype=token.getSubtype();
}

Fixed version (ground truth):
private void copyFromToken(Token token,Game game){
  this.name=token.getName();
  this.abilities.clear();
  for (  Ability ability : token.getAbilities()) {
    this.addAbility(ability,game);
  }
  this.manaCost.clear();
  for (  ManaCost cost : token.getManaCost()) {
    this.getManaCost().add(cost.copy());
  }
  this.cardType.addAll(token.getCardType());
  this.color=token.getColor().copy();
  this.power.initValue(token.getPower().getValue());
  this.toughness.initValue(token.getToughness().getValue());
  this.supertype.addAll(token.getSupertype());
  this.subtype.addAll(token.getSubtype());
}
Program: 159550
Project: 159550
Buggy source:
public boolean putOntoBattlefield(int amount,Game game,UUID sourceId,UUID controllerId,boolean tapped,boolean attacking){
  Card source=game.getCard(sourceId);
  String setCode=source != null ? source.getExpansionSetCode() : null;
  GameEvent event=GameEvent.getEvent(EventType.CREATE_TOKEN,null,sourceId,controllerId,amount);
  if (!game.replaceEvent(event)) {
    amount=event.getAmount();
    for (int i=0; i < amount; i++) {
      PermanentToken newToken=new PermanentToken(this,controllerId,setCode,game);
      game.getState().addCard(newToken);
      game.addPermanent(newToken);
      if (tapped) {
        newToken.setTapped(true);
      }
      this.lastAddedTokenId=newToken.getId();
      game.setScopeRelevant(true);
      game.applyEffects();
      newToken.entersBattlefield(sourceId,game,Zone.OUTSIDE,true);
      game.setScopeRelevant(false);
      game.applyEffects();
      game.fireEvent(new ZoneChangeEvent(newToken,controllerId,Zone.OUTSIDE,Zone.BATTLEFIELD));
      if (attacking && game.getCombat() != null) {
        game.getCombat().addAttackingCreature(newToken.getId(),game);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean putOntoBattlefield(int amount,Game game,UUID sourceId,UUID controllerId,boolean tapped,boolean attacking){
  Card source=game.getCard(sourceId);
  String setCode;
  if (this.getOriginalExpansionSetCode() != null && !this.getOriginalExpansionSetCode().isEmpty()) {
    setCode=this.getOriginalExpansionSetCode();
  }
 else {
    setCode=source != null ? source.getExpansionSetCode() : null;
  }
  GameEvent event=GameEvent.getEvent(EventType.CREATE_TOKEN,null,sourceId,controllerId,amount);
  if (!game.replaceEvent(event)) {
    amount=event.getAmount();
    for (int i=0; i < amount; i++) {
      PermanentToken newToken=new PermanentToken(this,controllerId,setCode,game);
      game.getState().addCard(newToken);
      game.addPermanent(newToken);
      if (tapped) {
        newToken.setTapped(true);
      }
      this.lastAddedTokenId=newToken.getId();
      game.setScopeRelevant(true);
      game.applyEffects();
      newToken.entersBattlefield(sourceId,game,Zone.OUTSIDE,true);
      game.setScopeRelevant(false);
      game.applyEffects();
      game.fireEvent(new ZoneChangeEvent(newToken,controllerId,Zone.OUTSIDE,Zone.BATTLEFIELD));
      if (attacking && game.getCombat() != null) {
        game.getCombat().addAttackingCreature(newToken.getId(),game);
      }
    }
    return true;
  }
  return false;
}
Program: 159551
Project: 159551
Buggy source:
/** 
 * Display message in the chat. Use different colors for timestamp, username and message.
 * @param username message sender
 * @param message message itself
 * @param time timestamp
 * @param color Preferred color. Not used.
 */
public void receiveMessage(String username,String message,String time,MessageType messageType,MessageColor color){
  if (time != null) {
    this.txtConversation.append(TIMESTAMP_COLOR,time + "String_Node_Str");
  }
  Color userColor;
  Color textColor;
  String userSeparator="String_Node_Str";
switch (messageType) {
case STATUS:
    textColor=STATUS_COLOR;
  userColor=STATUS_COLOR;
break;
case USER_INFO:
textColor=USER_INFO_COLOR;
userColor=USER_INFO_COLOR;
break;
default :
if (parentChatRef != null) {
userColor=parentChatRef.session.getUserName().equals(username) ? MY_COLOR : OPPONENT_COLOR;
}
 else {
userColor=session.getUserName().equals(username) ? MY_COLOR : OPPONENT_COLOR;
}
textColor=MESSAGE_COLOR;
userSeparator="String_Node_Str";
}
if (color.equals(MessageColor.ORANGE)) {
textColor=Color.ORANGE;
}
if (color.equals(MessageColor.YELLOW)) {
textColor=Color.YELLOW;
}
if (username != null && !username.isEmpty()) {
this.txtConversation.append(userColor,username);
this.txtConversation.append(userColor,userSeparator);
}
this.txtConversation.append(textColor,message + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Display message in the chat. Use different colors for timestamp, username and message.
 * @param username message sender
 * @param message message itself
 * @param time timestamp
 * @param messageType
 * @param color Preferred color. Not used.
 */
public void receiveMessage(String username,String message,String time,MessageType messageType,MessageColor color){
  if (time != null) {
    this.txtConversation.append(TIMESTAMP_COLOR,time + "String_Node_Str");
  }
  Color userColor;
  Color textColor;
  String userSeparator="String_Node_Str";
switch (messageType) {
case STATUS:
    textColor=STATUS_COLOR;
  userColor=STATUS_COLOR;
break;
case USER_INFO:
textColor=USER_INFO_COLOR;
userColor=USER_INFO_COLOR;
break;
default :
if (parentChatRef != null) {
userColor=parentChatRef.session.getUserName().equals(username) ? MY_COLOR : OPPONENT_COLOR;
}
 else {
userColor=session.getUserName().equals(username) ? MY_COLOR : OPPONENT_COLOR;
}
textColor=MESSAGE_COLOR;
userSeparator="String_Node_Str";
}
if (color.equals(MessageColor.ORANGE)) {
textColor=Color.ORANGE;
}
if (color.equals(MessageColor.YELLOW)) {
textColor=Color.YELLOW;
}
if (username != null && !username.isEmpty()) {
this.txtConversation.append(userColor,username);
this.txtConversation.append(userColor,userSeparator);
}
this.txtConversation.append(textColor,message + "String_Node_Str");
}
Program: 159552
Project: 159552
Buggy source:
public void broadcast(String userName,String message,MessageColor color,boolean withTime,MessageType messageType,SoundToPlay soundToPlay){
  if (!message.isEmpty()) {
    final String msg=message;
    final String time=(withTime ? timeFormatter.format(cal.getTime()) : "String_Node_Str");
    final String username=userName;
    logger.debug("String_Node_Str" + msg + "String_Node_Str"+ chatId);
    for (    UUID userId : clients.keySet()) {
      User user=UserManager.getInstance().getUser(userId);
      if (user != null) {
        user.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(username,msg,time,color,messageType,soundToPlay)));
      }
 else {
        kill(userId,User.DisconnectReason.CleaningUp);
      }
    }
  }
}

Fixed version (ground truth):
public void broadcast(String userName,String message,MessageColor color,boolean withTime,MessageType messageType,SoundToPlay soundToPlay){
  if (!message.isEmpty()) {
    final String msg=message;
    final String time=(withTime ? timeFormatter.format(new Date()) : "String_Node_Str");
    final String username=userName;
    logger.debug("String_Node_Str" + msg + "String_Node_Str"+ chatId);
    for (    UUID userId : clients.keySet()) {
      User user=UserManager.getInstance().getUser(userId);
      if (user != null) {
        user.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(username,msg,time,color,messageType,soundToPlay)));
      }
 else {
        kill(userId,User.DisconnectReason.CleaningUp);
      }
    }
  }
}
Program: 159553
Project: 159553
Buggy source:
public boolean broadcastWhisperToUser(User fromUser,User toUser,String message){
  if (clients.containsKey(toUser.getId())) {
    toUser.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(new StringBuilder("String_Node_Str").append(fromUser.getName()).toString(),message,timeFormatter.format(cal.getTime()),MessageColor.YELLOW,MessageType.WHISPER,SoundToPlay.PlayerWhispered)));
    if (clients.containsKey(fromUser.getId())) {
      fromUser.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(new StringBuilder("String_Node_Str").append(toUser.getName()).toString(),message,timeFormatter.format(cal.getTime()),MessageColor.YELLOW,MessageType.WHISPER,null)));
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean broadcastWhisperToUser(User fromUser,User toUser,String message){
  if (clients.containsKey(toUser.getId())) {
    toUser.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(new StringBuilder("String_Node_Str").append(fromUser.getName()).toString(),message,timeFormatter.format(new Date()),MessageColor.YELLOW,MessageType.WHISPER,SoundToPlay.PlayerWhispered)));
    if (clients.containsKey(fromUser.getId())) {
      fromUser.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(new StringBuilder("String_Node_Str").append(toUser.getName()).toString(),message,timeFormatter.format(new Date()),MessageColor.YELLOW,MessageType.WHISPER,null)));
      return true;
    }
  }
  return false;
}
Program: 159554
Project: 159554
Buggy source:
public boolean broadcastInfoToUser(User toUser,String message){
  if (clients.containsKey(toUser.getId())) {
    toUser.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(null,message,timeFormatter.format(cal.getTime()),MessageColor.ORANGE,MessageType.USER_INFO,null)));
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean broadcastInfoToUser(User toUser,String message){
  if (clients.containsKey(toUser.getId())) {
    toUser.fireCallback(new ClientCallback("String_Node_Str",chatId,new ChatMessage(null,message,timeFormatter.format(new Date()),MessageColor.ORANGE,MessageType.USER_INFO,null)));
    return true;
  }
  return false;
}
Program: 159555
Project: 159555
Buggy source:
@Override public boolean apply(Game game,Ability source){
  return !(Boolean)game.getState().getValue(new StringBuilder("String_Node_Str").append(source.getSourceId()).toString());
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Object tribute=game.getState().getValue(new StringBuilder("String_Node_Str").append(source.getSourceId()).toString());
  if (tribute != null) {
    return ((String)tribute).equals("String_Node_Str");
  }
  return false;
}
Program: 159556
Project: 159556
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (controller != null && sourcePermanent != null) {
    UUID opponentId;
    if (game.getOpponents(controller.getId()).size() == 1) {
      opponentId=game.getOpponents(controller.getId()).iterator().next();
    }
 else {
      Target target=new TargetOpponent(true);
      controller.choose(outcome,target,source.getSourceId(),game);
      opponentId=target.getFirstTarget();
    }
    if (opponentId != null) {
      Player opponent=game.getPlayer(opponentId);
      if (opponent != null) {
        StringBuilder sb=new StringBuilder("String_Node_Str");
        sb.append(sourcePermanent.getName());
        sb.append("String_Node_Str").append(tributeValue).append("String_Node_Str");
        if (opponent.chooseUse(outcome,sb.toString(),game)) {
          sourcePermanent.addCounters(CounterType.P1P1.createInstance(tributeValue),game);
          game.getState().setValue(new StringBuilder("String_Node_Str").append(source.getSourceId()).toString(),Boolean.TRUE);
        }
 else {
          game.getState().setValue(new StringBuilder("String_Node_Str").append(source.getSourceId()).toString(),Boolean.FALSE);
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (controller != null && sourcePermanent != null) {
    UUID opponentId;
    if (game.getOpponents(controller.getId()).size() == 1) {
      opponentId=game.getOpponents(controller.getId()).iterator().next();
    }
 else {
      Target target=new TargetOpponent(true);
      controller.choose(outcome,target,source.getSourceId(),game);
      opponentId=target.getFirstTarget();
    }
    if (opponentId != null) {
      Player opponent=game.getPlayer(opponentId);
      if (opponent != null) {
        StringBuilder sb=new StringBuilder("String_Node_Str");
        sb.append(sourcePermanent.getName());
        sb.append("String_Node_Str").append(tributeValue).append("String_Node_Str");
        if (opponent.chooseUse(outcome,sb.toString(),game)) {
          sourcePermanent.addCounters(CounterType.P1P1.createInstance(tributeValue),game);
          game.getState().setValue(new StringBuilder("String_Node_Str").append(source.getSourceId()).toString(),"String_Node_Str");
        }
 else {
          game.getState().setValue(new StringBuilder("String_Node_Str").append(source.getSourceId()).toString(),"String_Node_Str");
        }
        return true;
      }
    }
  }
  return false;
}
Program: 159557
Project: 159557
Buggy source:
@Override public boolean apply(Game game,Ability source){
  if (source.getTargets().size() > 0) {
    Target multiTarget=source.getTargets().get(0);
    Set<Permanent> permanents=new HashSet<Permanent>();
    for (    UUID target : multiTarget.getTargets()) {
      Permanent permanent=game.getPermanent(target);
      if (permanent != null) {
        permanents.add(permanent);
        permanent.damage(multiTarget.getTargetAmount(target),source.getSourceId(),game,true,false);
      }
    }
    Permanent sourceCreature=game.getPermanent(source.getSourceId());
    if (sourceCreature != null) {
      for (      Permanent permanent : permanents) {
        sourceCreature.damage(permanent.getPower().getValue(),source.getSourceId(),game,true,false);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  if (source.getTargets().size() > 0) {
    Target multiTarget=source.getTargets().get(0);
    Set<Permanent> permanents=new HashSet<Permanent>();
    for (    UUID target : multiTarget.getTargets()) {
      Permanent permanent=game.getPermanent(target);
      if (permanent != null) {
        permanents.add(permanent);
        permanent.damage(multiTarget.getTargetAmount(target),source.getSourceId(),game,true,false);
      }
    }
    Permanent sourceCreature=game.getPermanent(source.getSourceId());
    if (sourceCreature != null) {
      for (      Permanent permanent : permanents) {
        sourceCreature.damage(permanent.getPower().getValue(),permanent.getId(),game,true,false);
      }
    }
    return true;
  }
  return false;
}
Program: 159559
Project: 159559
Buggy source:
@Test public void testTurnToFrog(){
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",2);
  addCard(Zone.HAND,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",2);
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str");
  addCard(Zone.HAND,playerB,"String_Node_Str");
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str");
  castSpell(3,PhaseStep.DECLARE_ATTACKERS,playerB,"String_Node_Str","String_Node_Str");
  attack(3,playerA,"String_Node_Str");
  block(3,playerB,"String_Node_Str","String_Node_Str");
  setStopAt(3,PhaseStep.END_TURN);
  execute();
  assertLife(playerB,20);
  assertPermanentCount(playerA,"String_Node_Str",0);
  assertPermanentCount(playerB,"String_Node_Str",0);
}

Fixed version (ground truth):
@Test public void testTurnToFrog(){
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",2);
  addCard(Zone.HAND,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",2);
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str");
  addCard(Zone.HAND,playerB,"String_Node_Str");
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str");
  castSpell(3,PhaseStep.PRECOMBAT_MAIN,playerB,"String_Node_Str","String_Node_Str");
  attack(3,playerA,"String_Node_Str");
  block(3,playerB,"String_Node_Str","String_Node_Str");
  setStopAt(3,PhaseStep.END_TURN);
  execute();
  assertLife(playerB,20);
  assertPermanentCount(playerA,"String_Node_Str",0);
  assertPermanentCount(playerB,"String_Node_Str",0);
}
Program: 159561
Project: 159561
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(this.getControllerId())) {
    if (setTargetPointer) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
        effect.setValue("String_Node_Str",event.getAmount());
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(this.getControllerId())) {
    if (setTargetPointer) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
        effect.setValue("String_Node_Str",event.getAmount());
      }
    }
    return true;
  }
  return false;
}
Program: 159563
Project: 159563
Buggy source:
@Override public boolean isLegal(Ability source,Game game){
  for (  UUID targetId : targets.keySet()) {
    Card card=game.getCard(targetId);
    if (card != null) {
      if (zoneChangeCounters.containsKey(targetId) && zoneChangeCounters.get(targetId) != card.getZoneChangeCounter()) {
        continue;
      }
    }
    if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET,targetId,source.getId(),source.getControllerId()))) {
      continue;
    }
    if (canTarget(targetId,source,game)) {
      return true;
    }
  }
  if (minNumberOfTargets == 0 && targets.isEmpty()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isLegal(Ability source,Game game){
  Set<UUID> illegalTargets=new HashSet<UUID>();
  int replacedTargets=0;
  for (  UUID targetId : targets.keySet()) {
    Card card=game.getCard(targetId);
    if (card != null) {
      if (zoneChangeCounters.containsKey(targetId) && zoneChangeCounters.get(targetId) != card.getZoneChangeCounter()) {
        illegalTargets.add(targetId);
        continue;
      }
    }
    if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET,targetId,source.getId(),source.getControllerId()))) {
      replacedTargets++;
      continue;
    }
    if (!canTarget(targetId,source,game)) {
      illegalTargets.add(targetId);
    }
  }
  for (  UUID targetId : illegalTargets) {
    targets.remove(targetId);
  }
  if (replacedTargets > 0 && replacedTargets == targets.size()) {
    return false;
  }
  if (minNumberOfTargets == 0 && targets.isEmpty()) {
    return true;
  }
  return targets.size() > 0;
}
Program: 159564
Project: 159564
Buggy source:
@Override public List<UUID> getTargets(Game game,Ability source){
  ArrayList<UUID> target=new ArrayList<UUID>();
  if (source.getTargets().size() > 0) {
    Target currentTarget=source.getTargets().get(0);
    for (    UUID targetId : source.getTargets().get(0).getTargets()) {
      Card card=game.getCard(targetId);
      if (card != null && zoneChangeCounter.containsKey(targetId) && card.getZoneChangeCounter() != zoneChangeCounter.get(targetId)) {
        continue;
      }
      if (!currentTarget.canTarget(targetId,source,game)) {
        continue;
      }
      target.add(targetId);
    }
  }
  return target;
}

Fixed version (ground truth):
@Override public List<UUID> getTargets(Game game,Ability source){
  ArrayList<UUID> target=new ArrayList<UUID>();
  if (source.getTargets().size() > 0) {
    for (    UUID targetId : source.getTargets().get(0).getTargets()) {
      Card card=game.getCard(targetId);
      if (card != null && zoneChangeCounter.containsKey(targetId) && card.getZoneChangeCounter() != zoneChangeCounter.get(targetId)) {
        continue;
      }
      target.add(targetId);
    }
  }
  return target;
}
Program: 159565
Project: 159565
Buggy source:
@Override public void watch(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.MANA_PAYED) {
    if (event.getSourceId().equals(this.getSourceId())) {
      Spell spell=game.getStack().getSpell(event.getTargetId());
      if (spell != null) {
        Card card=spell.getCard();
        if (card != null) {
          for (          UUID playerId : game.getPlayerList()) {
            Player player=game.getPlayer(playerId);
            if (player != null) {
              if (player.getCommanderId() != null && player.getCommanderId().equals(card.getId())) {
                commanderId.add(card.getId());
                break;
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void watch(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.MANA_PAYED) {
    if (event.getSourceId().equals(this.getSourceId()) && event.getFlag()) {
      Spell spell=game.getStack().getSpell(event.getTargetId());
      if (spell != null) {
        Card card=spell.getCard();
        if (card != null) {
          for (          UUID playerId : game.getPlayerList()) {
            Player player=game.getPlayer(playerId);
            if (player != null) {
              if (player.getCommanderId() != null && player.getCommanderId().equals(card.getId())) {
                commanderId.add(card.getId());
                break;
              }
            }
          }
        }
      }
    }
  }
}
Program: 159567
Project: 159567
Buggy source:
public int count(FilterMana filter){
  if (filter == null) {
    return count();
  }
  int count=0;
  if (filter.isBlack())   count+=black;
  if (filter.isBlue())   count+=blue;
  if (filter.isWhite())   count+=white;
  if (filter.isGreen())   count+=green;
  if (filter.isRed())   count+=red;
  if (filter.isColorless())   count+=colorless;
  return count;
}

Fixed version (ground truth):
public int count(FilterMana filter){
  if (filter == null) {
    return count();
  }
  int count=0;
  if (filter.isBlack()) {
    count+=black;
  }
  if (filter.isBlue()) {
    count+=blue;
  }
  if (filter.isWhite()) {
    count+=white;
  }
  if (filter.isGreen()) {
    count+=green;
  }
  if (filter.isRed()) {
    count+=red;
  }
  if (filter.isColorless()) {
    count+=colorless;
  }
  return count;
}
Program: 159568
Project: 159568
Buggy source:
public boolean enough(Mana avail){
  Mana compare=avail.copy();
  compare.subtract(this);
  if (compare.getRed() < 0) {
    compare.setAny(compare.getAny() + compare.getRed());
    if (compare.getAny() < 0)     return false;
    compare.setRed(0);
  }
  if (compare.getGreen() < 0) {
    compare.setAny(compare.getAny() + compare.getGreen());
    if (compare.getAny() < 0)     return false;
    compare.setGreen(0);
  }
  if (compare.getBlue() < 0) {
    compare.setAny(compare.getAny() + compare.getBlue());
    if (compare.getAny() < 0)     return false;
    compare.setBlue(0);
  }
  if (compare.getBlack() < 0) {
    compare.setAny(compare.getAny() + compare.getBlack());
    if (compare.getAny() < 0)     return false;
    compare.setBlack(0);
  }
  if (compare.getWhite() < 0) {
    compare.setAny(compare.getAny() + compare.getWhite());
    if (compare.getAny() < 0)     return false;
    compare.setWhite(0);
  }
  if (compare.getColorless() < 0) {
    int remaining=compare.getRed() + compare.getGreen() + compare.getBlack()+ compare.getBlue()+ compare.getWhite()+ compare.getAny();
    if (compare.getColorless() + remaining < 0)     return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean enough(Mana avail){
  Mana compare=avail.copy();
  compare.subtract(this);
  if (compare.getRed() < 0) {
    compare.setAny(compare.getAny() + compare.getRed());
    if (compare.getAny() < 0) {
      return false;
    }
    compare.setRed(0);
  }
  if (compare.getGreen() < 0) {
    compare.setAny(compare.getAny() + compare.getGreen());
    if (compare.getAny() < 0) {
      return false;
    }
    compare.setGreen(0);
  }
  if (compare.getBlue() < 0) {
    compare.setAny(compare.getAny() + compare.getBlue());
    if (compare.getAny() < 0) {
      return false;
    }
    compare.setBlue(0);
  }
  if (compare.getBlack() < 0) {
    compare.setAny(compare.getAny() + compare.getBlack());
    if (compare.getAny() < 0) {
      return false;
    }
    compare.setBlack(0);
  }
  if (compare.getWhite() < 0) {
    compare.setAny(compare.getAny() + compare.getWhite());
    if (compare.getAny() < 0) {
      return false;
    }
    compare.setWhite(0);
  }
  if (compare.getColorless() < 0) {
    int remaining=compare.getRed() + compare.getGreen() + compare.getBlack()+ compare.getBlue()+ compare.getWhite()+ compare.getAny();
    if (compare.getColorless() + remaining < 0) {
      return false;
    }
  }
  return true;
}
Program: 159569
Project: 159569
Buggy source:
/** 
 * @param mana
 * @return true if this contains any values that mana has
 */
public boolean contains(Mana mana){
  if (mana.black > 0 && this.black > 0)   return true;
  if (mana.blue > 0 && this.blue > 0)   return true;
  if (mana.red > 0 && this.red > 0)   return true;
  if (mana.white > 0 && this.white > 0)   return true;
  if (mana.green > 0 && this.green > 0)   return true;
  if (mana.colorless > 0 && this.count() > 0)   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * @param mana
 * @return true if this contains any values that mana has
 */
public boolean contains(Mana mana){
  if (mana.black > 0 && this.black > 0) {
    return true;
  }
  if (mana.blue > 0 && this.blue > 0) {
    return true;
  }
  if (mana.red > 0 && this.red > 0) {
    return true;
  }
  if (mana.white > 0 && this.white > 0) {
    return true;
  }
  if (mana.green > 0 && this.green > 0) {
    return true;
  }
  if (mana.colorless > 0 && this.count() > 0) {
    return true;
  }
  return false;
}
Program: 159570
Project: 159570
Buggy source:
@Override public String toString(){
  StringBuilder sbMana=new StringBuilder();
  for (int i=0; i < red; i++)   sbMana.append("String_Node_Str");
  for (int i=0; i < green; i++)   sbMana.append("String_Node_Str");
  for (int i=0; i < blue; i++)   sbMana.append("String_Node_Str");
  for (int i=0; i < black; i++)   sbMana.append("String_Node_Str");
  for (int i=0; i < white; i++)   sbMana.append("String_Node_Str");
  for (int i=0; i < any; i++)   sbMana.append("String_Node_Str");
  if (colorless > 0) {
    sbMana.append("String_Node_Str").append(Integer.toString(colorless)).append("String_Node_Str");
  }
  return sbMana.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sbMana=new StringBuilder();
  for (int i=0; i < red; i++) {
    sbMana.append("String_Node_Str");
  }
  for (int i=0; i < green; i++) {
    sbMana.append("String_Node_Str");
  }
  for (int i=0; i < blue; i++) {
    sbMana.append("String_Node_Str");
  }
  for (int i=0; i < black; i++) {
    sbMana.append("String_Node_Str");
  }
  for (int i=0; i < white; i++) {
    sbMana.append("String_Node_Str");
  }
  for (int i=0; i < any; i++) {
    sbMana.append("String_Node_Str");
  }
  if (colorless > 0) {
    sbMana.append("String_Node_Str").append(Integer.toString(colorless)).append("String_Node_Str");
  }
  return sbMana.toString();
}
Program: 159571
Project: 159571
Buggy source:
public boolean pay(ManaType manaType,Ability ability,Filter filter,Game game){
  if (getConditional(manaType,ability,filter,game) > 0) {
    removeConditional(manaType,ability,game);
    return true;
  }
  for (  ManaPoolItem mana : manaItems) {
    if (filter == null || filter.match(game.getObject(mana.getSourceId()),game)) {
      boolean spendAnyMana=spendAnyMana(ability,game);
      if (mana.get(manaType) > 0 || (spendAnyMana && mana.count() > 0)) {
        game.fireEvent(new GameEvent(GameEvent.EventType.MANA_PAYED,ability.getId(),mana.getSourceId(),ability.getControllerId()));
        if (spendAnyMana) {
          mana.removeAny();
        }
 else {
          mana.remove(manaType);
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean pay(ManaType manaType,Ability ability,Filter filter,Game game){
  if (getConditional(manaType,ability,filter,game) > 0) {
    removeConditional(manaType,ability,game);
    return true;
  }
  for (  ManaPoolItem mana : manaItems) {
    if (filter == null || filter.match(game.getObject(mana.getSourceId()),game)) {
      boolean spendAnyMana=spendAnyMana(ability,game);
      if (mana.get(manaType) > 0 || (spendAnyMana && mana.count() > 0)) {
        game.fireEvent(new GameEvent(GameEvent.EventType.MANA_PAYED,ability.getId(),mana.getSourceId(),ability.getControllerId(),0,mana.getFlag()));
        if (spendAnyMana) {
          mana.removeAny();
        }
 else {
          mana.remove(manaType);
        }
        return true;
      }
    }
  }
  return false;
}
Program: 159572
Project: 159572
Buggy source:
public void addMana(Mana mana,Game game,Ability source){
  if (mana instanceof ConditionalMana) {
    this.manaItems.add(new ManaPoolItem((ConditionalMana)mana,source.getSourceId()));
  }
 else {
    this.manaItems.add(new ManaPoolItem(mana.getRed(),mana.getGreen(),mana.getBlue(),mana.getWhite(),mana.getBlack(),mana.getColorless(),source.getSourceId()));
  }
  GameEvent event=GameEvent.getEvent(GameEvent.EventType.MANA_ADDED,source.getSourceId(),source.getId(),source.getControllerId());
  event.setData(mana.toString());
  game.fireEvent(event);
}

Fixed version (ground truth):
public void addMana(Mana mana,Game game,Ability source){
  if (mana instanceof ConditionalMana) {
    this.manaItems.add(new ManaPoolItem((ConditionalMana)mana,source.getSourceId()));
  }
 else {
    this.manaItems.add(new ManaPoolItem(mana.getRed(),mana.getGreen(),mana.getBlue(),mana.getWhite(),mana.getBlack(),mana.getColorless(),source.getSourceId(),mana.getFlag()));
  }
  GameEvent event=GameEvent.getEvent(GameEvent.EventType.MANA_ADDED,source.getSourceId(),source.getId(),source.getControllerId());
  event.setData(mana.toString());
  game.fireEvent(event);
}
Program: 159573
Project: 159573
Buggy source:
public ManaPoolItem(final ManaPoolItem item){
  this.red=item.red;
  this.green=item.green;
  this.blue=item.blue;
  this.white=item.white;
  this.black=item.black;
  this.colorless=item.colorless;
  if (item.conditionalMana != null) {
    this.conditionalMana=item.conditionalMana.copy();
  }
  this.sourceId=item.sourceId;
}

Fixed version (ground truth):
public ManaPoolItem(final ManaPoolItem item){
  this.red=item.red;
  this.green=item.green;
  this.blue=item.blue;
  this.white=item.white;
  this.black=item.black;
  this.colorless=item.colorless;
  if (item.conditionalMana != null) {
    this.conditionalMana=item.conditionalMana.copy();
  }
  this.sourceId=item.sourceId;
  this.flag=item.flag;
}
Program: 159574
Project: 159574
Buggy source:
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType().equals(GameEvent.EventType.DAMAGE_CAUSES_LIFE_LOSS)) {
    Permanent permanent=game.getPermanent(source.getSourceId());
    if (permanent == null) {
      permanent=(Permanent)game.getLastKnownInformation(source.getSourceId(),Zone.BATTLEFIELD);
    }
    if (permanent != null) {
      Player controller=game.getPlayer(permanent.getControllerId());
      if (controller != null && (controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId())) {
        event.setAmount(controller.getLife() - 1);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType().equals(GameEvent.EventType.DAMAGE_CAUSES_LIFE_LOSS)) {
    Permanent permanent=game.getPermanent(source.getSourceId());
    if (permanent != null) {
      Player controller=game.getPlayer(source.getControllerId());
      if (controller != null && (controller.getLife() > 0) && (controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId())) {
        event.setAmount(controller.getLife() - 1);
      }
    }
  }
  return false;
}
Program: 159575
Project: 159575
Buggy source:
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType().equals(GameEvent.EventType.DAMAGE_CAUSES_LIFE_LOSS)) {
    Permanent permanent=game.getPermanent(source.getSourceId());
    if (permanent == null) {
      permanent=(Permanent)game.getLastKnownInformation(source.getSourceId(),Zone.BATTLEFIELD);
    }
    if (permanent != null) {
      Player controller=game.getPlayer(permanent.getControllerId());
      if (controller != null && (controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId())) {
        event.setAmount(controller.getLife() - 1);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType().equals(GameEvent.EventType.DAMAGE_CAUSES_LIFE_LOSS)) {
    Permanent permanent=game.getPermanent(source.getSourceId());
    if (permanent != null) {
      Player controller=game.getPlayer(source.getControllerId());
      if (controller != null && (controller.getLife() > 0) && (controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId())) {
        event.setAmount(controller.getLife() - 1);
      }
    }
  }
  return false;
}
Program: 159576
Project: 159576
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player you=game.getPlayer(source.getControllerId());
  if (you != null) {
    if (you.flipCoin(game)) {
      DjinnToken token=new DjinnToken();
      token.putOntoBattlefield(1,game,source.getId(),source.getControllerId());
      return true;
    }
 else {
      you.damage(5,source.getSourceId(),game,true,false);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player you=game.getPlayer(source.getControllerId());
  if (you != null) {
    if (you.flipCoin(game)) {
      DjinnToken token=new DjinnToken();
      token.putOntoBattlefield(1,game,source.getSourceId(),source.getControllerId());
      return true;
    }
 else {
      you.damage(5,source.getSourceId(),game,true,false);
      return true;
    }
  }
  return false;
}
Program: 159577
Project: 159577
Buggy source:
@Override public Opt copy(){
  return new Opt(this);
}

Fixed version (ground truth):
@Override public OptEffect copy(){
  return new OptEffect(this);
}
Program: 159578
Project: 159578
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player == null) {
    return false;
  }
  if (player.getLibrary().size() > 0) {
    Card card=player.getLibrary().getFromTop(game);
    Cards cards=new CardsImpl();
    cards.add(card);
    player.revealCards("String_Node_Str",cards,game);
    if (card != null) {
      if (card.getCardType().contains(CardType.CREATURE)) {
        card.putOntoBattlefield(game,Zone.HAND,source.getId(),source.getControllerId());
      }
 else       if (player.chooseUse(Outcome.Neutral,"String_Node_Str" + card.getName() + "String_Node_Str",game)) {
        card.moveToZone(Zone.LIBRARY,source.getId(),game,false);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player == null) {
    return false;
  }
  if (player.getLibrary().size() > 0) {
    Card card=player.getLibrary().getFromTop(game);
    Cards cards=new CardsImpl();
    cards.add(card);
    player.revealCards("String_Node_Str",cards,game);
    if (card != null) {
      if (card.getCardType().contains(CardType.CREATURE)) {
        card=player.getLibrary().removeFromTop(game);
        card.putOntoBattlefield(game,Zone.HAND,source.getSourceId(),source.getControllerId());
      }
 else       if (player.chooseUse(Outcome.Neutral,"String_Node_Str" + card.getName() + "String_Node_Str",game)) {
        card.moveToZone(Zone.LIBRARY,source.getSourceId(),game,false);
      }
    }
  }
  return false;
}
Program: 159579
Project: 159579
Buggy source:
@Override protected void init(UUID choosingPlayerId,GameOptions gameOptions){
  super.init(choosingPlayerId,gameOptions);
  Ability ability=new SimpleStaticAbility(Zone.COMMAND,new EmptyEffect("String_Node_Str"));
  for (  UUID playerId : state.getPlayerList(startingPlayerId)) {
    Player player=getPlayer(playerId);
    if (player != null) {
      if (player.getSideboard().size() > 0) {
        Card commander=getCard((UUID)player.getSideboard().toArray()[0]);
        if (commander != null) {
          player.setCommanderId(commander.getId());
          commander.moveToZone(Zone.COMMAND,null,this,true);
          ability.addEffect(new CommanderReplacementEffect(commander.getId()));
          ability.addEffect(new CommanderCostModification(commander.getId()));
          ability.addEffect(new CommanderManaReplacementEffect(player.getId(),commander.getSpellAbility().getManaCosts().getMana()));
          getState().setValue(commander.getId() + "String_Node_Str",new Integer(0));
          CommanderCombatDamageWatcher watcher=new CommanderCombatDamageWatcher(commander.getId());
          getState().getWatchers().add(watcher);
          watcher.addCardInfoToCommander(this);
        }
      }
    }
  }
  this.getState().addAbility(ability,this.getId(),null);
  state.getTurnMods().add(new TurnMod(startingPlayerId,PhaseStep.DRAW));
}

Fixed version (ground truth):
@Override protected void init(UUID choosingPlayerId,GameOptions gameOptions){
  super.init(choosingPlayerId,gameOptions);
  Ability ability=new SimpleStaticAbility(Zone.COMMAND,new EmptyEffect("String_Node_Str"));
  for (  UUID playerId : state.getPlayerList(startingPlayerId)) {
    Player player=getPlayer(playerId);
    if (player != null) {
      if (player.getSideboard().size() > 0) {
        Card commander=getCard((UUID)player.getSideboard().toArray()[0]);
        if (commander != null) {
          player.setCommanderId(commander.getId());
          commander.moveToZone(Zone.COMMAND,null,this,true);
          ability.addEffect(new CommanderReplacementEffect(commander.getId()));
          ability.addEffect(new CommanderCostModification(commander.getId()));
          ability.addEffect(new CommanderManaReplacementEffect(player.getId(),commander.getSpellAbility().getManaCosts().getMana()));
          getState().setValue(commander.getId() + "String_Node_Str",new Integer(0));
          CommanderCombatDamageWatcher watcher=new CommanderCombatDamageWatcher(commander.getId());
          getState().getWatchers().add(watcher);
          this.commanderCombatWatcher.add(watcher);
          watcher.addCardInfoToCommander(this);
        }
      }
    }
  }
  this.getState().addAbility(ability,this.getId(),null);
  state.getTurnMods().add(new TurnMod(startingPlayerId,PhaseStep.DRAW));
}
Program: 159580
Project: 159580
Buggy source:
@Override protected boolean checkStateBasedActions(){
  for (  Watcher watcher : getState().getWatchers().values()) {
    if (watcher instanceof CommanderCombatDamageWatcher) {
      CommanderCombatDamageWatcher damageWatcher=(CommanderCombatDamageWatcher)watcher;
      for (      UUID playerUUID : damageWatcher.getDamageToPlayer().keySet()) {
        Player player=getPlayer(playerUUID);
        if (player != null && damageWatcher.getDamageToPlayer().get(playerUUID) >= 21) {
          player.lost(this);
        }
      }
    }
  }
  return super.checkStateBasedActions();
}

Fixed version (ground truth):
@Override protected boolean checkStateBasedActions(){
  for (  CommanderCombatDamageWatcher damageWatcher : commanderCombatWatcher) {
    for (    Map.Entry<UUID,Integer> entrySet : damageWatcher.getDamageToPlayer().entrySet()) {
      if (entrySet.getValue() > 20) {
        Player player=getPlayer(entrySet.getKey());
        if (player != null && player.isInGame()) {
          player.lost(this);
        }
      }
    }
  }
  return super.checkStateBasedActions();
}
Program: 159581
Project: 159581
Buggy source:
protected void init(Card card){
  copyFromCard(card);
  if (card instanceof LevelerCard) {
    maxLevelCounters=((LevelerCard)card).getMaxLevelCounters();
  }
}

Fixed version (ground truth):
private void init(Card card){
  copyFromCard(card);
  if (card instanceof LevelerCard) {
    maxLevelCounters=((LevelerCard)card).getMaxLevelCounters();
  }
}
Program: 159583
Project: 159583
Buggy source:
@Override public List<String> getSubtype(){
  return card.getSubtype();
}

Fixed version (ground truth):
@Override public List<String> getSubtype(){
  if (this.getSpellAbility() instanceof BestowAbility) {
    List<String> subtypes=new ArrayList<String>();
    subtypes.addAll(card.getSubtype());
    subtypes.add("String_Node_Str");
    return subtypes;
  }
  return card.getSubtype();
}
Program: 159584
Project: 159584
Buggy source:
public CommanderReplacementEffect(final CommanderReplacementEffect effect){
  super(effect);
}

Fixed version (ground truth):
public CommanderReplacementEffect(final CommanderReplacementEffect effect){
  super(effect);
  this.commanderId=effect.commanderId;
}
Program: 159585
Project: 159585
Buggy source:
@Override public ChroniclerOfHeroes copy(){
  return new ChroniclerOfHeroes(this);
}

Fixed version (ground truth):
@Override public ChroniclerOfHeroesEffect copy(){
  return new ChroniclerOfHeroesEffect(this);
}