nus-yam/ex-repair huggingface dataset:
Program: 158021
Project: 158021
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (player != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
    while (!player.choose(outcome,typeChoice,game)) {
      if (!player.canRespond()) {
        return false;
      }
    }
    if (typeChoice.getChoice() != null) {
      game.informPlayers(sourceObject.getLogName() + "String_Node_Str" + typeChoice.getChoice());
    }
    FilterCreaturePermanent filterCreaturePermanent=new FilterCreaturePermanent();
    filterCreaturePermanent.add(new SubtypePredicate(typeChoice.getChoice()));
    for (    Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent,source.getSourceId(),game)) {
      creature.destroy(source.getSourceId(),game,true);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (player != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(SubType.getCreatureTypes(false));
    while (!player.choose(outcome,typeChoice,game)) {
      if (!player.canRespond()) {
        return false;
      }
    }
    if (typeChoice.getChoice() != null) {
      game.informPlayers(sourceObject.getLogName() + "String_Node_Str" + typeChoice.getChoice());
    }
    FilterCreaturePermanent filterCreaturePermanent=new FilterCreaturePermanent();
    filterCreaturePermanent.add(new SubtypePredicate(SubType.byDescription(typeChoice.getChoice())));
    for (    Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent,source.getSourceId(),game)) {
      creature.destroy(source.getSourceId(),game,true);
    }
    return true;
  }
  return false;
}
Program: 158022
Project: 158022
Buggy source:
private void searchLand(Player player,Ability source,Game game,Cards cards,String subtype){
  FilterLandCard filter=new FilterLandCard(subtype);
  filter.add(new SubtypePredicate(subtype));
  TargetCardInLibrary target=new TargetCardInLibrary(filter);
  if (player.searchLibrary(target,game)) {
    Card card=player.getLibrary().remove(target.getFirstTarget(),game);
    if (card != null) {
      card.moveToZone(Zone.HAND,source.getSourceId(),game,false);
      cards.add(card);
    }
  }
}

