nus-yam/ex-repair huggingface dataset:
Program: 157883
Project: 157883
Buggy source:
@Override public boolean apply(Card input,Game game){
  if (text.isEmpty()) {
    return true;
  }
  if (inNames && input.getName().toLowerCase().contains(text.toLowerCase())) {
    return true;
  }
  String[] tokens=text.toLowerCase().split("String_Node_Str");
  boolean found=false;
  for (  String token : tokens) {
    if (!token.isEmpty()) {
      if (inRules) {
        if (input.isSplitCard()) {
          found=((SplitCard)input).getLeftHalfCard().getRules(game).stream().anyMatch(rule -> rule.toLowerCase().contains(token.toLowerCase()));
          found|=((SplitCard)input).getRightHalfCard().getRules(game).stream().anyMatch(rule -> rule.toLowerCase().contains(token.toLowerCase()));
        }
 else {
          found=input.getRules(game).stream().anyMatch(rule -> rule.toLowerCase().contains(token.toLowerCase()));
        }
      }
      if (inTypes) {
        found|=input.getSubtype(game).stream().anyMatch(s -> s.toString().equalsIgnoreCase(token));
        found|=input.getSuperType().stream().anyMatch(s -> s.toString().equalsIgnoreCase(token));
      }
    }
    if (found) {
      break;
    }
  }
  return found;
}

Fixed version (ground truth):
@Override public boolean apply(Card input,Game game){
  if (text.isEmpty()) {
    return true;
  }
  if (inNames && input.getName().toLowerCase().contains(text.toLowerCase())) {
    return true;
  }
  String[] tokens=text.toLowerCase().split("String_Node_Str");
  for (  String token : tokens) {
    boolean found=false;
    if (!token.isEmpty()) {
      if (inRules) {
        if (input.isSplitCard()) {
          for (          String rule : ((SplitCard)input).getLeftHalfCard().getRules(game)) {
            if (rule.toLowerCase().contains(token)) {
              found=true;
              break;
            }
          }
          for (          String rule : ((SplitCard)input).getRightHalfCard().getRules(game)) {
            if (rule.toLowerCase().contains(token)) {
              found=true;
              break;
            }
          }
        }
        for (        String rule : input.getRules(game)) {
          if (rule.toLowerCase().contains(token)) {
            found=true;
            break;
          }
        }
      }
      if (inTypes) {
        for (        SubType subType : input.getSubtype(game)) {
          if (subType.toString().equalsIgnoreCase(token)) {
            found=true;
            break;
          }
        }
        for (        SuperType superType : input.getSuperType()) {
          if (superType.toString().equalsIgnoreCase(token)) {
            found=true;
            break;
          }
        }
      }
    }
    if (!found) {
      return false;
    }
  }
  return true;
}
Program: 157884
Project: 157884
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=source.getSourceObject(game);
  if (controller != null && sourceObject != null) {
    Cards topCards=new CardsImpl();
    topCards.addAll(controller.getLibrary().getTopCards(game,10));
    controller.lookAtCards(sourceObject.getIdName(),topCards,game);
    TargetCard targetCreatures=new TargetCard(0,2,Zone.LIBRARY,new FilterCreatureCard());
    controller.choose(outcome,topCards,targetCreatures,game);
    Cards exiledCards=new CardsImpl(targetCreatures.getTargets());
    if (!exiledCards.isEmpty()) {
      controller.moveCards(exiledCards,Zone.EXILED,source,game);
      controller.shuffleLibrary(source,game);
      Player opponent=game.getPlayer(getTargetPointer().getFirst(game,source));
      if (opponent != null) {
        TargetCard targetOpponentCreature=new TargetCard(0,1,Zone.EXILED,new FilterCreatureCard());
        if (opponent.choose(outcome,exiledCards,targetOpponentCreature,game)) {
          Card card=game.getCard(targetOpponentCreature.getFirstTarget());
          if (card != null) {
            opponent.moveCards(card,Zone.BATTLEFIELD,source,game);
            exiledCards.remove(card);
          }
        }
        if (!exiledCards.isEmpty()) {
          controller.moveCards(exiledCards,Zone.BATTLEFIELD,source,game);
        }
      }
    }
 else {
      controller.shuffleLibrary(source,game);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  if (cards != null && player != null) {
    return player.moveCards(cards,Zone.BATTLEFIELD,source,game);
  }
  return false;
}
Program: 157885
Project: 157885
Buggy source:
@Override public DubiousChallengeEffect copy(){
  return new DubiousChallengeEffect(this);
}

Fixed version (ground truth):
@Override public DubiousChallengeMoveToBattlefieldEffect copy(){
  return new DubiousChallengeMoveToBattlefieldEffect(this);
}
Program: 157886
Project: 157886
Buggy source:
@Override public boolean apply(ObjectSourcePlayer<Player> input,Game game){
  Player targetPlayer=input.getObject();
  if (targetPlayer == null) {
    return false;
  }
  HopeOfGhirapurCombatDamageWatcher watcher=(HopeOfGhirapurCombatDamageWatcher)game.getState().getWatchers().get(HopeOfGhirapurCombatDamageWatcher.class.getSimpleName());
  if (watcher != null) {
    return watcher.playerGotCombatDamage(input.getSourceId(),input.getObject().getId());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(ObjectSourcePlayer<Player> input,Game game){
  Player targetPlayer=input.getObject();
  if (targetPlayer == null) {
    return false;
  }
  HopeOfGhirapurCombatDamageWatcher watcher=(HopeOfGhirapurCombatDamageWatcher)game.getState().getWatchers().get(HopeOfGhirapurCombatDamageWatcher.class.getSimpleName());
  if (watcher != null) {
    return watcher.playerGotCombatDamage(input.getSourceId(),input.getObject().getId(),game);
  }
  return false;
}
Program: 157887
Project: 157887
Buggy source:
@Override public void watch(GameEvent event,Game game){
  if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent)event).isCombatDamage()) {
    UUID damagerId=event.getSourceId();
    Set<UUID> players;
    if (combatDamagedPlayers.containsKey(damagerId)) {
      players=combatDamagedPlayers.get(damagerId);
    }
 else {
      players=new HashSet<>();
      combatDamagedPlayers.put(damagerId,players);
    }
    players.add(event.getTargetId());
  }
}

