nus-yam/ex-repair huggingface dataset:
Program: 159738
Project: 159738
Buggy source:
@Override public boolean isInactive(Ability source,Game game){
  if (game.getPhase().getStep().getType() == Constants.PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
    if (game.getActivePlayerId().equals(source.getControllerId())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isInactive(Ability source,Game game){
  if (game.getPhase().getStep().getType() == Constants.PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
    if (game.getActivePlayerId().equals(source.getControllerId())) {
      for (      FixedTarget fixedTarget : this.detainedObjects) {
        Permanent permanent=game.getPermanent(fixedTarget.getFirst(game,source));
        if (permanent != null) {
          permanent.addInfo(new StringBuilder("String_Node_Str").append(getId()).toString(),"String_Node_Str");
        }
      }
      return true;
    }
  }
  return false;
}
Program: 159739
Project: 159739
Buggy source:
public DetainAllRestrictionEffect(final DetainAllRestrictionEffect effect){
  super(effect);
  this.filter=effect.filter;
}

Fixed version (ground truth):
public DetainAllRestrictionEffect(final DetainAllRestrictionEffect effect){
  super(effect);
  this.detainedObjects=effect.detainedObjects;
}
Program: 159740
Project: 159740
Buggy source:
@Override public boolean apply(Game game,Ability source){
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  for (  UUID target : this.getTargetPointer().getTargets(game,source)) {
    Permanent permanent=game.getPermanent(target);
    if (permanent != null) {
      game.informPlayers("String_Node_Str" + permanent.getName());
    }
  }
  DetainRestrictionEffect effect=new DetainRestrictionEffect();
  effect.getTargetPointer().init(game,source);
  game.addEffect(effect,source);
  return true;
}
Program: 159741
Project: 159741
Buggy source:
@Override public boolean isInactive(Ability source,Game game){
  if (game.getPhase().getStep().getType() == Constants.PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
    if (game.getActivePlayerId().equals(source.getControllerId())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isInactive(Ability source,Game game){
  if (game.getPhase().getStep().getType() == Constants.PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
    if (game.getActivePlayerId().equals(source.getControllerId())) {
      for (      UUID targetId : this.getTargetPointer().getTargets(game,source)) {
        Permanent permanent=game.getPermanent(targetId);
        if (permanent != null) {
          permanent.addInfo(new StringBuilder("String_Node_Str").append(getId()).toString(),"String_Node_Str");
        }
      }
      return true;
    }
  }
  return false;
}
Program: 159742
Project: 159742
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent triggeringCreature=game.getPermanent(getTargetPointer().getFirst(game,source));
  if (triggeringCreature == null) {
    triggeringCreature=(Permanent)game.getLastKnownInformation(getTargetPointer().getFirst(game,source),Zone.BATTLEFIELD);
  }
  if (triggeringCreature != null) {
    FilterPermanent filter=new FilterPermanent("String_Node_Str" + triggeringCreature.getName());
    filter.add(Predicates.not(new PermanentIdPredicate(triggeringCreature.getId())));
    filter.add(new ControllerPredicate(Constants.TargetController.YOU));
    Set<CardTypePredicate> cardTypes=new HashSet<CardTypePredicate>();
    for (    CardType cardType : triggeringCreature.getCardType()) {
      cardTypes.add(new CardTypePredicate(cardType));
    }
    filter.add(Predicates.or(cardTypes));
    TargetPermanent target=new TargetPermanent(1,1,filter,true);
    Player controller=game.getPlayer(source.getControllerId());
    if (controller != null) {
      if (target.canChoose(controller.getId(),game) && controller.chooseTarget(outcome,target,source,game)) {
        Permanent returningCreature=game.getPermanent(target.getFirstTarget());
        if (returningCreature != null) {
          if (returningCreature.moveToZone(Zone.HAND,source.getSourceId(),game,true)) {
            game.informPlayers(new StringBuilder("String_Node_Str").append(returningCreature.getName()).append("String_Node_Str").toString());
            return true;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent triggeringCreature=game.getPermanent(getTargetPointer().getFirst(game,source));
  if (triggeringCreature == null) {
    triggeringCreature=(Permanent)game.getLastKnownInformation(getTargetPointer().getFirst(game,source),Zone.BATTLEFIELD);
  }
  if (triggeringCreature != null) {
    FilterPermanent filter=new FilterPermanent("String_Node_Str" + triggeringCreature.getName());
    filter.add(Predicates.not(new PermanentIdPredicate(triggeringCreature.getId())));
    filter.add(new ControllerPredicate(TargetController.YOU));
    Set<CardTypePredicate> cardTypes=new HashSet<CardTypePredicate>();
    for (    CardType cardType : triggeringCreature.getCardType()) {
      cardTypes.add(new CardTypePredicate(cardType));
    }
    filter.add(Predicates.or(cardTypes));
    TargetPermanent target=new TargetPermanent(1,1,filter,true);
    Player controller=game.getPlayer(source.getControllerId());
    if (controller != null) {
      if (target.canChoose(controller.getId(),game) && controller.chooseTarget(outcome,target,source,game)) {
        Permanent returningCreature=game.getPermanent(target.getFirstTarget());
        if (returningCreature != null) {
          if (returningCreature.moveToZone(Zone.HAND,source.getSourceId(),game,true)) {
            game.informPlayers(new StringBuilder("String_Node_Str").append(returningCreature.getName()).append("String_Node_Str").toString());
            return true;
          }
        }
      }
    }
  }
  return false;
}
Program: 159743
Project: 159743
Buggy source:
@Override public boolean apply(Game game,Ability source){
  int amount=source.getManaCostsToPay().getX();
  if (amount > 0) {
    Permanent permanent=game.getPermanent(getTargetPointer().getFirst(game,source));
    if (permanent != null) {
      permanent.damage(amount,source.getSourceId(),game,true,false);
    }
 else {
      Player player=game.getPlayer(getTargetPointer().getFirst(game,source));
      if (player != null) {
        player.damage(amount,source.getSourceId(),game,false,true);
      }
 else {
        return false;
      }
    }
    Player controller=game.getPlayer(source.getSourceId());
    if (controller != null) {
      controller.gainLife(amount,game);
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  int amount=source.getManaCostsToPay().getX();
  if (amount > 0) {
    Permanent permanent=game.getPermanent(getTargetPointer().getFirst(game,source));
    if (permanent != null) {
      permanent.damage(amount,source.getSourceId(),game,true,false);
    }
 else {
      Player player=game.getPlayer(getTargetPointer().getFirst(game,source));
      if (player != null) {
        player.damage(amount,source.getSourceId(),game,false,true);
      }
 else {
        return false;
      }
    }
    Player controller=game.getPlayer(source.getControllerId());
    if (controller != null) {
      controller.gainLife(amount,game);
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 159744
Project: 159744
Buggy source:
@Override public int calculate(Game game,Ability sourceAbility){
  Card sourceCard=game.getCard(sourceAbility.getSourceId());
  if (sourceCard != null) {
    for (    Object cost : sourceAbility.getCosts()) {
      if (cost instanceof SacrificeTargetCost) {
        Permanent p=(Permanent)game.getLastKnownInformation(((SacrificeTargetCost)cost).getPermanents().get(0).getId(),Constants.Zone.BATTLEFIELD);
        return -1 * p.getPower().getValue();
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int calculate(Game game,Ability sourceAbility){
  Card sourceCard=game.getCard(sourceAbility.getSourceId());
  if (sourceCard != null) {
    for (    Object cost : sourceAbility.getCosts()) {
      if (cost instanceof SacrificeTargetCost) {
        Permanent p=(Permanent)game.getLastKnownInformation(((SacrificeTargetCost)cost).getPermanents().get(0).getId(),Zone.BATTLEFIELD);
        return -1 * p.getPower().getValue();
      }
    }
  }
  return 0;
}
Program: 159745
Project: 159745
Buggy source:
@Override public void init(Ability source,Game game){
  super.init(source,game);
  if (this.affectedObjectsSet) {
    for (    Permanent perm : game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game)) {
      if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
        objects.add(perm.getId());
      }
    }
  }
}

Fixed version (ground truth):
@Override public void init(Ability source,Game game){
  super.init(source,game);
  if (this.affectedObjectsSet) {
    for (    Permanent perm : game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game)) {
      if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
        objects.add(perm.getId());
      }
    }
  }
  if (lockedInPT) {
    power=new StaticValue(power.calculate(game,source));
    toughness=new StaticValue(toughness.calculate(game,source));
  }
}
Program: 159746
Project: 159746
Buggy source:
public BoostAllEffect(final BoostAllEffect effect){
  super(effect);
  this.power=effect.power;
  this.toughness=effect.toughness;
  this.filter=effect.filter.copy();
  this.excludeSource=effect.excludeSource;
  this.staticText=effect.staticText;
}

Fixed version (ground truth):
public BoostAllEffect(final BoostAllEffect effect){
  super(effect);
  this.power=effect.power;
  this.toughness=effect.toughness;
  this.filter=effect.filter.copy();
  this.excludeSource=effect.excludeSource;
  this.lockedInPT=effect.lockedInPT;
}
Program: 159747
Project: 159747
Buggy source:
@Override public boolean apply(Game game,Ability source){
  List<String> names=new ArrayList<String>();
  for (  Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(),game)) {
    if (permanent.hasSubtype("String_Node_Str")) {
      if (!names.contains(permanent.getName())) {
        names.add(permanent.getName());
      }
    }
  }
  if (names.size() >= 10) {
    Player controller=game.getPlayer(source.getControllerId());
    if (controller != null) {
      controller.won(game);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  List<String> names=new ArrayList<String>();
  for (  Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
    if (permanent.hasSubtype("String_Node_Str")) {
      if (!names.contains(permanent.getName())) {
        names.add(permanent.getName());
      }
    }
  }
  if (names.size() >= 10) {
    Player controller=game.getPlayer(source.getControllerId());
    if (controller != null) {
      controller.won(game);
    }
  }
  return false;
}
Program: 159749
Project: 159749
Buggy source:
public SetPowerToughnessAllEffect(final SetPowerToughnessAllEffect effect){
  super(effect);
  this.power=effect.power;
  this.toughness=effect.toughness;
  this.filter=effect.filter;
  this.lockedIn=effect.lockedIn;
}

Fixed version (ground truth):
public SetPowerToughnessAllEffect(final SetPowerToughnessAllEffect effect){
  super(effect);
  this.power=effect.power;
  this.toughness=effect.toughness;
  this.filter=effect.filter;
  this.lockedInPT=effect.lockedInPT;
}
Program: 159750
Project: 159750
Buggy source:
@Override public void init(Ability source,Game game){
  super.init(source,game);
  for (  Permanent perm : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(),source.getControllerId(),source.getSourceId(),game)) {
    objects.add(perm.getId());
  }
  if (lockedIn) {
    power=new StaticValue(power.calculate(game,source));
    toughness=new StaticValue(toughness.calculate(game,source));
  }
}

Fixed version (ground truth):
@Override public void init(Ability source,Game game){
  super.init(source,game);
  for (  Permanent perm : game.getBattlefield().getActivePermanents(filter,source.getControllerId(),source.getSourceId(),game)) {
    objects.add(perm.getId());
  }
  if (lockedInPT) {
    power=new StaticValue(power.calculate(game,source));
    toughness=new StaticValue(toughness.calculate(game,source));
  }
}
Program: 159751
Project: 159751
Buggy source:
@Override public String getText(Mode mode){
  StringBuilder sb=new StringBuilder();
  sb.append(filter.getMessage());
  if (filter.getMessage().startsWith("String_Node_Str")) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  sb.append(power).append("String_Node_Str").append(toughness);
  if (!duration.toString().isEmpty()) {
    sb.append("String_Node_Str").append(duration.toString());
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String getText(Mode mode){
  StringBuilder sb=new StringBuilder();
  sb.append(filter.getMessage());
  if (filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("String_Node_Str")) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  sb.append(power).append("String_Node_Str").append(toughness);
  if (!duration.toString().isEmpty()) {
    sb.append("String_Node_Str").append(duration.toString());
  }
  return sb.toString();
}
Program: 159752
Project: 159752
Buggy source:
public EvokeAbility(final EvokeAbility ability){
  super(ability);
}

Fixed version (ground truth):
public EvokeAbility(final EvokeAbility ability){
  super(ability);
  this.evokeCosts.addAll(ability.evokeCosts);
}
Program: 159754
Project: 159754
Buggy source:
public VoiceOfResurgenceToken(){
  super("String_Node_Str","String_Node_Str");
  cardType.add(Constants.CardType.CREATURE);
  color.setGreen(true);
  color.setWhite(true);
  subtype.add("String_Node_Str");
  power=new MageInt(0);
  toughness=new MageInt(0);
  FilterControlledPermanent filter=new FilterControlledPermanent();
  filter.add(new CardTypePredicate(CardType.CREATURE));
  DynamicValue creaturesControlled=new PermanentsOnBattlefieldCount(filter);
  this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD,new SetPowerToughnessSourceEffect(creaturesControlled,Constants.Duration.EndOfGame)));
}

Fixed version (ground truth):
public VoiceOfResurgenceToken(){
  super("String_Node_Str","String_Node_Str");
  cardType.add(Constants.CardType.CREATURE);
  color.setGreen(true);
  color.setWhite(true);
  subtype.add("String_Node_Str");
  power=new MageInt(0);
  toughness=new MageInt(0);
  FilterControlledPermanent filter=new FilterControlledPermanent("String_Node_Str");
  filter.add(new CardTypePredicate(CardType.CREATURE));
  DynamicValue creaturesControlled=new PermanentsOnBattlefieldCount(filter);
  this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD,new SetPowerToughnessSourceEffect(creaturesControlled,Constants.Duration.EndOfGame)));
}
Program: 159755
Project: 159755
Buggy source:
@Override public int gainLife(int amount,Game game){
  if (!canGainLife) {
    return 0;
  }
  GameEvent event=new GameEvent(GameEvent.EventType.GAIN_LIFE,playerId,playerId,playerId,amount,false);
  if (!game.replaceEvent(event)) {
    this.life+=event.getAmount();
    game.fireEvent(GameEvent.getEvent(GameEvent.EventType.GAINED_LIFE,playerId,playerId,playerId,amount));
    return amount;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int gainLife(int amount,Game game){
  if (!canGainLife) {
    return 0;
  }
  GameEvent event=new GameEvent(GameEvent.EventType.GAIN_LIFE,playerId,playerId,playerId,amount,false);
  if (!game.replaceEvent(event)) {
    this.life+=event.getAmount();
    game.fireEvent(GameEvent.getEvent(GameEvent.EventType.GAINED_LIFE,playerId,playerId,playerId,event.getAmount()));
    return event.getAmount();
  }
  return 0;
}
Program: 159756
Project: 159756
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.LIBRARY) {
    Spell spell=game.getStack().getSpell(event.getTargetId());
    if (spell != null && spell.getControllerId().equals(super.getControllerId()) && spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)) {
      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){
  if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.LIBRARY) {
    Spell spell=game.getStack().getSpell(event.getTargetId());
    if (spell != null && spell.getControllerId().equals(super.getControllerId()) && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getTargetId()));
      }
      return true;
    }
  }
  return false;
}
Program: 159757
Project: 159757
Buggy source:
@Override public DynamicValue copy(){
  return new TargetPermanentPowerCount();
}

Fixed version (ground truth):
@Override public DynamicValue copy(){
  return new TargetPermanentPowerPlusToughnessCount();
}
Program: 159758
Project: 159758
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getTargets().getFirstTarget());
  Player controller=game.getPlayer(source.getControllerId());
  FilterControlledPermanent filter=new FilterControlledPermanent("String_Node_Str");
  filter.add(new CardTypePredicate(CardType.CREATURE));
  filter.add(new ControllerPredicate(TargetController.YOU));
  TargetControlledPermanent target=new TargetControlledPermanent(1,1,filter,false);
  if (target.canChoose(player.getId(),game)) {
    player.choose(Outcome.Sacrifice,target,source.getSourceId(),game);
    Permanent permanent=game.getPermanent(target.getFirstTarget());
    if (permanent != null) {
      controller.gainLife(permanent.getToughness().getValue(),game);
      return permanent.sacrifice(source.getId(),game);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getTargets().getFirstTarget());
  Player controller=game.getPlayer(source.getControllerId());
  FilterControlledPermanent filter=new FilterControlledPermanent("String_Node_Str");
  filter.add(new CardTypePredicate(CardType.CREATURE));
  filter.add(new ControllerPredicate(TargetController.YOU));
  TargetControlledPermanent target=new TargetControlledPermanent(1,1,filter,false);
  target.setRequired(true);
  if (target.canChoose(player.getId(),game)) {
    player.choose(Outcome.Sacrifice,target,source.getSourceId(),game);
    Permanent permanent=game.getPermanent(target.getFirstTarget());
    if (permanent != null) {
      controller.gainLife(permanent.getToughness().getValue(),game);
      return permanent.sacrifice(source.getId(),game);
    }
    return true;
  }
  return false;
}
Program: 159759
Project: 159759
Buggy source:
@Override public WerewolfRansackerEffect copy(){
  return new WerewolfRansackerEffect(this);
}

Fixed version (ground truth):
@Override public AfflictedDeserter copy(){
  return new AfflictedDeserter(this);
}
Program: 159760
Project: 159760
Buggy source:
@Override public WerewolfRansacker copy(){
  return new WerewolfRansacker(this);
}

Fixed version (ground truth):
@Override public WerewolfRansackerEffect copy(){
  return new WerewolfRansackerEffect(this);
}
Program: 159761
Project: 159761
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player != null) {
    TargetControlledCreaturePermanent target=new TargetControlledCreaturePermanent();
    if (player.choose(this.outcome,target,source.getSourceId(),game)) {
      Permanent permanent=game.getPermanent(target.getFirstTarget());
      if (permanent != null) {
        return permanent.moveToZone(Constants.Zone.HAND,source.getId(),game,false);
      }
    }
    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) {
    TargetControlledCreaturePermanent target=new TargetControlledCreaturePermanent();
    target.setRequired(true);
    if (player.choose(this.outcome,target,source.getSourceId(),game)) {
      Permanent permanent=game.getPermanent(target.getFirstTarget());
      if (permanent != null) {
        return permanent.moveToZone(Constants.Zone.HAND,source.getId(),game,false);
      }
    }
    return true;
  }
  return false;
}
Program: 159763
Project: 159763
Buggy source:
@Override public void watch(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.UNTAP_STEP_PRE) {
    reset();
  }
  if (event.getType() == GameEvent.EventType.DREW_CARD && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) {
    UUID playerId=event.getPlayerId();
    if (playerId != null) {
      Integer amount=amountOfCardsDrawnThisTurn.get(playerId);
      if (amount == null) {
        amount=Integer.valueOf(1);
      }
 else {
        amount=Integer.valueOf(amount + 1);
      }
      amountOfCardsDrawnThisTurn.put(playerId,amount);
    }
  }
}

Fixed version (ground truth):
@Override public void watch(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.UNTAP_STEP_PRE) {
    reset();
  }
  if (event.getType() == GameEvent.EventType.DREW_CARD && game.getPhase() != null && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) {
    UUID playerId=event.getPlayerId();
    if (playerId != null) {
      Integer amount=amountOfCardsDrawnThisTurn.get(playerId);
      if (amount == null) {
        amount=Integer.valueOf(1);
      }
 else {
        amount=Integer.valueOf(amount + 1);
      }
      amountOfCardsDrawnThisTurn.put(playerId,amount);
    }
  }
}
Program: 159764
Project: 159764
Buggy source:
@Override public boolean apply(Game game,Ability source){
  int damage=0;
  int xValue=source.getManaCostsToPay().getX();
  for (  UUID opponentId : game.getOpponents(source.getControllerId())) {
    damage+=game.getPlayer(opponentId).damage(xValue,source.getSourceId(),game,false,true);
  }
  game.getPlayer(source.getControllerId()).gainLife(damage,game);
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  int damage=0;
  int xValue=source.getManaCostsToPay().getX();
  for (  UUID opponentId : game.getOpponents(source.getControllerId())) {
    damage+=game.getPlayer(opponentId).damage(xValue * 2,source.getSourceId(),game,false,true);
  }
  game.getPlayer(source.getControllerId()).gainLife(damage,game);
  return true;
}
Program: 159765
Project: 159765
Buggy source:
private boolean targetsMyPermanent(UUID id,UUID controllerId,Game game){
  StackObject spell=game.getStack().getStackObject(id);
  if (spell != null) {
    Ability ability=spell.getStackAbility();
    for (    UUID permanentId : ability.getTargets().get(0).getTargets()) {
      Permanent permanent=game.getPermanent(permanentId);
      if (permanent != null && permanent.getControllerId().equals(controllerId)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean targetsMyPermanent(UUID id,UUID controllerId,Game game){
  StackObject spell=game.getStack().getStackObject(id);
  if (spell != null) {
    Ability ability=spell.getStackAbility();
    for (    Target target : ability.getTargets()) {
      for (      UUID permanentId : target.getTargets()) {
        Permanent permanent=game.getPermanent(permanentId);
        if (permanent != null && permanent.getControllerId().equals(controllerId)) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 159766
Project: 159766
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent sourcePermanent=game.getPermanent(source.getFirstTarget());
  if (sourcePermanent == null) {
    game.getLastKnownInformation(source.getFirstTarget(),Zone.BATTLEFIELD);
  }
  Permanent targetPermanent=(Permanent)game.getPermanent(source.getTargets().get(1).getFirstTarget());
  if (sourcePermanent != null && targetPermanent != null) {
    targetPermanent.damage(sourcePermanent.getPower().getValue(),sourcePermanent.getId(),game,true,false);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent sourcePermanent=game.getPermanent(source.getFirstTarget());
  if (sourcePermanent == null) {
    sourcePermanent=(Permanent)game.getLastKnownInformation(source.getFirstTarget(),Zone.BATTLEFIELD);
  }
  Permanent targetPermanent=(Permanent)game.getPermanent(source.getTargets().get(1).getFirstTarget());
  if (sourcePermanent != null && targetPermanent != null) {
    targetPermanent.damage(sourcePermanent.getPower().getValue(),sourcePermanent.getId(),game,true,false);
    return true;
  }
  return false;
}
Program: 159767
Project: 159767
Buggy source:
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Permanent permanent=((ZoneChangeEvent)event).getTarget();
  if (permanent != null) {
    MageInt toughness=permanent.getToughness();
    Player player=(Player)this.getValue("String_Node_Str");
    player.gainLife(toughness.getValue(),game);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Permanent permanent=((ZoneChangeEvent)event).getTarget();
  if (permanent != null) {
    MageInt toughness=permanent.getToughness();
    Player player=game.getPlayer(source.getControllerId());
    if (player != null) {
      player.gainLife(toughness.getValue(),game);
    }
  }
  return false;
}
Program: 159768
Project: 159768
Buggy source:
protected Card pickTarget(List<Card> cards,Outcome outcome,Target target,Ability source,Game game){
  Card card;
  while (!cards.isEmpty()) {
    if (outcome.isGood()) {
      card=pickBestCard(cards,null,target,source,game);
    }
 else {
      card=pickWorstCard(cards,null,target,source,game);
    }
    if (source != null) {
      if (target.canTarget(card.getId(),source,game)) {
        return card;
      }
    }
 else {
      return card;
    }
    cards.remove(card);
  }
  return null;
}

Fixed version (ground truth):
protected Card pickTarget(List<Card> cards,Outcome outcome,Target target,Ability source,Game game){
  Card card;
  while (!cards.isEmpty()) {
    if (outcome.isGood()) {
      card=pickBestCard(cards,null,target,source,game);
    }
 else {
      card=pickWorstCard(cards,null,target,source,game);
    }
    if (source != null) {
      if (target.canTarget(card.getId(),this.getId(),source,game)) {
        return card;
      }
    }
 else {
      return card;
    }
    cards.remove(card);
  }
  return null;
}
Program: 159769
Project: 159769
Buggy source:
boolean canTarget(UUID id,Ability source,Game game);

Fixed version (ground truth):
boolean canTarget(UUID id,UUID playerId,Ability source,Game game);
Program: 159770
Project: 159770
Buggy source:
@Override public boolean canTarget(UUID id,Ability source,Game game){
  return canTarget(id,game);
}

Fixed version (ground truth):
@Override public boolean canTarget(UUID id,UUID playerId,Ability source,Game game){
  return canTarget(id,source,game);
}
Program: 159771
Project: 159771
Buggy source:
@Override public boolean canTarget(UUID id,Ability source,Game game){
  Card card=game.getCard(id);
  if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD)   if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id))   return filter.match(card,game);
  return false;
}

Fixed version (ground truth):
@Override public boolean canTarget(UUID id,UUID playerId,Ability ability,Game game){
  Card card=game.getCard(id);
  if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD)   if (game.getPlayer(playerId).getGraveyard().contains(id)) {
    return filter.match(card,game);
  }
  return false;
}
Program: 159772
Project: 159772
Buggy source:
@Override public boolean canTarget(UUID id,Ability source,Game game){
  Permanent permanent=game.getPermanent(id);
  Player player=game.getPlayer(id);
  if (source != null) {
    MageObject targetSource=game.getObject(source.getSourceId());
    if (permanent != null) {
      return permanent.canBeTargetedBy(targetSource,source.getControllerId(),game) && filter.match(permanent,source.getSourceId(),source.getControllerId(),game);
    }
    if (player != null) {
      return player.canBeTargetedBy(targetSource,game) && filter.match(player,game);
    }
  }
  if (permanent != null) {
    return filter.match(permanent,game);
  }
  if (player != null) {
    return filter.match(player,game);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canTarget(UUID id,UUID playerId,Ability source,Game game){
  return canTarget(id,source,game);
}
Program: 159773
Project: 159773
Buggy source:
@Override public boolean canTarget(UUID id,Ability source,Game game){
  Permanent permanent=game.getPermanent(id);
  if (permanent != null) {
    if (source != null) {
      MageObject targetSource=game.getObject(source.getSourceId());
      return permanent.canBeTargetedBy(targetSource,source.getControllerId(),game) && filter.match(permanent,source.getSourceId(),source.getControllerId(),game);
    }
 else {
      return filter.match(permanent,game);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canTarget(UUID id,UUID playerId,Ability source,Game game){
  return canTarget(id,source,game);
}
Program: 159774
Project: 159774
Buggy source:
@Override public boolean canTarget(UUID id,Ability source,Game game){
  Player player=game.getPlayer(id);
  MageObject targetSource=game.getObject(attackerId);
  if (player != null) {
    return player.canBeTargetedBy(targetSource,game) && filter.match(player,game);
  }
  Permanent permanent=game.getPermanent(id);
  if (permanent != null) {
    UUID controllerId=null;
    if (source != null) {
      controllerId=source.getControllerId();
    }
    return permanent.canBeTargetedBy(targetSource,controllerId,game) && filter.match(permanent,game);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canTarget(UUID id,UUID playerId,Ability source,Game game){
  return canTarget(id,source,game);
}
Program: 159775
Project: 159775
Buggy source:
@Override public boolean canTarget(UUID id,Ability source,Game game){
  Permanent permanent=game.getPermanent(id);
  if (permanent != null) {
    if (source != null) {
      MageObject targetSource=game.getObject(source.getSourceId());
      return permanent.canBeTargetedBy(targetSource,source.getControllerId(),game) && filter.match(permanent,source.getSourceId(),source.getControllerId(),game);
    }
 else {
      return filter.match(permanent,game);
    }
  }
  Spell spell=game.getStack().getSpell(id);
  if (spell != null) {
    return filter.match(spell,game);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canTarget(UUID id,UUID playerId,Ability source,Game game){
  return canTarget(id,source,game);
}
Program: 159776
Project: 159776
Buggy source:
public boolean putOntoBattlefield(int amount,Game game,UUID sourceId,UUID controllerId){
  Card source=game.getCard(sourceId);
  String setCode=source != null ? source.getExpansionSetCode() : null;
  GameEvent event=GameEvent.getEvent(EventType.CREATE_TOKEN,null,sourceId,controllerId,amount);
  if (!game.replaceEvent(event)) {
    amount=event.getAmount();
    for (int i=0; i < amount; i++) {
      PermanentToken permanent=new PermanentToken(this,controllerId,setCode,game);
      game.getState().addCard(permanent);
      game.addPermanent(permanent);
      this.lastAddedTokenId=permanent.getId();
      permanent.entersBattlefield(sourceId,game,Zone.OUTSIDE,true);
      game.applyEffects();
      game.fireEvent(new ZoneChangeEvent(permanent,controllerId,Zone.OUTSIDE,Zone.BATTLEFIELD));
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean putOntoBattlefield(int amount,Game game,UUID sourceId,UUID controllerId){
  Card source=game.getCard(sourceId);
  String setCode=source != null ? source.getExpansionSetCode() : null;
  GameEvent event=GameEvent.getEvent(EventType.CREATE_TOKEN,null,sourceId,controllerId,amount);
  if (!game.replaceEvent(event)) {
    amount=event.getAmount();
    for (int i=0; i < amount; i++) {
      PermanentToken permanent=new PermanentToken(this,controllerId,setCode,game);
      game.getState().addCard(permanent);
      game.addPermanent(permanent);
      this.lastAddedTokenId=permanent.getId();
      game.setScopeRelevant(true);
      game.applyEffects();
      permanent.entersBattlefield(sourceId,game,Zone.OUTSIDE,true);
      game.setScopeRelevant(false);
      game.applyEffects();
      game.fireEvent(new ZoneChangeEvent(permanent,controllerId,Zone.OUTSIDE,Zone.BATTLEFIELD));
    }
    return true;
  }
  return false;
}
Program: 159777
Project: 159777
Buggy source:
private void setText(){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  String p=power.toString();
  if (!p.startsWith("String_Node_Str"))   sb.append("String_Node_Str");
  sb.append(p).append("String_Node_Str");
  String t=toughness.toString();
  if (!t.startsWith("String_Node_Str")) {
    if (p.startsWith("String_Node_Str"))     sb.append("String_Node_Str");
 else     sb.append("String_Node_Str");
  }
  sb.append(t);
  if (duration != Duration.WhileOnBattlefield)   sb.append("String_Node_Str").append(duration.toString());
  String message=power.getMessage();
  if (message.length() == 0)   message=toughness.getMessage();
  if (message.length() > 0) {
    sb.append("String_Node_Str");
  }
  sb.append(message);
  staticText=sb.toString();
}

Fixed version (ground truth):
private void setText(){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  String p=power.toString();
  if (!p.startsWith("String_Node_Str"))   sb.append("String_Node_Str");
  sb.append(p).append("String_Node_Str");
  String t=toughness.toString();
  if (!t.startsWith("String_Node_Str")) {
    if (t.startsWith("String_Node_Str"))     sb.append("String_Node_Str");
 else     sb.append("String_Node_Str");
  }
  sb.append(t);
  if (duration != Duration.WhileOnBattlefield)   sb.append("String_Node_Str").append(duration.toString());
  String message=power.getMessage();
  if (message.length() == 0)   message=toughness.getMessage();
  if (message.length() > 0) {
    sb.append("String_Node_Str");
  }
  sb.append(message);
  staticText=sb.toString();
}
Program: 159778
Project: 159778
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
    Permanent land=game.getPermanent(event.getTargetId());
    if (land != null && filter.match(land,game)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
    Permanent land=game.getPermanent(event.getTargetId());
    if (land != null && filter.match(land,this.getSourceId(),this.getControllerId(),game)) {
      return true;
    }
  }
  return false;
}
Program: 159780
Project: 159780
Buggy source:
@Override public BloodSeeker copy(){
  return new BloodSeeker(this);
}

Fixed version (ground truth):
@Override public BloodSeekerTriggeredAbility copy(){
  return new BloodSeekerTriggeredAbility(this);
}
Program: 159781
Project: 159781
Buggy source:
@Override public boolean isLegal(Ability source,Game game){
  for (  UUID targetId : targets.keySet()) {
    Card card=game.getCard(targetId);
    if (card != null) {
      if (zoneChangeCounters.containsKey(targetId) && zoneChangeCounters.get(targetId) != card.getZoneChangeCounter()) {
        continue;
      }
    }
    if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET,targetId,source.getId(),source.getControllerId()))) {
      continue;
    }
    if (canTarget(targetId,source,game)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isLegal(Ability source,Game game){
  for (  UUID targetId : targets.keySet()) {
    Card card=game.getCard(targetId);
    if (card != null) {
      if (zoneChangeCounters.containsKey(targetId) && zoneChangeCounters.get(targetId) != card.getZoneChangeCounter()) {
        continue;
      }
    }
    if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET,targetId,source.getId(),source.getControllerId()))) {
      continue;
    }
    if (canTarget(targetId,source,game)) {
      return true;
    }
  }
  if (minNumberOfTargets == 0 && targets.isEmpty()) {
    return true;
  }
  return false;
}
Program: 159782
Project: 159782
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
    ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
    Card card=zEvent.getTarget();
    if (card != null && card.getCardType().contains(CardType.CREATURE)) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
    EntersTheBattlefieldEvent zEvent=(EntersTheBattlefieldEvent)event;
    Card card=zEvent.getTarget();
    if (card != null && card.getCardType().contains(CardType.CREATURE)) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      }
      return true;
    }
  }
  return false;
}
Program: 159783
Project: 159783
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
    ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
    Card card=zEvent.getTarget();
    if (card != null && card.getCardType().contains(CardType.CREATURE)) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
    EntersTheBattlefieldEvent zEvent=(EntersTheBattlefieldEvent)event;
    Card card=zEvent.getTarget();
    if (card != null && card.getCardType().contains(CardType.CREATURE)) {
      for (      Effect effect : this.getEffects()) {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      }
      return true;
    }
  }
  return false;
}
Program: 159784
Project: 159784
Buggy source:
@Override public void addAbility(Ability ability,UUID sourceId,Game game){
  if (!abilities.containsKey(ability.getId())) {
    Ability copyAbility=ability.copy();
    copyAbility.setControllerId(controllerId);
    copyAbility.setSourceId(objectId);
    game.getState().addAbility(copyAbility,sourceId,this);
    abilities.add(copyAbility);
  }
}

Fixed version (ground truth):
@Override public void addAbility(Ability ability,UUID sourceId,Game game){
  if (!abilities.containsKey(ability.getId())) {
    Ability copyAbility=ability.copy();
    copyAbility.newId();
    copyAbility.setControllerId(controllerId);
    copyAbility.setSourceId(objectId);
    game.getState().addAbility(copyAbility,sourceId,this);
    abilities.add(copyAbility);
  }
}
Program: 159785
Project: 159785
Buggy source:
@Override public boolean isGameOver(){
  if (state.isGameOver()) {
    return true;
  }
  int remainingPlayers=0;
  int numLosers=0;
  for (  Player player : state.getPlayers().values()) {
    if (!player.hasLeft()) {
      remainingPlayers++;
    }
    if (player.hasLost()) {
      numLosers++;
    }
  }
  if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) {
    state.endGame();
    endTime=new Date();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isGameOver(){
  if (state.isGameOver()) {
    return true;
  }
  int remainingPlayers=0;
  int numLosers=0;
  for (  Player player : state.getPlayers().values()) {
    if (!player.hasLeft()) {
      remainingPlayers++;
    }
    if (player.hasLost()) {
      numLosers++;
    }
  }
  if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) {
    for (    Player player : state.getPlayers().values()) {
      if (!player.hasLeft() && !player.hasLost()) {
        player.won(this);
      }
    }
    state.endGame();
    endTime=new Date();
    return true;
  }
  return false;
}
Program: 159786
Project: 159786
Buggy source:
@Override public void won(Game game){
  if (!game.replaceEvent(new GameEvent(GameEvent.EventType.WINS,null,null,playerId))) {
    if (!this.loses) {
      if (game.getPlayers().size() > 2) {
        for (        UUID opponentId : game.getOpponents(playerId)) {
          game.getPlayer(opponentId).lost(game);
        }
      }
 else {
        this.wins=true;
        game.end();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void won(Game game){
  if (!game.replaceEvent(new GameEvent(GameEvent.EventType.WINS,null,null,playerId))) {
    if (!this.loses) {
      if (game.getPlayers().size() > 2) {
        for (        UUID opponentId : game.getOpponents(playerId)) {
          Player opponent=game.getPlayer(opponentId);
          if (!opponent.hasLost()) {
            game.getPlayer(opponentId).lost(game);
          }
        }
        this.wins=true;
      }
 else {
        this.wins=true;
        game.end();
      }
    }
  }
}
Program: 159787
Project: 159787
Buggy source:
public synchronized void leaveTable(UUID userId){
  if (table.getState() == TableState.WAITING || table.getState() == TableState.STARTING) {
    table.leaveTable(userPlayerMap.get(userId));
  }
}

Fixed version (ground truth):
public synchronized void leaveTable(UUID userId){
  if (table.getState() == TableState.WAITING || table.getState() == TableState.STARTING) {
    UUID playerId=userPlayerMap.get(userId);
    if (playerId != null) {
      table.leaveTable(playerId);
      if (table.isTournament()) {
        tournament.leave(playerId);
      }
 else {
        match.leave(playerId);
      }
      User user=UserManager.getInstance().getUser(userId);
      user.removeTable(playerId);
      userPlayerMap.remove(userId);
    }
  }
}
Program: 159788
Project: 159788
Buggy source:
@Override public void leave(UUID playerId){
}

Fixed version (ground truth):
@Override public void leave(UUID playerId){
  if (players.containsKey(playerId)) {
    players.remove(playerId);
  }
}
Program: 159789
Project: 159789
Buggy source:
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Permanent toCopyToPermanent=game.getPermanent(event.getTargetId());
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (sourcePermanent != null && toCopyToPermanent != null && sourcePermanent.getAttachedTo() != null) {
    Permanent toCopyFromPermanent=game.getPermanent(sourcePermanent.getAttachedTo());
    if (toCopyToPermanent != null) {
      game.copyPermanent(toCopyFromPermanent,toCopyToPermanent,source,new EmptyApplyToPermanent());
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Permanent toCopyToPermanent=game.getPermanent(event.getTargetId());
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (sourcePermanent != null && toCopyToPermanent != null && sourcePermanent.getAttachedTo() != null) {
    Permanent toCopyFromPermanent=game.getPermanent(sourcePermanent.getAttachedTo());
    if (toCopyFromPermanent != null) {
      game.copyPermanent(toCopyFromPermanent,toCopyToPermanent,source,new EmptyApplyToPermanent());
    }
  }
  return false;
}
Program: 159790
Project: 159790
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (sourcePermanent != null) {
    int amount=sourcePermanent.getCounters().getCount(CounterType.P1P1);
    if (amount > 0) {
      sourcePermanent.getCounters().addCounter(CounterType.P1P1.createInstance(amount));
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (sourcePermanent != null) {
    int amount=sourcePermanent.getCounters().getCount(CounterType.P1P1);
    if (amount > 0) {
      sourcePermanent.addCounters(CounterType.P1P1.createInstance(amount),game);
    }
    return true;
  }
  return false;
}
Program: 159791
Project: 159791
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Card card=game.getCard(source.getFirstTarget());
  if (card != null) {
    Player player=game.getPlayer(card.getOwnerId());
    if (player != null) {
      card.moveToZone(Zone.HAND,source.getId(),game,false);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Card card=game.getCard(source.getFirstTarget());
  if (card != null) {
    Player player=game.getPlayer(card.getOwnerId());
    if (player != null) {
      card.moveToZone(Zone.HAND,source.getSourceId(),game,false);
      return true;
    }
  }
  return false;
}
Program: 159792
Project: 159792
Buggy source:
public CardImpl(final CardImpl card){
  super(card);
  ownerId=card.ownerId;
  cardNumber=card.cardNumber;
  expansionSetCode=card.expansionSetCode;
  rarity=card.rarity;
  for (  Watcher watcher : (List<Watcher>)card.watchers) {
    this.watchers.add(watcher.copy());
  }
  faceDown=card.faceDown;
  canTransform=card.canTransform;
  if (canTransform) {
    secondSideCard=card.secondSideCard;
    nightCard=card.nightCard;
  }
  if (card.info != null) {
    info=new HashMap<String,String>();
    info.putAll(card.info);
  }
  usesVariousArt=card.usesVariousArt;
  this.counters=card.counters.copy();
}

Fixed version (ground truth):
public CardImpl(final CardImpl card){
  super(card);
  ownerId=card.ownerId;
  cardNumber=card.cardNumber;
  expansionSetCode=card.expansionSetCode;
  rarity=card.rarity;
  for (  Watcher watcher : (List<Watcher>)card.watchers) {
    this.watchers.add(watcher.copy());
  }
  faceDown=card.faceDown;
  canTransform=card.canTransform;
  if (canTransform) {
    secondSideCard=card.secondSideCard;
    nightCard=card.nightCard;
  }
  zoneChangeCounter=card.zoneChangeCounter;
  if (card.info != null) {
    info=new HashMap<String,String>();
    info.putAll(card.info);
  }
  usesVariousArt=card.usesVariousArt;
  this.counters=card.counters.copy();
}