Fixed version (ground truth):
private void searchLand(Player player,Ability source,Game game,Cards cards,String subtype){
  FilterLandCard filter=new FilterLandCard(subtype);
  filter.add(new SubtypePredicate(SubType.byDescription(subtype)));
  TargetCardInLibrary target=new TargetCardInLibrary(filter);
  if (player.searchLibrary(target,game)) {
    Card card=player.getLibrary().remove(target.getFirstTarget(),game);
    if (card != null) {
      card.moveToZone(Zone.HAND,source.getSourceId(),game,false);
      cards.add(card);
    }
  }
}
Program: 158023
Project: 158023
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (sourceObject != null && controller != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
    while (!controller.choose(Outcome.BoostCreature,typeChoice,game)) {
      if (!controller.canRespond()) {
        return false;
      }
    }
    String typeChosen=typeChoice.getChoice();
    if (!typeChosen.isEmpty()) {
      game.informPlayers(controller.getLogName() + "String_Node_Str" + typeChosen);
      FilterCreaturePermanent filter=new FilterCreaturePermanent();
      filter.add(new SubtypePredicate(typeChosen));
      game.addEffect(new BoostAllEffect(3,3,Duration.EndOfTurn,filter,false),source);
    }
    return true;
  }
  return false;
}

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 (sourceObject != null && controller != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
    while (!controller.choose(Outcome.BoostCreature,typeChoice,game)) {
      if (!controller.canRespond()) {
        return false;
      }
    }
    String typeChosen=typeChoice.getChoice();
    if (!typeChosen.isEmpty()) {
      game.informPlayers(controller.getLogName() + "String_Node_Str" + typeChosen);
      FilterCreaturePermanent filter=new FilterCreaturePermanent();
      filter.add(new SubtypePredicate(SubType.byDescription(typeChosen)));
      game.addEffect(new BoostAllEffect(3,3,Duration.EndOfTurn,filter,false),source);
    }
    return true;
  }
  return false;
}
Program: 158024
Project: 158024
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
    while (!player.choose(Outcome.UnboostCreature,typeChoice,game)) {
      if (!player.canRespond()) {
        return false;
      }
    }
    FilterControlledCreaturePermanent filter=new FilterControlledCreaturePermanent();
    filter.add(new SubtypePredicate(typeChoice.getChoice()));
    DynamicValue negativePermanentsCount=new PermanentsOnBattlefieldCount(filter,-1);
    ContinuousEffect effect=new BoostTargetEffect(negativePermanentsCount,negativePermanentsCount,Duration.EndOfTurn,true);
    effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
    game.addEffect(effect,source);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
    while (!player.choose(Outcome.UnboostCreature,typeChoice,game)) {
      if (!player.canRespond()) {
        return false;
      }
    }
    FilterControlledCreaturePermanent filter=new FilterControlledCreaturePermanent();
    filter.add(new SubtypePredicate(SubType.byDescription(typeChoice.getChoice())));
    DynamicValue negativePermanentsCount=new PermanentsOnBattlefieldCount(filter,-1);
    ContinuousEffect effect=new BoostTargetEffect(negativePermanentsCount,negativePermanentsCount,Duration.EndOfTurn,true);
    effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
    game.addEffect(effect,source);
    return true;
  }
  return false;
}
Program: 158025
Project: 158025
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) {
    Set<String> chosenTypes=new HashSet<>();
    for (    UUID playerId : game.getState().getPlayersInRange(controller.getId(),game)) {
      Player player=game.getPlayer(playerId);
      Choice typeChoice=new ChoiceImpl(true);
      typeChoice.setMessage("String_Node_Str");
      typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
      while (!player.choose(Outcome.PutCreatureInPlay,typeChoice,game)) {
        if (!player.canRespond()) {
          break;
        }
      }
      String chosenType=typeChoice.getChoice();
      if (chosenType != null) {
        game.informPlayers(sourceObject.getLogName() + "String_Node_Str" + player.getLogName()+ "String_Node_Str"+ chosenType);
        chosenTypes.add(chosenType);
      }
    }
    List<SubtypePredicate> predicates=new ArrayList<>();
    for (    String type : chosenTypes) {
      predicates.add(new SubtypePredicate(type));
    }
    FilterCard filter=new FilterCreatureCard();
    filter.add(Predicates.or(predicates));
    for (    UUID playerId : game.getState().getPlayersInRange(controller.getId(),game)) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        player.moveCards(player.getGraveyard().getCards(filter,game),Zone.BATTLEFIELD,source,game);
      }
    }
    return true;
  }
  return false;
}

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) {
    Set<String> chosenTypes=new HashSet<>();
    for (    UUID playerId : game.getState().getPlayersInRange(controller.getId(),game)) {
      Player player=game.getPlayer(playerId);
      Choice typeChoice=new ChoiceImpl(true);
      typeChoice.setMessage("String_Node_Str");
      typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
      while (!player.choose(Outcome.PutCreatureInPlay,typeChoice,game)) {
        if (!player.canRespond()) {
          break;
        }
      }
      String chosenType=typeChoice.getChoice();
      if (chosenType != null) {
        game.informPlayers(sourceObject.getLogName() + "String_Node_Str" + player.getLogName()+ "String_Node_Str"+ chosenType);
        chosenTypes.add(chosenType);
      }
    }
    List<SubtypePredicate> predicates=new ArrayList<>();
    for (    String type : chosenTypes) {
      predicates.add(new SubtypePredicate(SubType.byDescription(type)));
    }
    FilterCard filter=new FilterCreatureCard();
    filter.add(Predicates.or(predicates));
    for (    UUID playerId : game.getState().getPlayersInRange(controller.getId(),game)) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        player.moveCards(player.getGraveyard().getCards(filter,game),Zone.BATTLEFIELD,source,game);
      }
    }
    return true;
  }
  return false;
}
Program: 158026
Project: 158026
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    Set<Card> lands=new HashSet<>();
    for (    UUID playerId : game.getState().getPlayersInRange(controller.getId(),game)) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        String landName : new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) {
          FilterLandPermanent filter=new FilterLandPermanent(landName + "String_Node_Str");
          filter.add(new SubtypePredicate(landName));
          filter.add(new ControllerPredicate(TargetController.YOU));
          Target target=new TargetLandPermanent(1,1,filter,true);
          if (target.canChoose(source.getSourceId(),player.getId(),game)) {
            player.chooseTarget(outcome,target,source,game);
            lands.add(game.getPermanent(target.getFirstTarget()));
          }
        }
      }
    }
    controller.moveCards(lands,Zone.HAND,source,game);
    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) {
    Set<Card> lands=new HashSet<>();
    for (    UUID playerId : game.getState().getPlayersInRange(controller.getId(),game)) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        String landName : SubType.getBasicLands(false)) {
          FilterLandPermanent filter=new FilterLandPermanent(landName + "String_Node_Str");
          filter.add(new SubtypePredicate(SubType.byDescription(landName)));
          filter.add(new ControllerPredicate(TargetController.YOU));
          Target target=new TargetLandPermanent(1,1,filter,true);
          if (target.canChoose(source.getSourceId(),player.getId(),game)) {
            player.chooseTarget(outcome,target,source,game);
            lands.add(game.getPermanent(target.getFirstTarget()));
          }
        }
      }
    }
    controller.moveCards(lands,Zone.HAND,source,game);
    return true;
  }
  return false;
}
Program: 158027
Project: 158027
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (player != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
    while (!player.choose(outcome,typeChoice,game)) {
      if (!player.canRespond()) {
        return false;
      }
    }
    if (typeChoice.getChoice() != null) {
      game.informPlayers(sourceObject.getLogName() + "String_Node_Str" + typeChoice.getChoice());
    }
    FilterCreaturePermanent filterCreaturePermanent=new FilterCreaturePermanent();
    filterCreaturePermanent.add(new SubtypePredicate(typeChoice.getChoice()));
    for (    Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent,source.getSourceId(),game)) {
      creature.untap(game);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (player != null) {
    Choice typeChoice=new ChoiceImpl(true);
    typeChoice.setMessage("String_Node_Str");
    typeChoice.setChoices(SubType.getCreatureTypes(false));
    while (!player.choose(outcome,typeChoice,game)) {
      if (!player.canRespond()) {
        return false;
      }
    }
    if (typeChoice.getChoice() != null) {
      game.informPlayers(sourceObject.getLogName() + "String_Node_Str" + typeChoice.getChoice());
    }
    FilterCreaturePermanent filterCreaturePermanent=new FilterCreaturePermanent();
    filterCreaturePermanent.add(new SubtypePredicate(SubType.byDescription(typeChoice.getChoice())));
    for (    Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent,source.getSourceId(),game)) {
      creature.untap(game);
    }
    return true;
  }
  return false;
}
Program: 158028
Project: 158028
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<Ability> manaAbilities=land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
    for (    Ability basicAbility : manaAbilities) {
      ManaAbility ability=(ManaAbility)basicAbility;
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
          if (netMana.getAny() > 0) {
            return types;
          }
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  Mana types=new Mana();
  if (game == null || game.getPhase() == null) {
    return types;
  }
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game);
  for (  Permanent land : lands) {
    Abilities<Ability> manaAbilities=land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
    for (    Ability basicAbility : manaAbilities) {
      ManaAbility ability=(ManaAbility)basicAbility;
      if (!(ability instanceof ReflectingPoolManaAbility) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
          if (netMana.getAny() > 0) {
            return types;
          }
        }
      }
    }
  }
  return types;
}
Program: 158029
Project: 158029
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"String_Node_Str",source.getSourceObject(game).getName());
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<ActivatedManaAbilityImpl> mana=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
    for (    ActivatedManaAbilityImpl ability : mana) {
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<ActivatedManaAbilityImpl> mana=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
    for (    ActivatedManaAbilityImpl ability : mana) {
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
        }
      }
    }
  }
  return types;
}
Program: 158030
Project: 158030
Buggy source:
protected void copyFromCard(final Card card,final Game game){
  this.name=card.getName();
  this.abilities.clear();
  if (this.faceDown) {
    for (    Ability ability : card.getAbilities()) {
      if (ability.getWorksFaceDown()) {
        this.abilities.add(ability.copy());
      }
    }
  }
 else {
    this.abilities=card.getAbilities().copy();
  }
  this.abilities.setControllerId(this.controllerId);
  this.abilities.setSourceId(objectId);
  this.cardType.clear();
  this.cardType.addAll(card.getCardType());
  this.color=card.getColor(null).copy();
  this.frameColor=card.getFrameColor(null).copy();
  this.frameStyle=card.getFrameStyle();
  this.manaCost=card.getManaCost().copy();
  if (card instanceof PermanentCard) {
    this.maxLevelCounters=((PermanentCard)card).maxLevelCounters;
  }
  this.subtype.clear();
  this.subtype.addAll(card.getSubtype(game));
  this.supertype.clear();
  supertype.addAll(card.getSuperType());
  this.expansionSetCode=card.getExpansionSetCode();
  this.rarity=card.getRarity();
  this.cardNumber=card.getCardNumber();
  this.usesVariousArt=card.getUsesVariousArt();
  transformable=card.isTransformable();
  if (transformable) {
    this.nightCard=card.isNightCard();
    if (!this.nightCard) {
      this.secondSideCard=card.getSecondCardFace();
      this.secondSideCardClazz=this.secondSideCard.getClass();
    }
  }
  this.flipCard=card.isFlipCard();
  this.flipCardName=card.getFlipCardName();
}