Fixed version (ground truth):
@Override public void watch(GameEvent event,Game game){
  if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent)event).isCombatDamage()) {
    MageObjectReference damager=new MageObjectReference(event.getSourceId(),game);
    Set<UUID> players;
    if (combatDamagedPlayers.containsKey(damager)) {
      players=combatDamagedPlayers.get(damager);
    }
 else {
      players=new HashSet<>();
      combatDamagedPlayers.put(damager,players);
    }
    players.add(event.getTargetId());
  }
}
Program: 157888
Project: 157888
Buggy source:
/** 
 * Checks if the current object has damaged the player during the current turn.
 * @param objectId
 * @param playerId
 * @return
 */
public boolean playerGotCombatDamage(UUID objectId,UUID playerId){
  if (combatDamagedPlayers.containsKey(objectId)) {
    return combatDamagedPlayers.get(objectId).contains(playerId);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if the current object has damaged the player during the current turn.
 * @param objectId
 * @param playerId
 * @return
 */
public boolean playerGotCombatDamage(UUID objectId,UUID playerId,Game game){
  StackObject stackObject=game.getState().getStack().getStackObject(objectId);
  MageObjectReference mor;
  if (stackObject != null && stackObject instanceof StackAbility) {
    mor=new MageObjectReference(objectId,((StackAbility)stackObject).getSourceObjectZoneChangeCounter(),game);
  }
 else {
    mor=new MageObjectReference(objectId,game);
  }
  if (combatDamagedPlayers.containsKey(mor)) {
    return combatDamagedPlayers.get(mor).contains(playerId);
  }
  return false;
}
Program: 157889
Project: 157889
Buggy source:
public HopeOfGhirapurCombatDamageWatcher(final HopeOfGhirapurCombatDamageWatcher watcher){
  super(watcher);
  for (  UUID damagerId : watcher.combatDamagedPlayers.keySet()) {
    Set<UUID> players=new HashSet<>();
    players.addAll(watcher.combatDamagedPlayers.get(damagerId));
    this.combatDamagedPlayers.put(damagerId,players);
  }
}

Fixed version (ground truth):
public HopeOfGhirapurCombatDamageWatcher(final HopeOfGhirapurCombatDamageWatcher watcher){
  super(watcher);
  for (  MageObjectReference damager : watcher.combatDamagedPlayers.keySet()) {
    Set<UUID> players=new HashSet<>();
    players.addAll(watcher.combatDamagedPlayers.get(damager));
    this.combatDamagedPlayers.put(damager,players);
  }
}
Program: 157890
Project: 157890
Buggy source:
@Override public String getInfoMessage(Ability source,GameEvent event,Game game){
  MageObject mageObject=game.getObject(source.getSourceId());
  if (mageObject != null) {
    return "String_Node_Str" + mageObject.getLogName() + ')';
  }
  return null;
}

Fixed version (ground truth):
@Override public String getInfoMessage(Ability source,GameEvent event,Game game){
  MageObject mageObject=source.getSourceObject(game);
  if (mageObject != null) {
    return "String_Node_Str" + mageObject.getLogName() + ')';
  }
  return null;
}
Program: 157891
Project: 157891
Buggy source:
@Test public void testWhenHopeOfGhirapurWasRemovedAndReturnedBack(){
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",1);
  addCard(Zone.HAND,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",1);
  addCard(Zone.HAND,playerB,"String_Node_Str");
  attack(1,playerA,"String_Node_Str");
  castSpell(1,PhaseStep.END_COMBAT,playerA,"String_Node_Str","String_Node_Str");
  activateAbility(1,PhaseStep.POSTCOMBAT_MAIN,playerA,"String_Node_Str",playerB);
  castSpell(2,PhaseStep.PRECOMBAT_MAIN,playerB,"String_Node_Str",playerA);
  setStopAt(2,PhaseStep.BEGIN_COMBAT);
  execute();
  assertLife(playerA,18);
  assertLife(playerB,19);
  assertPermanentCount(playerA,"String_Node_Str",1);
}

Fixed version (ground truth):
@Test public void testWhenHopeOfGhirapurWasRemovedAndReturnedBack(){
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",1);
  addCard(Zone.HAND,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",1);
  addCard(Zone.HAND,playerB,"String_Node_Str");
  attack(1,playerA,"String_Node_Str");
  castSpell(1,PhaseStep.POSTCOMBAT_MAIN,playerA,"String_Node_Str","String_Node_Str");
  activateAbility(1,PhaseStep.END_TURN,playerA,"String_Node_Str",playerB);
  castSpell(2,PhaseStep.PRECOMBAT_MAIN,playerB,"String_Node_Str",playerA);
  setStopAt(2,PhaseStep.BEGIN_COMBAT);
  execute();
  assertLife(playerA,18);
  assertLife(playerB,19);
  assertPermanentCount(playerA,"String_Node_Str",1);
}
Program: 157892
Project: 157892
Buggy source:
@Override public int getSourceObjectZoneChangeCounter(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public int getSourceObjectZoneChangeCounter(){
  return ability.getSourceObjectZoneChangeCounter();
}
Program: 157893
Project: 157893
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getPlayerId().equals(this.getControllerId())) {
    Spell spell=game.getStack().getSpell(event.getTargetId());
    if (spell != null && spell.getFromZone() == Zone.HAND) {
      if (spell.getCard() != null) {
        for (        Effect effect : getEffects()) {
          effect.setTargetPointer(new FixedTarget(spell.getId(),spell.getZoneChangeCounter(game)));
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getPlayerId().equals(this.getControllerId())) {
    Spell spell=game.getStack().getSpell(event.getTargetId());
    if (spell != null && spell.getFromZone() == Zone.HAND) {
      if (spell.getCard() != null) {
        for (        Effect effect : getEffects()) {
          effect.setTargetPointer(new FixedTarget(spell.getId()));
        }
        return true;
      }
    }
  }
  return false;
}
Program: 157894
Project: 157894
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller == null || sourceObject == null) {
    return false;
  }
  Cards cards=new CardsImpl();
  int xValue=game.getLastKnownInformation(this.getTargetPointer().getFirst(game,source),Zone.STACK).getConvertedManaCost();
  cards.addAll(controller.getLibrary().getTopCards(game,xValue));
  if (!cards.isEmpty()) {
    controller.revealCards(sourceObject.getIdName(),cards,game);
    FilterCard filter=new FilterNonlandCard("String_Node_Str" + xValue + "String_Node_Str");
    filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN,xValue + 1));
    TargetCard target=new TargetCard(1,Zone.LIBRARY,filter);
    if (controller.chooseTarget(Outcome.PlayForFree,cards,target,source,game)) {
      Card card=cards.get(target.getFirstTarget(),game);
      if (card != null) {
        if (controller.chooseUse(outcome,"String_Node_Str" + card.getName(),source,game)) {
          controller.cast(card.getSpellAbility(),game,true);
          cards.remove(card);
        }
      }
    }
  }
  while (!cards.isEmpty()) {
    Card card=cards.getRandom(game);
    if (card != null) {
      cards.remove(card);
      card.moveToZone(Zone.LIBRARY,source.getSourceId(),game,false);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller == null || sourceObject == null) {
    return false;
  }
  Spell spell=game.getStack().getSpell(this.getTargetPointer().getFirst(game,source));
  int xValue=0;
  if (spell == null) {
    spell=(Spell)game.getLastKnownInformation(this.getTargetPointer().getFirst(game,source),Zone.STACK);
  }
  if (spell == null) {
    return false;
  }
  xValue=spell.getConvertedManaCost();
  Cards cards=new CardsImpl();
  cards.addAll(controller.getLibrary().getTopCards(game,xValue));
  if (!cards.isEmpty()) {
    controller.revealCards(sourceObject.getIdName(),cards,game);
    FilterCard filter=new FilterNonlandCard("String_Node_Str" + xValue + "String_Node_Str");
    filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN,xValue + 1));
    TargetCard target=new TargetCard(1,Zone.LIBRARY,filter);
    if (controller.chooseTarget(Outcome.PlayForFree,cards,target,source,game)) {
      Card card=cards.get(target.getFirstTarget(),game);
      if (card != null) {
        if (controller.chooseUse(outcome,"String_Node_Str" + card.getLogName() + "String_Node_Str",source,game)) {
          controller.cast(card.getSpellAbility(),game,true);
          cards.remove(card);
        }
      }
    }
  }
  while (!cards.isEmpty()) {
    Card card=cards.getRandom(game);
    if (card != null) {
      cards.remove(card);
      card.moveToZone(Zone.LIBRARY,source.getSourceId(),game,false);
    }
  }
  return true;
}
Program: 157896
Project: 157896
Buggy source:
@Override public boolean applies(Ability abilityToModify,Ability source,Game game){
  if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
    Card sourceCard=game.getCard(abilityToModify.getSourceId());
    if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.isCreature())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(Ability abilityToModify,Ability source,Game game){
  if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
    if (abilityToModify.getControllerId().equals(source.getControllerId())) {
      Spell spell=(Spell)game.getStack().getStackObject(abilityToModify.getId());
      if (spell != null) {
        return spell.isCreature();
      }
 else {
        Card sourceCard=game.getCard(abilityToModify.getSourceId());
        return sourceCard != null && sourceCard.isCreature();
      }
    }
  }
  return false;
}
Program: 157897
Project: 157897
Buggy source:
@Override public boolean applies(Ability abilityToModify,Ability source,Game game){
  if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
    Card sourceCard=game.getCard(abilityToModify.getSourceId());
    if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.isCreature())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(Ability abilityToModify,Ability source,Game game){
  if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
    if (abilityToModify.getControllerId().equals(source.getControllerId())) {
      Spell spell=(Spell)game.getStack().getStackObject(abilityToModify.getId());
      if (spell != null) {
        return spell.isCreature();
      }
 else {
        Card sourceCard=game.getCard(abilityToModify.getSourceId());
        return sourceCard != null && sourceCard.isCreature();
      }
    }
  }
  return false;
}
Program: 157898
Project: 157898
Buggy source:
@Override public void init(Ability source,Game game){
  super.init(source,game);
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    Choice choice=new ChoiceLandType();
    controller.choose(outcome,choice,game);
    targetLandType=choice.getChoice();
    choice=new ChoiceBasicLandType();
    controller.choose(outcome,choice,game);
    targetBasicLandType=choice.getChoice();
  }
 else {
    this.discard();
  }
  FilterPermanent filter=new FilterLandPermanent();
  filter.add(new SubtypePredicate(SubType.byDescription(targetLandType)));
  if (this.affectedObjectsSet) {
    for (    Permanent permanent : game.getBattlefield().getAllActivePermanents(filter,game)) {
      affectedObjectList.add(new MageObjectReference(permanent,game));
    }
  }
}