Fixed version (ground truth):
protected void copyFromCard(final Card card,final Game game){
  this.name=card.getName();
  this.abilities.clear();
  if (this.faceDown) {
    for (    Ability ability : card.getAbilities()) {
      if (ability.getWorksFaceDown()) {
        this.abilities.add(ability.copy());
      }
    }
  }
 else {
    this.abilities=card.getAbilities().copy();
  }
  this.abilities.setControllerId(this.controllerId);
  this.abilities.setSourceId(objectId);
  this.cardType.clear();
  this.cardType.addAll(card.getCardType());
  this.color=card.getColor(null).copy();
  this.frameColor=card.getFrameColor(game).copy();
  this.frameStyle=card.getFrameStyle();
  this.manaCost=card.getManaCost().copy();
  if (card instanceof PermanentCard) {
    this.maxLevelCounters=((PermanentCard)card).maxLevelCounters;
  }
  this.subtype.clear();
  this.subtype.addAll(card.getSubtype(game));
  this.supertype.clear();
  supertype.addAll(card.getSuperType());
  this.expansionSetCode=card.getExpansionSetCode();
  this.rarity=card.getRarity();
  this.cardNumber=card.getCardNumber();
  this.usesVariousArt=card.getUsesVariousArt();
  transformable=card.isTransformable();
  if (transformable) {
    this.nightCard=card.isNightCard();
    if (!this.nightCard) {
      this.secondSideCard=card.getSecondCardFace();
      this.secondSideCardClazz=this.secondSideCard.getClass();
    }
  }
  this.flipCard=card.isFlipCard();
  this.flipCardName=card.getFlipCardName();
}
Program: 158031
Project: 158031
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    int destroyedCreature=0;
    FilterCreaturePermanent filter=new FilterCreaturePermanent("String_Node_Str");
    filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
    for (    Permanent creature : game.getState().getBattlefield().getActivePermanents(filter,controller.getId(),game)) {
      if (creature.destroy(source.getSourceId(),game,false)) {
        destroyedCreature++;
      }
    }
    if (destroyedCreature > 0) {
      new DamageControllerEffect(destroyedCreature + 3).apply(game,source);
    }
    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 destroyedCreature=0;
    FilterCreaturePermanent filter=new FilterCreaturePermanent("String_Node_Str");
    filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
    for (    Permanent creature : game.getState().getBattlefield().getActivePermanents(filter,controller.getId(),game)) {
      if (creature.destroy(source.getSourceId(),game,false) && game.getState().getZone(creature.getId()).equals(Zone.GRAVEYARD)) {
        destroyedCreature++;
      }
    }
    if (destroyedCreature > 0) {
      new DamageControllerEffect(destroyedCreature + 3).apply(game,source);
    }
    return true;
  }
  return false;
}
Program: 158032
Project: 158032
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null && getTargetPointer().getFirst(game,source) != null) {
    for (    Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(),getTargetPointer().getFirst(game,source),game)) {
      if (permanent.destroy(source.getSourceId(),game,false)) {
        Effect effect=new CreateTokenTargetEffect(new GoblinToken(),2);
        effect.setTargetPointer(getTargetPointer());
        effect.apply(game,source);
      }
    }
    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 && getTargetPointer().getFirst(game,source) != null) {
    for (    Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(),getTargetPointer().getFirst(game,source),game)) {
      if (permanent.destroy(source.getSourceId(),game,false)) {
        if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
          Effect effect=new CreateTokenTargetEffect(new GoblinToken(),2);
          effect.setTargetPointer(getTargetPointer());
          effect.apply(game,source);
        }
      }
    }
    return true;
  }
  return false;
}
Program: 158033
Project: 158033
Buggy source:
@Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
  setDecknamePlayerA("String_Node_Str");
  return super.createNewGameAndPlayers();
}

Fixed version (ground truth):
@Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
  setDecknamePlayerA("String_Node_Str");
  setDecknamePlayerB("String_Node_Str");
  return super.createNewGameAndPlayers();
}
Program: 158034
Project: 158034
Buggy source:
@Override public boolean apply(Game game,Ability source){
  for (  UUID opponentId : game.getOpponents(source.getControllerId())) {
    PlayerDamagedBySourceWatcher watcher=(PlayerDamagedBySourceWatcher)game.getState().getWatchers().get(PlayerDamagedBySourceWatcher.class.getSimpleName(),opponentId);
    if (watcher != null) {
      return watcher.hasSourceDoneDamage(source.getSourceId(),game);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  for (  UUID opponentId : game.getOpponents(source.getControllerId())) {
    PlayerDamagedBySourceWatcher watcher=(PlayerDamagedBySourceWatcher)game.getState().getWatchers().get(PlayerDamagedBySourceWatcher.class.getSimpleName(),opponentId);
    if (watcher != null) {
      if (watcher.hasSourceDoneDamage(source.getSourceId(),game)) {
        return true;
      }
    }
  }
  return false;
}
Program: 158035
Project: 158035
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<Ability> manaAbilities=land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
    for (    Ability basicAbility : manaAbilities) {
      ManaAbility ability=(ManaAbility)basicAbility;
      if (!ability.equals(source) && ability.definesMana()) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
          if (netMana.getAny() > 0) {
            return types;
          }
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<Ability> manaAbilities=land.getAbilities(game).getManaAbilities(Zone.BATTLEFIELD);
    for (    Ability basicAbility : manaAbilities) {
      ManaAbility ability=(ManaAbility)basicAbility;
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
          if (netMana.getAny() > 0) {
            return types;
          }
        }
      }
    }
  }
  return types;
}
Program: 158036
Project: 158036
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<Ability> manaAbilities=land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
    for (    Ability basicAbility : manaAbilities) {
      ManaAbility ability=(ManaAbility)basicAbility;
      if (!ability.equals(source) && ability.definesMana()) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
          if (netMana.getAny() > 0) {
            return types;
          }
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<Ability> manaAbilities=land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
    for (    Ability basicAbility : manaAbilities) {
      ManaAbility ability=(ManaAbility)basicAbility;
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
          if (netMana.getAny() > 0) {
            return types;
          }
        }
      }
    }
  }
  return types;
}
Program: 158037
Project: 158037
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  Mana types=new Mana();
  for (  Cost cost : source.getCosts()) {
    if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost)cost).getPermanents().isEmpty()) {
      Permanent land=((SacrificeTargetCost)cost).getPermanents().get(0);
      if (land != null) {
        Abilities<ActivatedManaAbilityImpl> manaAbilities=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
        for (        ActivatedManaAbilityImpl ability : manaAbilities) {
          if (!ability.equals(source) && ability.definesMana()) {
            for (            Mana netMana : ability.getNetMana(game)) {
              types.add(netMana);
            }
          }
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  Mana types=new Mana();
  for (  Cost cost : source.getCosts()) {
    if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost)cost).getPermanents().isEmpty()) {
      Permanent land=((SacrificeTargetCost)cost).getPermanents().get(0);
      if (land != null) {
        Abilities<ActivatedManaAbilityImpl> manaAbilities=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
        for (        ActivatedManaAbilityImpl ability : manaAbilities) {
          if (!ability.equals(source) && ability.definesMana(game)) {
            for (            Mana netMana : ability.getNetMana(game)) {
              types.add(netMana);
            }
          }
        }
      }
    }
  }
  return types;
}
Program: 158038
Project: 158038
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<ActivatedManaAbilityImpl> manaAbilities=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
    for (    ActivatedManaAbilityImpl ability : manaAbilities) {
      if (!ability.equals(source) && ability.definesMana()) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<ActivatedManaAbilityImpl> manaAbilities=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
    for (    ActivatedManaAbilityImpl ability : manaAbilities) {
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
        }
      }
    }
  }
  return types;
}
Program: 158039
Project: 158039
Buggy source:
@Test public void nagaVitalist_InteractionGiftOfParadise(){
  String giftParadise="String_Node_Str";
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",3);
  addCard(Zone.BATTLEFIELD,playerA,nagaVitalist);
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str");
  addCard(Zone.HAND,playerA,giftParadise);
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,giftParadise,"String_Node_Str");
  activateManaAbility(3,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str");
  setChoice(playerA,"String_Node_Str");
  setStopAt(3,PhaseStep.PRECOMBAT_MAIN);
  execute();
  assertLife(playerA,23);
  assertTapped(nagaVitalist,true);
  Assert.assertEquals("String_Node_Str",1,playerA.getManaPool().get(ManaType.GREEN));
}