Fixed version (ground truth):
@Override public void init(Ability source,Game game){
  super.init(source,game);
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    Choice choice=new ChoiceLandType();
    controller.choose(outcome,choice,game);
    targetLandType=choice.getChoice();
    choice=new ChoiceBasicLandType();
    controller.choose(outcome,choice,game);
    targetBasicLandType=choice.getChoice();
    if (targetLandType == null || targetBasicLandType == null) {
      this.discard();
      return;
    }
  }
 else {
    this.discard();
    return;
  }
  FilterPermanent filter=new FilterLandPermanent();
  filter.add(new SubtypePredicate(SubType.byDescription(targetLandType)));
  if (this.affectedObjectsSet) {
    for (    Permanent permanent : game.getBattlefield().getAllActivePermanents(filter,game)) {
      affectedObjectList.add(new MageObjectReference(permanent,game));
    }
  }
}
Program: 157899
Project: 157899
Buggy source:
public VisionCharmEffect(final VisionCharmEffect effect){
  super(effect);
}

Fixed version (ground truth):
public VisionCharmEffect(final VisionCharmEffect effect){
  super(effect);
  targetLandType=effect.targetLandType;
  targetBasicLandType=effect.targetBasicLandType;
}
Program: 157900
Project: 157900
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=game.getPermanent(targetPointer.getFirst(game,source));
  if (permanent == null) {
    permanent=(Permanent)game.getLastKnownInformation(targetPointer.getFirst(game,source),Zone.BATTLEFIELD);
  }
  if (permanent != null) {
    MyrToken token=new MyrToken();
    token.putOntoBattlefield(1,game,source.getSourceId(),permanent.getControllerId());
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game,source));
  if (permanent != null) {
    MyrToken token=new MyrToken();
    token.putOntoBattlefield(1,game,source.getSourceId(),permanent.getControllerId());
  }
  return true;
}
Program: 157901
Project: 157901
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
    if (filter.match(zEvent.getTarget(),this.getSourceId(),this.getControllerId(),game)) {
      if (onlyToControllerGraveyard && !this.getControllerId().equals(game.getOwnerId(zEvent.getTargetId()))) {
        return false;
      }
      if (setTargetPointer) {
        for (        Effect effect : this.getEffects()) {
          effect.setTargetPointer(new FixedTarget(event.getTargetId()));
        }
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
    if (filter.match(zEvent.getTarget(),this.getSourceId(),this.getControllerId(),game)) {
      if (onlyToControllerGraveyard && !this.getControllerId().equals(game.getOwnerId(zEvent.getTargetId()))) {
        return false;
      }
      if (setTargetPointer) {
        for (        Effect effect : this.getEffects()) {
          effect.setTargetPointer(new FixedTarget(event.getTargetId(),game.getObject(event.getTargetId()).getZoneChangeCounter(game)));
        }
      }
      return true;
    }
  }
  return false;
}
Program: 157902
Project: 157902
Buggy source:
@Override public SpellAbility chooseSpellAbilityForCast(SpellAbility ability,Game game,boolean noMana){
switch (ability.getSpellAbilityType()) {
case SPLIT:
case SPLIT_FUSED:
case SPLIT_AFTERMATH:
    MageObject object=game.getObject(ability.getSourceId());
  if (object != null) {
    LinkedHashMap<UUID,ActivatedAbility> useableAbilities=getSpellAbilities(object,game.getState().getZone(object.getId()),game);
    if (useableAbilities != null && !useableAbilities.isEmpty()) {
      game.fireGetChoiceEvent(playerId,name,object,new ArrayList<>(useableAbilities.values()));
      return (SpellAbility)useableAbilities.values().iterator().next();
    }
  }
return null;
default :
return ability;
}
}