Fixed version (ground truth):
@Test public void nagaVitalist_InteractionGiftOfParadise(){
  String giftParadise="String_Node_Str";
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",3);
  addCard(Zone.BATTLEFIELD,playerA,nagaVitalist);
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str");
  addCard(Zone.HAND,playerA,giftParadise);
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,giftParadise,"String_Node_Str");
  activateManaAbility(3,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str");
  setChoice(playerA,"String_Node_Str");
  setStopAt(3,PhaseStep.PRECOMBAT_MAIN);
  execute();
  assertLife(playerA,23);
  assertTapped(nagaVitalist,true);
  Assert.assertEquals("String_Node_Str",1,playerA.getManaPool().get(ManaType.RED));
}
Program: 158040
Project: 158040
Buggy source:
/** 
 * Used to check if the ability itself defines mana types it can produce.
 * @return
 */
@Override public boolean definesMana(){
  return !netMana.isEmpty();
}

Fixed version (ground truth):
/** 
 * Used to check if the ability itself defines mana types it can produce.
 * @return
 */
@Override public boolean definesMana(Game game){
  return !getNetMana(game).isEmpty();
}
Program: 158041
Project: 158041
Buggy source:
/** 
 * Is it allowed to undo the mana creation. It's e.g. not allowed if some game revealing information is related (like reveal the top card of the library)
 * @return 
 */