Fixed version (ground truth):
@Override public SpellAbility chooseSpellAbilityForCast(SpellAbility ability,Game game,boolean noMana){
switch (ability.getSpellAbilityType()) {
case SPLIT:
case SPLIT_FUSED:
case SPLIT_AFTERMATH:
    MageObject object=game.getObject(ability.getSourceId());
  if (object != null) {
    LinkedHashMap<UUID,ActivatedAbility> useableAbilities=getSpellAbilities(object,game.getState().getZone(object.getId()),game);
    if (useableAbilities != null && !useableAbilities.isEmpty()) {
      return (SpellAbility)useableAbilities.values().iterator().next();
    }
  }
return null;
default :
return ability;
}
}
Program: 157903
Project: 157903
Buggy source:
@Override public boolean canChooseTarget(Game game){
  int found=0;
  for (  Mode mode : getModes().values()) {
    if (mode.getTargets().canChoose(sourceId,controllerId,game)) {
      found++;
      if (getModes().isEachModeMoreThanOnce()) {
        return true;
      }
      if (found >= getModes().getMinModes()) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canChooseTarget(Game game){
  if (this instanceof SpellAbility) {
    if (SpellAbilityType.SPLIT_FUSED.equals(((SpellAbility)this).getSpellAbilityType())) {
      Card card=game.getCard(getSourceId());
      if (card != null) {
        return canChooseTargetAbility(((SplitCard)card).getLeftHalfCard().getSpellAbility(),game,getControllerId()) && canChooseTargetAbility(((SplitCard)card).getRightHalfCard().getSpellAbility(),game,getControllerId());
      }
      return false;
    }
  }
  return canChooseTargetAbility(this,game,getControllerId());
}
Program: 157904
Project: 157904
Buggy source:
@Override public boolean cast(Game game,Zone fromZone,SpellAbility ability,UUID controllerId){
switch (ability.getSpellAbilityType()) {
case SPLIT_LEFT:
    return this.getLeftHalfCard().cast(game,fromZone,ability,controllerId);
case SPLIT_RIGHT:
  return this.getRightHalfCard().cast(game,fromZone,ability,controllerId);
default :
return super.cast(game,fromZone,ability,controllerId);
}
}

Fixed version (ground truth):
@Override public boolean cast(Game game,Zone fromZone,SpellAbility ability,UUID controllerId){
switch (ability.getSpellAbilityType()) {
case SPLIT_LEFT:
    return this.getLeftHalfCard().cast(game,fromZone,ability,controllerId);
case SPLIT_RIGHT:
  return this.getRightHalfCard().cast(game,fromZone,ability,controllerId);
default :
this.getLeftHalfCard().getSpellAbility().setControllerId(controllerId);
this.getRightHalfCard().getSpellAbility().setControllerId(controllerId);
return super.cast(game,fromZone,ability,controllerId);
}
}
Program: 157905
Project: 157905
Buggy source:
protected LinkedHashMap<UUID,ActivatedAbility> getSpellAbilities(MageObject object,Zone zone,Game game){
  LinkedHashMap<UUID,ActivatedAbility> useable=new LinkedHashMap<>();
  for (  Ability ability : object.getAbilities()) {
    if (ability instanceof SpellAbility) {
      if (((SpellAbility)ability).getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED) {
        if (zone == Zone.HAND) {
          useable.clear();
          useable.put(ability.getId(),(SpellAbility)ability);
          return useable;
        }
 else {
          continue;
        }
      }
      if (((SpellAbility)ability).getSpellAbilityType() == SpellAbilityType.SPLIT || ((SpellAbility)ability).getSpellAbilityType() == SpellAbilityType.SPLIT_AFTERMATH) {
        continue;
      }
      useable.put(ability.getId(),(SpellAbility)ability);
    }
  }
  return useable;
}

Fixed version (ground truth):
protected LinkedHashMap<UUID,ActivatedAbility> getSpellAbilities(MageObject object,Zone zone,Game game){
  LinkedHashMap<UUID,ActivatedAbility> useable=new LinkedHashMap<>();
  for (  Ability ability : object.getAbilities()) {
    if (ability instanceof SpellAbility) {
switch (((SpellAbility)ability).getSpellAbilityType()) {
case SPLIT_FUSED:
        if (zone == Zone.HAND) {
          if (((SpellAbility)ability).canChooseTarget(game)) {
            useable.put(ability.getId(),(SpellAbility)ability);
          }
        }
case SPLIT:
      if (((SplitCard)object).getLeftHalfCard().getSpellAbility().canChooseTarget(game)) {
        useable.put(((SplitCard)object).getLeftHalfCard().getSpellAbility().getId(),((SplitCard)object).getLeftHalfCard().getSpellAbility());
      }
    if (((SplitCard)object).getRightHalfCard().getSpellAbility().canChooseTarget(game)) {
      useable.put(((SplitCard)object).getRightHalfCard().getSpellAbility().getId(),((SplitCard)object).getRightHalfCard().getSpellAbility());
    }
  return useable;
case SPLIT_AFTERMATH:
if (zone == Zone.GRAVEYARD) {
  if (((SplitCard)object).getRightHalfCard().getSpellAbility().canChooseTarget(game)) {
    useable.put(((SplitCard)object).getRightHalfCard().getSpellAbility().getId(),((SplitCard)object).getRightHalfCard().getSpellAbility());
  }
}
 else {
  if (((SplitCard)object).getLeftHalfCard().getSpellAbility().canChooseTarget(game)) {
    useable.put(((SplitCard)object).getLeftHalfCard().getSpellAbility().getId(),((SplitCard)object).getLeftHalfCard().getSpellAbility());
  }
}
return useable;
default :
useable.put(ability.getId(),(SpellAbility)ability);
}
}
}
return useable;
}
Program: 157907
Project: 157907
Buggy source:
@Override public boolean apply(Game game,Ability source){
  UUID exileId=source.getSourceId();
  ExileZone exile=game.getExile().getExileZone(exileId);
  if (exile != null) {
    exile=exile.copy();
    for (    UUID cardId : exile) {
      Card card=game.getCard(cardId);
      card.putOntoBattlefield(game,Zone.EXILED,source.getSourceId(),card.getOwnerId());
    }
    game.getExile().getExileZone(exileId).clear();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=source.getSourceObject(game);
  if (sourceObject != null && controller != null) {
    Permanent permanentLeftBattlefield=(Permanent)getValue("String_Node_Str");
    if (permanentLeftBattlefield == null) {
      Logger.getLogger(ReturnFromExileForSourceEffect.class).error("String_Node_Str" + sourceObject.getName());
      return false;
    }
    ExileZone exile=game.getExile().getExileZone(CardUtil.getExileZoneId(game,source.getSourceId(),permanentLeftBattlefield.getZoneChangeCounter(game)));
    if (exile != null) {
      controller.moveCards(exile.getCards(game),Zone.BATTLEFIELD,source,game,false,false,true,null);
    }
    return true;
  }
  return false;
}
Program: 157908
Project: 157908
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent targetCreature=game.getPermanent(source.getFirstTarget());
  if (targetCreature != null) {
    int toughness=targetCreature.getToughness().getBaseValue();
    game.addEffect(new SetPowerToughnessTargetEffect(0,toughness,Duration.EndOfTurn),source);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent targetCreature=game.getPermanent(source.getFirstTarget());
  if (targetCreature != null) {
    int toughness=targetCreature.getToughness().getBaseValueModified();
    game.addEffect(new SetPowerToughnessTargetEffect(0,toughness,Duration.EndOfTurn),source);
    return true;
  }
  return false;
}
Program: 157909
Project: 157909
Buggy source:
public QuicksilverFountain(final QuicksilverFountain card){
  super(card);
}

Fixed version (ground truth):
public QuicksilverFountain(final QuicksilverFountain card){
  super(card);
  this.originalId=card.originalId;
}
Program: 157910
Project: 157910
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    int amount=game.getBattlefield().countAll(dragonFilter,controller.getId(),game);
    if (amount > 0) {
      Permanent targetCreature=((FixedTarget)getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
      if (targetCreature != null) {
        targetCreature.damage(amount,getTargetPointer().getFirst(game,source),game,false,true);
      }
 else {
        Player player=game.getPlayer(source.getTargets().getFirstTarget());
        if (player != null) {
          player.damage(amount,getTargetPointer().getFirst(game,source),game,false,true);
        }
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    Permanent damageSource=(Permanent)getValue("String_Node_Str");
    int amount=game.getBattlefield().countAll(dragonFilter,controller.getId(),game);
    if (amount > 0) {
      Permanent targetCreature=game.getPermanent(getTargetPointer().getFirst(game,source));
      if (targetCreature != null) {
        targetCreature.damage(amount,damageSource.getId(),game,false,true);
      }
 else {
        Player player=game.getPlayer(source.getTargets().getFirstTarget());
        if (player != null) {
          player.damage(amount,damageSource.getId(),game,false,true);
        }
      }
    }
    return true;
  }
  return false;
}
Program: 157911
Project: 157911
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  UUID targetId=event.getTargetId();
  Permanent permanent=game.getPermanent(targetId);
  if (permanent != null && filter.match(permanent,getSourceId(),getControllerId(),game)) {
    if (setTargetPointer != SetTargetPointer.NONE) {
      for (      Effect effect : this.getEffects()) {
switch (setTargetPointer) {
case PERMANENT:
          effect.setTargetPointer(new FixedTarget(permanent,game));
        break;
case PLAYER:
      effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
    break;
}
}
}
return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  UUID targetId=event.getTargetId();
  Permanent permanent=game.getPermanent(targetId);
  if (permanent != null && filter.match(permanent,getSourceId(),getControllerId(),game)) {
    for (    Effect effect : this.getEffects()) {
      effect.setValue("String_Node_Str",permanent);
    }
    if (setTargetPointer != SetTargetPointer.NONE) {
      for (      Effect effect : this.getEffects()) {
switch (setTargetPointer) {
case PERMANENT:
          effect.setTargetPointer(new FixedTarget(permanent,game));
        break;
case PLAYER:
      effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
    break;
}
}
}
return true;
}
return false;
}
Program: 157912
Project: 157912
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Effect effect=new ReturnToHandSourceEffect(false,true);
  effect.setText("String_Node_Str");
  DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
  game.addDelayedTriggeredAbility(delayedAbility,source);
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Effect effect=new ReturnToHandTargetEffect();
  effect.setText("String_Node_Str");
  effect.setTargetPointer(new FixedTarget(source.getSourceId(),source.getSourceObjectZoneChangeCounter()));
  DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
  game.addDelayedTriggeredAbility(delayedAbility,source);
  return true;
}
Program: 157913
Project: 157913
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Effect effect=new ReturnToHandSourceEffect(false,true);
  effect.setText("String_Node_Str");
  DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
  game.addDelayedTriggeredAbility(delayedAbility,source);
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Effect effect=new ReturnToHandTargetEffect();
  effect.setText("String_Node_Str");
  effect.setTargetPointer(new FixedTarget(source.getSourceId(),source.getSourceObjectZoneChangeCounter()));
  DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
  game.addDelayedTriggeredAbility(delayedAbility,source);
  return true;
}
Program: 157914
Project: 157914
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Effect effect=new ReturnToHandSourceEffect(false,true);
  effect.setText("String_Node_Str");
  DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
  game.addDelayedTriggeredAbility(delayedAbility,source);
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Effect effect=new ReturnToHandTargetEffect();
  effect.setText("String_Node_Str");
  effect.setTargetPointer(new FixedTarget(source.getSourceId(),source.getSourceObjectZoneChangeCounter()));
  DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
  game.addDelayedTriggeredAbility(delayedAbility,source);
  return true;
}
Program: 157915
Project: 157915
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (((ZoneChangeEvent)event).isDiesEvent()) {
    Card card=game.getCard(event.getTargetId());
    Player controller=game.getPlayer(getControllerId());
    if (controller != null && card != null && card.isArtifact() && controller.hasOpponent(card.getOwnerId(),game)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (((ZoneChangeEvent)event).isDiesEvent()) {
    Card card=game.getPermanentOrLKIBattlefield(event.getTargetId());
    Player controller=game.getPlayer(getControllerId());
    if (controller != null && card != null && card.isArtifact() && controller.hasOpponent(card.getOwnerId(),game)) {
      return true;
    }
  }
  return false;
}
Program: 157916
Project: 157916
Buggy source:
@Override public boolean isInUseableZone(Game game,MageObject source,GameEvent event){
  if (event.getTargetId().equals(getSourceId()) && event.getSourceId().equals(getSourceId())) {
    if (!this.hasSourceObjectAbility(game,source,event)) {
      return false;
    }
    return true;
  }
  return super.isInUseableZone(game,source,event);
}

Fixed version (ground truth):
@Override public boolean isInUseableZone(Game game,MageObject source,GameEvent event){
  if (event.getTargetId().equals(getSourceId()) && event.getSourceId().equals(getSourceId())) {
    if (!this.hasSourceObjectAbility(game,source,event)) {
      return false;
    }
    this.setControllerId(event.getPlayerId());
    return true;
  }
  return super.isInUseableZone(game,source,event);
}
Program: 157917
Project: 157917
Buggy source:
@Override public void init(Ability source,Game game){
  super.init(source,game);
  if (affectedObjectsSet) {
    Permanent equipment=game.getPermanentOrLKIBattlefield(source.getSourceId());
    if (equipment != null && equipment.getAttachedTo() != null) {
      this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(),game.getState().getZoneChangeCounter(equipment.getAttachedTo())));
    }
  }
}

Fixed version (ground truth):
@Override public void init(Ability source,Game game){
  super.init(source,game);
  if (lockedIn) {
    power=new StaticValue(power.calculate(game,source,this));
    toughness=new StaticValue(toughness.calculate(game,source,this));
  }
  if (affectedObjectsSet) {
    Permanent equipment=game.getPermanentOrLKIBattlefield(source.getSourceId());
    if (equipment != null && equipment.getAttachedTo() != null) {
      this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(),game.getState().getZoneChangeCounter(equipment.getAttachedTo())));
    }
  }
}
Program: 157918
Project: 157918
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    int amount=game.getBattlefield().countAll(dragonFilter,controller.getId(),game);
    if (amount > 0) {
      Permanent targetCreature=game.getPermanent(source.getTargets().getFirstTarget());
      if (targetCreature != null) {
        targetCreature.damage(amount,getTargetPointer().getFirst(game,source),game,false,true);
      }
 else {
        Player player=game.getPlayer(source.getTargets().getFirstTarget());
        if (player != null) {
          player.damage(amount,getTargetPointer().getFirst(game,source),game,false,true);
        }
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    int amount=game.getBattlefield().countAll(dragonFilter,controller.getId(),game);
    if (amount > 0) {
      Permanent targetCreature=((FixedTarget)getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
      if (targetCreature != null) {
        targetCreature.damage(amount,getTargetPointer().getFirst(game,source),game,false,true);
      }
 else {
        Player player=game.getPlayer(source.getTargets().getFirstTarget());
        if (player != null) {
          player.damage(amount,getTargetPointer().getFirst(game,source),game,false,true);
        }
      }
    }
    return true;
  }
  return false;
}
Program: 157919
Project: 157919
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game,source));
  if (permanent != null) {
    PutTokenOntoBattlefieldCopyTargetEffect effect=new PutTokenOntoBattlefieldCopyTargetEffect(null,null,true);
    effect.setTargetPointer(getTargetPointer());
    if (effect.apply(game,source)) {
      for (      Permanent tokenPermanent : effect.getAddedPermanent()) {
        ExileTargetEffect exileEffect=new ExileTargetEffect();
        exileEffect.setTargetPointer(new FixedTarget(tokenPermanent,game));
        DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
        game.addDelayedTriggeredAbility(delayedAbility,source);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=((FixedTarget)getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
  if (permanent != null) {
    PutTokenOntoBattlefieldCopyTargetEffect effect=new PutTokenOntoBattlefieldCopyTargetEffect(null,null,true);
    effect.setTargetPointer(getTargetPointer());
    if (effect.apply(game,source)) {
      for (      Permanent tokenPermanent : effect.getAddedPermanent()) {
        ExileTargetEffect exileEffect=new ExileTargetEffect();
        exileEffect.setTargetPointer(new FixedTarget(tokenPermanent,game));
        DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
        game.addDelayedTriggeredAbility(delayedAbility,source);
      }
      return true;
    }
  }
  return false;
}
Program: 157920
Project: 157920
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game,source));
  if (permanent != null) {
    PutTokenOntoBattlefieldCopyTargetEffect effect=new PutTokenOntoBattlefieldCopyTargetEffect(null,null,true);
    effect.setTargetPointer(getTargetPointer());
    if (effect.apply(game,source)) {
      for (      Permanent tokenPermanent : effect.getAddedPermanent()) {
        ExileTargetEffect exileEffect=new ExileTargetEffect();
        exileEffect.setTargetPointer(new FixedTarget(tokenPermanent,game));
        DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
        game.addDelayedTriggeredAbility(delayedAbility,source);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent permanent=((FixedTarget)getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
  if (permanent != null) {
    PutTokenOntoBattlefieldCopyTargetEffect effect=new PutTokenOntoBattlefieldCopyTargetEffect(null,null,true);
    effect.setTargetPointer(getTargetPointer());
    if (effect.apply(game,source)) {
      for (      Permanent tokenPermanent : effect.getAddedPermanent()) {
        ExileTargetEffect exileEffect=new ExileTargetEffect();
        exileEffect.setTargetPointer(new FixedTarget(tokenPermanent,game));
        DelayedTriggeredAbility delayedAbility=new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
        game.addDelayedTriggeredAbility(delayedAbility,source);
      }
      return true;
    }
  }
  return false;
}
Program: 157921
Project: 157921
Buggy source:
public int calculate(Game game,UUID controllerId){
  PlayerLostLifeWatcher watcher=(PlayerLostLifeWatcher)game.getState().getWatchers().get(PlayerLostLifeWatcher.class.getSimpleName());
  if (watcher != null) {
    int amountLifeLost=0;
    for (    UUID opponentId : game.getOpponents(controllerId)) {
      amountLifeLost+=watcher.getLiveLost(opponentId);
    }
    return amountLifeLost;
  }
  return 0;
}

Fixed version (ground truth):
public int calculate(Game game,UUID controllerId){
  PlayerLostLifeWatcher watcher=(PlayerLostLifeWatcher)game.getState().getWatchers().get(PlayerLostLifeWatcher.class.getSimpleName());
  if (watcher != null) {
    return watcher.getAllOppLifeLost(controllerId);
  }
  return 0;
}
Program: 157922
Project: 157922
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
    if (zEvent.getTarget() != null && zEvent.getTarget().getOwnerId().equals(this.getControllerId()) && zEvent.getTarget().isCreature() && !zEvent.getTarget().getId().equals(this.getSourceId())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
  for (  Zone z : Zone.values()) {
    if (game.getShortLivingLKI(sourceId,z) && !z.equals(Zone.GRAVEYARD)) {
      return false;
    }
  }
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
    if (zEvent.getTarget() != null && zEvent.getTarget().getOwnerId().equals(this.getControllerId()) && zEvent.getTarget().isCreature() && !zEvent.getTarget().getId().equals(this.getSourceId())) {
      return true;
    }
  }
  return false;
}
Program: 157923
Project: 157923
Buggy source:
@Override public boolean checkIfMatchEnds(){
  int activePlayers=0;
  MatchPlayer matchWinner=null;
  for (  MatchPlayer matchPlayer : players) {
    if (!matchPlayer.hasQuit()) {
      if (matchPlayer.getDeck() == null) {
        logger.error("String_Node_Str" + this.getId() + "String_Node_Str"+ matchPlayer.getName());
        matchPlayer.setQuit(true);
      }
 else {
        activePlayers++;
        matchWinner=matchPlayer;
      }
    }
    if (matchPlayer.getWins() >= options.getWinsNeeded()) {
      matchPlayer.setMatchWinner(true);
      endTime=new Date();
      return true;
    }
  }
  if (activePlayers < 2) {
    if (matchWinner != null) {
      matchWinner.setMatchWinner(true);
    }
    endTime=new Date();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkIfMatchEnds(){
  int activePlayers=0;
  MatchPlayer matchWinner=null;
  for (  MatchPlayer matchPlayer : players) {
    if (!matchPlayer.hasQuit()) {
      activePlayers++;
      matchWinner=matchPlayer;
    }
    if (matchPlayer.getWins() >= options.getWinsNeeded()) {
      matchPlayer.setMatchWinner(true);
      endTime=new Date();
      return true;
    }
  }
  if (activePlayers < 2) {
    if (matchWinner != null) {
      matchWinner.setMatchWinner(true);
    }
    endTime=new Date();
    return true;
  }
  return false;
}
Program: 157924
Project: 157924
Buggy source:
@Override public CurseOfDisturbanceTriggeredAbility copy(){
  return new CurseOfDisturbanceTriggeredAbility(this);
}

Fixed version (ground truth):
@Override public CurseOfDisturbanceEffect copy(){
  return new CurseOfDisturbanceEffect(this);
}
Program: 157925
Project: 157925
Buggy source:
@Override public CurseOfOpulenceTriggeredAbility copy(){
  return new CurseOfOpulenceTriggeredAbility(this);
}

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