public boolean isUndoPossible(){
  return undoPossible;
}

Fixed version (ground truth):
/** 
 * Is it allowed to undo the mana creation. It's e.g. not allowed if some game revealing information is related (like reveal the top card of the library)
 * @return
 */
public boolean isUndoPossible(){
  return undoPossible;
}
Program: 158042
Project: 158042
Buggy source:
@Override public boolean definesMana(){
  return true;
}

Fixed version (ground truth):
@Override public boolean definesMana(Game game){
  return true;
}
Program: 158043
Project: 158043
Buggy source:
private Mana getManaTypes(Game game,Ability source){
  Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"String_Node_Str",source.getSourceObject(game).getName());
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<ActivatedManaAbilityImpl> mana=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
    for (    ActivatedManaAbilityImpl ability : mana) {
      if (!ability.equals(source) && ability.definesMana()) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
        }
      }
    }
  }
  return types;
}

Fixed version (ground truth):
private Mana getManaTypes(Game game,Ability source){
  Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"String_Node_Str",source.getSourceObject(game).getName());
  List<Permanent> lands=game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game);
  Mana types=new Mana();
  for (  Permanent land : lands) {
    Abilities<ActivatedManaAbilityImpl> mana=land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
    for (    ActivatedManaAbilityImpl ability : mana) {
      if (!ability.equals(source) && ability.definesMana(game)) {
        for (        Mana netMana : ability.getNetMana(game)) {
          types.add(netMana);
        }
      }
    }
  }
  return types;
}
Program: 158044
Project: 158044
Buggy source:
@Override public boolean definesMana(){
  return true;
}

Fixed version (ground truth):
@Override public boolean definesMana(Game game){
  return true;
}
Program: 158045
Project: 158045
Buggy source:
@Override public boolean definesMana(){
  return true;
}

Fixed version (ground truth):
@Override public boolean definesMana(Game game){
  return true;
}
Program: 158046
Project: 158046
Buggy source:
@Override public boolean definesMana(){
  return true;
}

Fixed version (ground truth):
@Override public boolean definesMana(Game game){
  return true;
}
Program: 158047
Project: 158047
Buggy source:
/** 
 * Used to check if the ability itself defines mana types it can produce.
 * @return
 */
boolean definesMana();

Fixed version (ground truth):
/** 
 * Used to check if the ability itself defines mana types it can produce.
 * @param game
 * @return
 */
boolean definesMana(Game game);
Program: 158048
Project: 158048
Buggy source:
/** 
 * Used to check if the ability itself defines mana types it can produce.
 * @return
 */
@Override public boolean definesMana(){
  return !netMana.isEmpty();
}

Fixed version (ground truth):
/** 
 * Used to check if the ability itself defines mana types it can produce.
 * @return
 */
@Override public boolean definesMana(Game game){
  return !netMana.isEmpty();
}
Program: 158049
Project: 158049
Buggy source:
@Override public boolean applies(GameEvent event,Ability source,Game game){
  MageObject object=game.getObject(event.getSourceId());
  Optional<Ability> ability=game.getAbility(event.getTargetId(),event.getSourceId());
  if (ability.isPresent() && object != null) {
    if (ability.get().getAbilityType() != AbilityType.MANA && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(GameEvent event,Ability source,Game game){
  MageObject object=game.getObject(event.getSourceId());
  Optional<Ability> ability=game.getAbility(event.getTargetId(),event.getSourceId());
  if (ability.isPresent() && object != null) {
    if (game.getState().getPlayersInRange(source.getControllerId(),game).contains(event.getPlayerId()) && ability.get().getAbilityType() != AbilityType.MANA && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
      return true;
    }
  }
  return false;
}
Program: 158050
Project: 158050
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player != null) {
    for (    UUID attachmentId : player.getAttachments()) {
      Permanent attachment=game.getPermanent(attachmentId);
      if (attachment != null && attachment.getSubtype(game).contains("String_Node_Str")) {
        attachment.destroy(source.getSourceId(),game,false);
      }
    }
    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) {
    ArrayList<Permanent> toDestroy=new ArrayList<>();
    for (    UUID attachmentId : controller.getAttachments()) {
      Permanent attachment=game.getPermanent(attachmentId);
      if (attachment != null && attachment.getSubtype(game).contains("String_Node_Str")) {
        toDestroy.add(attachment);
      }
    }
    for (    Permanent curse : toDestroy) {
      curse.destroy(source.getSourceId(),game,false);
    }
    return true;
  }
  return false;
}
Program: 158051
Project: 158051
Buggy source:
@Override public MagmaSpray copy(){
  return new MagmaSpray(this);
}

Fixed version (ground truth):
@Override public MagmaSprayEffect copy(){
  return new MagmaSprayEffect(this);
}
Program: 158052
Project: 158052
Buggy source:
public EnterBattlefieldPayCostOrPutGraveyardEffect(final EnterBattlefieldPayCostOrPutGraveyardEffect effect){
  super(effect);
  this.cost=effect.cost;
}

Fixed version (ground truth):
public EnterBattlefieldPayCostOrPutGraveyardEffect(final EnterBattlefieldPayCostOrPutGraveyardEffect effect){
  super(effect);
  this.cost=effect.cost.copy();
}
Program: 158053
Project: 158053
Buggy source:
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Player player=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (player != null && cost != null && sourceObject != null) {
    boolean replace=true;
    if (cost.canPay(source,source.getSourceId(),player.getId(),game)) {
      if (player.chooseUse(outcome,cost.getText() + "String_Node_Str" + sourceObject.getLogName()+ "String_Node_Str",source,game)) {
        cost.clearPaid();
        replace=!cost.pay(source,game,source.getSourceId(),source.getControllerId(),false,null);
      }
    }
    if (replace) {
      Card card=game.getCard(event.getTargetId());
      if (card != null) {
        player.moveCards(card,Zone.GRAVEYARD,source,game);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Player player=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (player != null && cost != null && sourceObject != null) {
    boolean replace=true;
    if (cost.canPay(source,source.getSourceId(),player.getId(),game)) {
      if (player.chooseUse(outcome,cost.getText().substring(0,1).toUpperCase() + cost.getText().substring(1) + "String_Node_Str"+ sourceObject.getLogName()+ "String_Node_Str",source,game)) {
        cost.clearPaid();
        replace=!cost.pay(source,game,source.getSourceId(),source.getControllerId(),false,null);
      }
    }
    if (replace) {
      Card card=game.getCard(event.getTargetId());
      if (card != null) {
        player.moveCards(card,Zone.GRAVEYARD,source,game);
      }
      return true;
    }
  }
  return false;
}
Program: 158054
Project: 158054
Buggy source:
@Override public void mouseWheelMoved(MouseWheelEvent e,TransferData transferData){
  int notches=e.getWheelRotation();
  if (enlargedWindowState != EnlargedWindowState.CLOSED) {
    if (new Date().getTime() - enlargeredViewOpened.getTime() > 1000) {
      hideEnlargedCard();
      handleOverNewView(transferData);
    }
 else     if (enlargeMode == EnlargeMode.NORMAL) {
      if (notches > 0) {
        hideEnlargedCard();
        handleOverNewView(transferData);
      }
    }
 else     if (notches < 0) {
      hideEnlargedCard();
      handleOverNewView(transferData);
    }
    return;
  }
  if (notches < 0) {
    enlargeCard(EnlargeMode.NORMAL);
  }
 else {
    enlargeCard(EnlargeMode.ALTERNATE);
  }
}

Fixed version (ground truth):
@Override public void mouseWheelMoved(MouseWheelEvent e,TransferData transferData){
  int notches=e.getWheelRotation();
  if (enlargedWindowState != EnlargedWindowState.CLOSED) {
    if (enlargeredViewOpened != null && new Date().getTime() - enlargeredViewOpened.getTime() > 1000) {
      hideEnlargedCard();
      handleOverNewView(transferData);
    }
 else     if (enlargeMode == EnlargeMode.NORMAL) {
      if (notches > 0) {
        hideEnlargedCard();
        handleOverNewView(transferData);
      }
    }
 else     if (notches < 0) {
      hideEnlargedCard();
      handleOverNewView(transferData);
    }
    return;
  }
  if (notches < 0) {
    enlargeCard(EnlargeMode.NORMAL);
  }
 else {
    enlargeCard(EnlargeMode.ALTERNATE);
  }
}
Program: 158055
Project: 158055
Buggy source:
/** 
 * Test to remove a Aftermath card from spell
 */
@Test public void testSpellAftermath(){
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",2);
  addCard(Zone.GRAVEYARD,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",3);
  addCard(Zone.HAND,playerB,"String_Node_Str");
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str","String_Node_Str");
  addTarget(playerA,playerB);
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str",NO_TARGET,"String_Node_Str");
  setStopAt(1,PhaseStep.BEGIN_COMBAT);
  execute();
  assertExileCount(playerA,"String_Node_Str",1);
  assertGraveyardCount(playerB,"String_Node_Str",0);
  assertHandCount(playerA,0);
  assertHandCount(playerB,0);
}

Fixed version (ground truth):
/** 
 * Test to remove a Aftermath card from spell
 */
@Test public void testSpellAftermath(){
  addCard(Zone.BATTLEFIELD,playerA,"String_Node_Str",3);
  addCard(Zone.GRAVEYARD,playerA,"String_Node_Str");
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",1);
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str",3);
  addCard(Zone.HAND,playerB,"String_Node_Str");
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str","String_Node_Str");
  addTarget(playerA,playerB);
  castSpell(1,PhaseStep.PRECOMBAT_MAIN,playerB,"String_Node_Str",NO_TARGET,"String_Node_Str");
  setStopAt(1,PhaseStep.BEGIN_COMBAT);
  execute();
  assertExileCount(playerB,"String_Node_Str",1);
  assertGraveyardCount(playerA,"String_Node_Str",0);
  assertExileCount(playerA,"String_Node_Str",1);
  assertGraveyardCount(playerB,"String_Node_Str",0);
  assertHandCount(playerA,0);
  assertHandCount(playerB,1);
}
Program: 158056
Project: 158056
Buggy source:
/** 
 * Used for some spells with end turn effect (e.g. Time Stop).
 * @param game
 * @param activePlayerId
 * @param source
 */
public void endTurn(Game game,UUID activePlayerId,Ability source){
  setEndTurnRequested(true);
  while (!game.getStack().isEmpty()) {
    StackObject stackObject=game.getStack().peekFirst();
    if (stackObject instanceof Spell) {
      ((Spell)stackObject).moveToExile(null,"String_Node_Str",source.getSourceId(),game);
    }
  }
  for (  UUID attackerId : game.getCombat().getAttackers()) {
    Permanent permanent=game.getPermanent(attackerId);
    if (permanent != null) {
      permanent.removeFromCombat(game);
    }
    game.getCombat().removeAttacker(attackerId,game);
  }
  for (  UUID blockerId : game.getCombat().getBlockers()) {
    Permanent permanent=game.getPermanent(blockerId);
    if (permanent != null) {
      permanent.removeFromCombat(game);
    }
  }
  game.getState().clearTriggeredAbilities();
  game.checkStateAndTriggered();
}

Fixed version (ground truth):
/** 
 * Used for some spells with end turn effect (e.g. Time Stop).
 * @param game
 * @param activePlayerId
 * @param source
 */
public void endTurn(Game game,UUID activePlayerId,Ability source){
  setEndTurnRequested(true);
  while (!game.hasEnded() && !game.getStack().isEmpty()) {
    StackObject stackObject=game.getStack().peekFirst();
    if (stackObject instanceof Spell) {
      ((Spell)stackObject).moveToExile(null,"String_Node_Str",source.getSourceId(),game);
    }
 else {
      game.getStack().remove(stackObject);
    }
  }
  for (  UUID attackerId : game.getCombat().getAttackers()) {
    Permanent permanent=game.getPermanent(attackerId);
    if (permanent != null) {
      permanent.removeFromCombat(game);
    }
    game.getCombat().removeAttacker(attackerId,game);
  }
  for (  UUID blockerId : game.getCombat().getBlockers()) {
    Permanent permanent=game.getPermanent(blockerId);
    if (permanent != null) {
      permanent.removeFromCombat(game);
    }
  }
  game.getState().clearTriggeredAbilities();
  game.checkStateAndTriggered();
}
Program: 158057
Project: 158057
Buggy source:
@Override public boolean sacrifice(UUID sourceId,Game game){
  if (isPhasedIn() && !game.replaceEvent(GameEvent.getEvent(EventType.SACRIFICE_PERMANENT,objectId,sourceId,controllerId))) {
    moveToZone(Zone.GRAVEYARD,sourceId,game,false);
    Player player=game.getPlayer(getControllerId());
    if (player != null && !game.isSimulation()) {
      game.informPlayers(player.getLogName() + "String_Node_Str" + this.getLogName());
    }
    game.fireEvent(GameEvent.getEvent(EventType.SACRIFICED_PERMANENT,objectId,sourceId,controllerId));
    game.checkStateAndTriggered();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean sacrifice(UUID sourceId,Game game){
  if (isPhasedIn() && !game.replaceEvent(GameEvent.getEvent(EventType.SACRIFICE_PERMANENT,objectId,sourceId,controllerId))) {
    moveToZone(Zone.GRAVEYARD,sourceId,game,false);
    Player player=game.getPlayer(getControllerId());
    if (player != null && !game.isSimulation()) {
      game.informPlayers(player.getLogName() + "String_Node_Str" + this.getLogName());
    }
    game.fireEvent(GameEvent.getEvent(EventType.SACRIFICED_PERMANENT,objectId,sourceId,controllerId));
    game.checkStateAndTriggered();
    game.applyEffects();
    return true;
  }
  return false;
}