nus-yam/ex-repair huggingface dataset:
Program: 160089
Project: 160089
Buggy source:
@Override public boolean moveToZone(Zone toZone,UUID sourceId,Game game,boolean flag){
  Zone fromZone=game.getState().getZone(objectId);
  Player controller=game.getPlayer(controllerId);
  if (controller != null && controller.removeFromBattlefield(this,game)) {
    ZoneChangeEvent event=new ZoneChangeEvent(this,sourceId,controllerId,fromZone,toZone);
    if (!game.replaceEvent(event)) {
      if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
        for (        ContinuousEffect effect : game.getContinuousEffects().getLayeredEffects(game)) {
          if (effect.getAffectedObjects().contains(getId())) {
            effect.getAffectedObjects().remove(getId());
          }
        }
      }
      Player owner=game.getPlayer(ownerId);
      game.rememberLKI(objectId,Zone.BATTLEFIELD,this);
      if (owner != null) {
switch (event.getToZone()) {
case GRAVEYARD:
          owner.putInGraveyard(card,game,!flag);
        break;
case HAND:
      owner.getHand().add(card);
    break;
case EXILED:
  game.getExile().getPermanentExile().add(card);
break;
case LIBRARY:
if (flag) owner.getLibrary().putOnTop(card,game);
 else owner.getLibrary().putOnBottom(card,game);
break;
case BATTLEFIELD:
break;
}
game.setZone(objectId,event.getToZone());
game.fireEvent(event);
return game.getState().getZone(objectId) == toZone;
}
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean moveToZone(Zone toZone,UUID sourceId,Game game,boolean flag){
  Zone fromZone=game.getState().getZone(objectId);
  Player controller=game.getPlayer(controllerId);
  if (controller != null && controller.removeFromBattlefield(this,game)) {
    ZoneChangeEvent event=new ZoneChangeEvent(this,sourceId,controllerId,fromZone,toZone);
    if (!game.replaceEvent(event)) {
      if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
        game.resetForSourceId(getId());
      }
      Player owner=game.getPlayer(ownerId);
      game.rememberLKI(objectId,Zone.BATTLEFIELD,this);
      if (owner != null) {
switch (event.getToZone()) {
case GRAVEYARD:
          owner.putInGraveyard(card,game,!flag);
        break;
case HAND:
      owner.getHand().add(card);
    break;
case EXILED:
  game.getExile().getPermanentExile().add(card);
break;
case LIBRARY:
if (flag) owner.getLibrary().putOnTop(card,game);
 else owner.getLibrary().putOnBottom(card,game);
break;
case BATTLEFIELD:
break;
}
game.setZone(objectId,event.getToZone());
game.fireEvent(event);
return game.getState().getZone(objectId) == toZone;
}
}
}
return false;
}
Program: 160090
Project: 160090
Buggy source:
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
    if (event.getPlayerId().equals(source.getControllerId()) && event.getTargetId().equals(source.getSourceId())) {
      this.used=true;
      return false;
    }
  }
  if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
    ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
    if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
      this.used=true;
      return false;
    }
  }
  if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) {
    if (event.getTargetId().equals(targetPointer.getFirst(game,source))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
    if (event.getTargetId().equals(source.getSourceId())) {
      this.used=true;
      return false;
    }
  }
  if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
    ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
    if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
      this.used=true;
      return false;
    }
  }
  if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) {
    if (event.getTargetId().equals(targetPointer.getFirst(game,source))) {
      return true;
    }
  }
  return false;
}
Program: 160091
Project: 160091
Buggy source:
public void clear(){
  layeredEffects.clear();
  replacementEffects.clear();
  preventionEffects.clear();
  requirementEffects.clear();
  restrictionEffects.clear();
  asThoughEffects.clear();
  costModificationEffects.clear();
}

Fixed version (ground truth):
public void clear(){
  for (  ContinuousEffectsList effectsList : allEffectsLists) {
    effectsList.clear();
  }
}
Program: 160092
Project: 160092
Buggy source:
public ContinuousEffects(final ContinuousEffects effect){
  this.applyCounters=effect.applyCounters.copy();
  this.planeswalkerRedirectionEffect=effect.planeswalkerRedirectionEffect.copy();
  this.auraReplacementEffect=effect.auraReplacementEffect.copy();
  layeredEffects=effect.layeredEffects.copy();
  replacementEffects=effect.replacementEffects.copy();
  preventionEffects=effect.preventionEffects.copy();
  requirementEffects=effect.requirementEffects.copy();
  restrictionEffects=effect.restrictionEffects.copy();
  asThoughEffects=effect.asThoughEffects.copy();
  costModificationEffects=effect.costModificationEffects.copy();
}

Fixed version (ground truth):
public ContinuousEffects(final ContinuousEffects effect){
  this.applyCounters=effect.applyCounters.copy();
  this.planeswalkerRedirectionEffect=effect.planeswalkerRedirectionEffect.copy();
  this.auraReplacementEffect=effect.auraReplacementEffect.copy();
  layeredEffects=effect.layeredEffects.copy();
  replacementEffects=effect.replacementEffects.copy();
  preventionEffects=effect.preventionEffects.copy();
  requirementEffects=effect.requirementEffects.copy();
  restrictionEffects=effect.restrictionEffects.copy();
  asThoughEffects=effect.asThoughEffects.copy();
  costModificationEffects=effect.costModificationEffects.copy();
  collectAllEffects();
}
Program: 160093
Project: 160093
Buggy source:
@Override public boolean changeControllerId(UUID controllerId,Game game){
  if (!controllerId.equals(this.controllerId)) {
    Player newController=game.getPlayer(controllerId);
    if (newController != null && (!newController.hasLeft() || !newController.hasLost())) {
      if (!controllerId.equals(beforeResetControllerId)) {
        this.removeFromCombat(game);
        this.controlledFromStartOfControllerTurn=false;
        this.controllerChanged=true;
      }
 else {
        this.controllerChanged=false;
      }
      this.controllerId=controllerId;
      this.abilities.setControllerId(controllerId);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean changeControllerId(UUID controllerId,Game game){
  if (!controllerId.equals(this.controllerId)) {
    Player newController=game.getPlayer(controllerId);
    if (newController != null && (!newController.hasLeft() || !newController.hasLost())) {
      if (!controllerId.equals(beforeResetControllerId)) {
        this.removeFromCombat(game);
        this.controlledFromStartOfControllerTurn=false;
        this.controllerChanged=true;
      }
 else {
        this.controllerChanged=false;
      }
      this.controllerId=controllerId;
      this.abilities.setControllerId(controllerId);
      game.getContinuousEffects().setController(this.objectId,controllerId);
      return true;
    }
  }
  return false;
}
Program: 160095
Project: 160095
Buggy source:
public static DialogManager getManager(){
  if (dialogManager == null) {
    dialogManager=new DialogManager();
    dialogManager.setVisible(true);
  }
  return dialogManager;
}

Fixed version (ground truth):
public static DialogManager getManager(UUID gameId){
  if (!dialogManagers.containsKey(gameId)) {
synchronized (dialogManagers) {
      if (!dialogManagers.containsKey(gameId)) {
        DialogManager dialogManager=new DialogManager();
        dialogManager.setScreenWidth(768);
        dialogManager.setScreenHeight(1024);
        dialogManager.setBounds(0,0,768,1024);
        dialogManager.setVisible(false);
        dialogManagers.put(gameId,dialogManager);
      }
    }
  }
  return dialogManagers.get(gameId);
}
Program: 160096
Project: 160096
Buggy source:
/** 
 * This is the default constructor
 */
public ChoiceDialog(DlgParams params){
  super(params);
  this.params=params;
  cards=params.getCards();
  isOptional=params.isOptional();
  isCancelStopsPlaying=params.isCancelStopsPlaying();
  isChooseAbility=params.isChooseAbility();
  in_a_row=5;
  rows=2;
  maxPages=cards.size() / (in_a_row * rows);
  if (cards.size() % (in_a_row * rows) != 0) {
    maxPages++;
  }
  initialize();
}

Fixed version (ground truth):
/** 
 * This is the default constructor
 */
public ChoiceDialog(DlgParams params){
  super(params);
  this.params=params;
  this.gameId=params.gameId;
  cards=params.getCards();
  isOptional=params.isOptional();
  isCancelStopsPlaying=params.isCancelStopsPlaying();
  isChooseAbility=params.isChooseAbility();
  in_a_row=5;
  rows=2;
  maxPages=cards.size() / (in_a_row * rows);
  if (cards.size() % (in_a_row * rows) != 0) {
    maxPages++;
  }
  initialize();
}
Program: 160097
Project: 160097
Buggy source:
private HoverButton getJButtonOK(){
  if (jButtonOK == null) {
    jButtonOK=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgActiveAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 75;
    int h=getDlgParams().rect.height - 90;
    jButtonOK.setBounds(new Rectangle(w / 2 - 40,h - 50,60,60));
    jButtonOK.setToolTipText("String_Node_Str");
    jButtonOK.setObserver(new Command(){
      public void execute(){
        DialogManager.getManager().fadeOut((DialogContainer)getParent());
      }
    }
);
  }
  return jButtonOK;
}

Fixed version (ground truth):
private HoverButton getJButtonOK(){
  if (jButtonOK == null) {
    jButtonOK=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgActiveAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 75;
    int h=getDlgParams().rect.height - 90;
    jButtonOK.setBounds(new Rectangle(w / 2 - 40,h - 50,60,60));
    jButtonOK.setToolTipText("String_Node_Str");
    jButtonOK.setObserver(new Command(){
      public void execute(){
        DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
      }
    }
);
  }
  return jButtonOK;
}
Program: 160098
Project: 160098
Buggy source:
/** 
 * This method initializes jButtonCancel
 * @return javax.swing.JButton
 */
private HoverButton getJButtonCancel(){
  if (jButtonCancel == null) {
    jButtonCancel=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgCancelButtonImage(),ImageManagerImpl.getInstance().getDlgActiveCancelButtonImage(),ImageManagerImpl.getInstance().getDlgCancelButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 75;
    int h=getDlgParams().rect.height - 90;
    jButtonCancel.setBounds(new Rectangle(w / 2 + 150,h - 50,60,60));
    jButtonCancel.setToolTipText("String_Node_Str");
    jButtonCancel.setVisible(isOptional);
    if (!isCancelStopsPlaying) {
      jButtonCancel.setToolTipText("String_Node_Str");
      jButtonCancel.setBounds(new Rectangle(w / 2 + 150,h - 50,60,60));
    }
    jButtonCancel.setObserver(new Command(){
      private static final long serialVersionUID=-567322540616089486L;
      public void execute(){
        DialogManager.getManager().fadeOut((DialogContainer)getParent());
      }
    }
);
  }
  return jButtonCancel;
}

Fixed version (ground truth):
/** 
 * This method initializes jButtonCancel
 * @return javax.swing.JButton
 */
private HoverButton getJButtonCancel(){
  if (jButtonCancel == null) {
    jButtonCancel=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgCancelButtonImage(),ImageManagerImpl.getInstance().getDlgActiveCancelButtonImage(),ImageManagerImpl.getInstance().getDlgCancelButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 75;
    int h=getDlgParams().rect.height - 90;
    jButtonCancel.setBounds(new Rectangle(w / 2 + 150,h - 50,60,60));
    jButtonCancel.setToolTipText("String_Node_Str");
    jButtonCancel.setVisible(isOptional);
    if (!isCancelStopsPlaying) {
      jButtonCancel.setToolTipText("String_Node_Str");
      jButtonCancel.setBounds(new Rectangle(w / 2 + 150,h - 50,60,60));
    }
    jButtonCancel.setObserver(new Command(){
      private static final long serialVersionUID=-567322540616089486L;
      public void execute(){
        DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
      }
    }
);
  }
  return jButtonCancel;
}
Program: 160099
Project: 160099
Buggy source:
public void execute(){
  DialogManager.getManager().fadeOut((DialogContainer)getParent());
}

Fixed version (ground truth):
public void execute(){
  DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
}
Program: 160100
Project: 160100
Buggy source:
private HoverButton getJButtonAccept(){
  if (jButtonAccept == null) {
    jButtonAccept=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgActiveAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 90;
    int h=getDlgParams().rect.height - 90;
    jButtonAccept.setBounds(new Rectangle(w / 2 - 80,h - 50,60,60));
    jButtonAccept.setObserver(new Command(){
      @Override public void execute(){
        DialogManager.getManager().fadeOut((DialogContainer)getParent());
        StackDialog.this.feedbackPanel.doClick();
      }
      private static final long serialVersionUID=1L;
    }
);
  }
  return jButtonAccept;
}

Fixed version (ground truth):
private HoverButton getJButtonAccept(){
  if (jButtonAccept == null) {
    jButtonAccept=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgActiveAcceptButtonImage(),ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 90;
    int h=getDlgParams().rect.height - 90;
    jButtonAccept.setBounds(new Rectangle(w / 2 - 80,h - 50,60,60));
    jButtonAccept.setObserver(new Command(){
      @Override public void execute(){
        DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
        StackDialog.this.feedbackPanel.doClick();
      }
      private static final long serialVersionUID=1L;
    }
);
  }
  return jButtonAccept;
}
Program: 160101
Project: 160101
Buggy source:
/** 
 * This is the default constructor
 */
public StackDialog(DlgParams params){
  super(params);
  this.feedbackPanel=params.feedbackPanel;
  initialize();
  displayStack(params.getCards(),params.gameId,params.bigCard);
}

Fixed version (ground truth):
/** 
 * This is the default constructor
 */
public StackDialog(DlgParams params){
  super(params);
  this.feedbackPanel=params.feedbackPanel;
  this.gameId=params.gameId;
  initialize();
  displayStack(params.getCards(),params.gameId,params.bigCard);
}
Program: 160102
Project: 160102
Buggy source:
private HoverButton getJButtonResponse(){
  if (jButtonResponse == null) {
    jButtonResponse=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgCancelButtonImage(),ImageManagerImpl.getInstance().getDlgActiveCancelButtonImage(),ImageManagerImpl.getInstance().getDlgCancelButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 90;
    int h=getDlgParams().rect.height - 90;
    jButtonResponse.setBounds(new Rectangle(w / 2 + 5,h - 48,60,60));
    jButtonResponse.setObserver(new Command(){
      @Override public void execute(){
        DialogManager.getManager().fadeOut((DialogContainer)getParent());
      }
      private static final long serialVersionUID=1L;
    }
);
  }
  return jButtonResponse;
}

Fixed version (ground truth):
private HoverButton getJButtonResponse(){
  if (jButtonResponse == null) {
    jButtonResponse=new HoverButton("String_Node_Str",ImageManagerImpl.getInstance().getDlgCancelButtonImage(),ImageManagerImpl.getInstance().getDlgActiveCancelButtonImage(),ImageManagerImpl.getInstance().getDlgCancelButtonImage(),new Rectangle(60,60));
    int w=getDlgParams().rect.width - 90;
    int h=getDlgParams().rect.height - 90;
    jButtonResponse.setBounds(new Rectangle(w / 2 + 5,h - 48,60,60));
    jButtonResponse.setObserver(new Command(){
      @Override public void execute(){
        DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
      }
      private static final long serialVersionUID=1L;
    }
);
  }
  return jButtonResponse;
}
Program: 160103
Project: 160103
Buggy source:
@Override public void execute(){
  DialogManager.getManager().fadeOut((DialogContainer)getParent());
}

Fixed version (ground truth):
@Override public void execute(){
  DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
}
Program: 160104
Project: 160104
Buggy source:
public void pickAbility(AbilityPickerView choices){
  DialogManager.getManager().fadeOut();
  this.abilityPicker.show(choices,MageFrame.getDesktop().getMousePosition());
}

Fixed version (ground truth):
public void pickAbility(AbilityPickerView choices){
  DialogManager.getManager(gameId).fadeOut();
  this.abilityPicker.show(choices,MageFrame.getDesktop().getMousePosition());
}
Program: 160105
Project: 160105
Buggy source:
public void playXMana(String message,GameView gameView){
  updateGame(gameView);
  DialogManager.getManager().fadeOut();
  this.feedbackPanel.getFeedback(FeedbackMode.CONFIRM,message,gameView.getSpecial(),null);
}

Fixed version (ground truth):
public void playXMana(String message,GameView gameView){
  updateGame(gameView);
  DialogManager.getManager(gameId).fadeOut();
  this.feedbackPanel.getFeedback(FeedbackMode.CONFIRM,message,gameView.getSpecial(),null);
}
Program: 160106
Project: 160106
Buggy source:
public void installComponents(){
  jLayeredPane.setOpaque(false);
  jLayeredPane.add(abilityPicker);
  jLayeredPane.add(DialogManager.getManager(),JLayeredPane.MODAL_LAYER,0);
  abilityPicker.setVisible(false);
}

Fixed version (ground truth):
public void installComponents(){
  jLayeredPane.setOpaque(false);
  jLayeredPane.add(abilityPicker);
  jLayeredPane.add(DialogManager.getManager(gameId),JLayeredPane.MODAL_LAYER,0);
  abilityPicker.setVisible(false);
}
Program: 160107
Project: 160107
Buggy source:
public void playMana(String message,GameView gameView){
  updateGame(gameView);
  DialogManager.getManager().fadeOut();
  this.feedbackPanel.getFeedback(FeedbackMode.CANCEL,message,gameView.getSpecial(),null);
}

Fixed version (ground truth):
public void playMana(String message,GameView gameView){
  updateGame(gameView);
  DialogManager.getManager(gameId).fadeOut();
  this.feedbackPanel.getFeedback(FeedbackMode.CANCEL,message,gameView.getSpecial(),null);
}
Program: 160108
Project: 160108
Buggy source:
private void sizeToScreen(){
  Rectangle rect=this.getBounds();
  if (rect.height < 650) {
    if (smallMode == false) {
      smallMode=true;
      Dimension bbDimension=new Dimension(128,184);
      bigCard.setMaximumSize(bbDimension);
      bigCard.setMinimumSize(bbDimension);
      bigCard.setPreferredSize(bbDimension);
      pnlGameInfo.revalidate();
      pnlGameInfo.repaint();
      this.handContainer.sizeHand(0.8,smallMode);
      for (      PlayAreaPanel p : players.values()) {
        p.sizePlayer(smallMode);
      }
    }
  }
 else {
    if (smallMode == true) {
      smallMode=false;
      Dimension bbDimension=new Dimension(256,367);
      bigCard.setMaximumSize(bbDimension);
      bigCard.setMinimumSize(bbDimension);
      bigCard.setPreferredSize(bbDimension);
      pnlGameInfo.revalidate();
      pnlGameInfo.repaint();
      this.handContainer.sizeHand(1,smallMode);
      for (      PlayAreaPanel p : players.values()) {
        p.sizePlayer(smallMode);
      }
    }
  }
  int height=pnlBattlefield.getHeight();
  phasesContainer.setPreferredSize(new Dimension(X_PHASE_WIDTH,height));
  DialogManager.getManager().setScreenWidth(rect.width);
  DialogManager.getManager().setScreenHeight(rect.height);
  DialogManager.getManager().setBounds(0,0,rect.width,rect.height);
}

Fixed version (ground truth):
private void sizeToScreen(){
  Rectangle rect=this.getBounds();
  if (rect.height < 650) {
    if (smallMode == false) {
      smallMode=true;
      Dimension bbDimension=new Dimension(128,184);
      bigCard.setMaximumSize(bbDimension);
      bigCard.setMinimumSize(bbDimension);
      bigCard.setPreferredSize(bbDimension);
      pnlGameInfo.revalidate();
      pnlGameInfo.repaint();
      this.handContainer.sizeHand(0.8,smallMode);
      for (      PlayAreaPanel p : players.values()) {
        p.sizePlayer(smallMode);
      }
    }
  }
 else {
    if (smallMode == true) {
      smallMode=false;
      Dimension bbDimension=new Dimension(256,367);
      bigCard.setMaximumSize(bbDimension);
      bigCard.setMinimumSize(bbDimension);
      bigCard.setPreferredSize(bbDimension);
      pnlGameInfo.revalidate();
      pnlGameInfo.repaint();
      this.handContainer.sizeHand(1,smallMode);
      for (      PlayAreaPanel p : players.values()) {
        p.sizePlayer(smallMode);
      }
    }
  }
  int height=pnlBattlefield.getHeight();
  phasesContainer.setPreferredSize(new Dimension(X_PHASE_WIDTH,height));
  DialogManager.getManager(gameId).setScreenWidth(rect.width);
  DialogManager.getManager(gameId).setScreenHeight(rect.height);
  DialogManager.getManager(gameId).setBounds(0,0,rect.width,rect.height);
}
Program: 160109
Project: 160109
Buggy source:
private void btnGraveActionPerformed(java.awt.event.ActionEvent evt){
  if (graveyard == null) {
    graveyard=new ShowCardsDialog();
  }
  DialogManager.getManager().showChoiceDialog(CardsViewUtil.convertSimple(player.getGraveyard()),bigCard,gameId);
}

Fixed version (ground truth):
private void btnGraveActionPerformed(java.awt.event.ActionEvent evt){
  DialogManager.getManager(gameId).showChoiceDialog(CardsViewUtil.convertSimple(player.getGraveyard()),bigCard,gameId);
}
Program: 160110
Project: 160110
Buggy source:
@Override public void selectAttackers(Game game,UUID attackingPlayerId){
  updateGameStatePriority("String_Node_Str",game);
  FilterCreatureForCombat filter=filterCreatureForCombat.copy();
  filter.add(new ControllerIdPredicate(attackingPlayerId));
  while (!abort) {
    if (passedAllTurns || passedTurn) {
      return;
    }
    game.fireSelectEvent(playerId,"String_Node_Str");
    waitForResponse();
    if (response.getBoolean() != null) {
      return;
    }
 else     if (response.getInteger() != null) {
      if (response.getInteger() == -9999) {
        passedAllTurns=true;
      }
      passedTurn=true;
      return;
    }
 else     if (response.getUUID() != null) {
      Permanent attacker=game.getPermanent(response.getUUID());
      if (attacker != null) {
        if (filterCreatureForCombat.match(attacker,null,playerId,game)) {
          selectDefender(game.getCombat().getDefenders(),attacker.getId(),game);
        }
 else         if (filterAttack.match(attacker,null,playerId,game) && game.getStack().isEmpty()) {
          game.getCombat().removeAttacker(attacker.getId(),game);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void selectAttackers(Game game,UUID attackingPlayerId){
  updateGameStatePriority("String_Node_Str",game);
  FilterCreatureForCombat filter=filterCreatureForCombat.copy();
  filter.add(new ControllerIdPredicate(attackingPlayerId));
  while (!abort) {
    if (passedAllTurns || passedTurn) {
      return;
    }
    game.fireSelectEvent(playerId,"String_Node_Str");
    waitForResponse();
    if (response.getBoolean() != null) {
      return;
    }
 else     if (response.getInteger() != null) {
      if (response.getInteger() == -9999) {
        passedAllTurns=true;
      }
      passedTurn=true;
      return;
    }
 else     if (response.getUUID() != null) {
      Permanent attacker=game.getPermanent(response.getUUID());
      if (attacker != null) {
        if (filterCreatureForCombat.match(attacker,null,playerId,game)) {
          selectDefender(game.getCombat().getDefenders(),attacker.getId(),game);
        }
 else         if (filterAttack.match(attacker,null,playerId,game) && game.getStack().isEmpty()) {
          removeAttackerIfPossible(game,attacker);
        }
      }
    }
  }
}
Program: 160111
Project: 160111
Buggy source:
public boolean asThough(UUID objectId,AsThoughEffectType type,Game game){
  for (  AsThoughEffect entry : asThoughEffects) {
    AsThoughEffect effect=entry;
    if (effect.getAsThoughEffectType() == type) {
      if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
        if (effect.applies(objectId,asThoughEffects.getAbility(entry.getId()),game)) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean asThough(UUID objectId,AsThoughEffectType type,Game game){
  List<AsThoughEffect> asThoughEffectsList=getApplicableAsThoughEffects(game);
  for (  AsThoughEffect effect : asThoughEffectsList) {
    if (effect.getAsThoughEffectType() == type) {
      if (effect.applies(objectId,asThoughEffects.getAbility(effect.getId()),game)) {
        return true;
      }
    }
  }
  return false;
}
Program: 160113
Project: 160113
Buggy source:
@Override public DynamicValue clone(){
  return new SourcePermanentPowerCount();
}

Fixed version (ground truth):
@Override public DynamicValue clone(){
  return new TargetPermanentPowerCount();
}
Program: 160114
Project: 160114
Buggy source:
public FilterStackObject(final FilterStackObject filter){
  super(filter);
  this.extraPredicates=new ArrayList<ObjectPlayerPredicate<ObjectPlayer<Permanent>>>(extraPredicates);
}

Fixed version (ground truth):
public FilterStackObject(final FilterStackObject filter){
  super(filter);
  this.extraPredicates=new ArrayList<ObjectPlayerPredicate<ObjectPlayer<Permanent>>>(filter.extraPredicates);
}
Program: 160115
Project: 160115
Buggy source:
@Override public boolean apply(ObjectPlayer<Permanent> input,Game game){
  Permanent permanent=input.getObject();
  UUID playerId=input.getPlayerId();
switch (controller) {
case YOU:
    if (permanent.getControllerId().equals(playerId)) {
      return true;
    }
  break;
case OPPONENT:
if (game.getOpponents(playerId).contains(permanent.getControllerId())) {
  return true;
}
break;
case NOT_YOU:
if (!permanent.getControllerId().equals(playerId)) {
return true;
}
break;
}
return true;
}

Fixed version (ground truth):
@Override public boolean apply(ObjectPlayer<Permanent> input,Game game){
  Permanent permanent=input.getObject();
  UUID playerId=input.getPlayerId();
switch (controller) {
case YOU:
    if (permanent.getControllerId().equals(playerId)) {
      return true;
    }
  break;
case OPPONENT:
if (game.getOpponents(playerId).contains(permanent.getControllerId())) {
  return true;
}
break;
case NOT_YOU:
if (!permanent.getControllerId().equals(playerId)) {
return true;
}
break;
}
return false;
}
Program: 160116
Project: 160116
Buggy source:
@Override public String getText(Mode mode){
  if (text == null || text.length() == 0)   return "String_Node_Str" + baseEffects.getText(mode);
 else   return text;
}

Fixed version (ground truth):
@Override public String getText(Mode mode){
  return (text == null || text.isEmpty()) ? baseEffects.getText(mode) : text;
}
Program: 160117
Project: 160117
Buggy source:
@Override public boolean activate(Game game,boolean noMana){
  UUID defenderId=game.getCombat().getDefendingPlayer(sourceId);
  if (defenderId != null) {
    FilterCreaturePermanent filter=new FilterCreaturePermanent("String_Node_Str");
    filter.add(new ControllerIdPredicate(defenderId));
    this.getTargets().clear();
    TargetCreaturePermanent target=new TargetCreaturePermanent(filter);
    target.setRequired(true);
    this.addTarget(target);
    return super.activate(game,noMana);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean activate(Game game,boolean noMana){
  UUID defenderId=game.getCombat().getDefendingPlayer(sourceId);
  if (defenderId != null) {
    FilterCreaturePermanent filter=filterTemplate.copy();
    filter.add(new ControllerIdPredicate(defenderId));
    this.getTargets().clear();
    TargetCreaturePermanent target=new TargetCreaturePermanent(filter);
    target.setRequired(true);
    this.addTarget(target);
    return super.activate(game,noMana);
  }
  return false;
}
Program: 160118
Project: 160118
Buggy source:
@Override public boolean canActivate(UUID playerId,Game game){
  MageObject object=game.getObject(sourceId);
  if ((object.getCardType().contains(CardType.INSTANT) || object.getAbilities().containsKey(FlashAbility.getInstance().getId()) || game.getContinuousEffects().asThough(sourceId,AsThoughEffectType.CAST,game)|| game.canPlaySorcery(playerId))) {
    if (costs.canPay(sourceId,controllerId,game) && canChooseTarget(game)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canActivate(UUID playerId,Game game){
  MageObject object=game.getObject(sourceId);
  if ((object.getCardType().contains(CardType.INSTANT) || object.getAbilities().containsKey(FlashAbility.getInstance().getId()) || game.getContinuousEffects().asThough(sourceId,AsThoughEffectType.CAST,game)|| game.canPlaySorcery(playerId))) {
    if (!controllerId.equals(playerId)) {
      return false;
    }
    if (costs.canPay(sourceId,controllerId,game) && canChooseTarget(game)) {
      return true;
    }
  }
  return false;
}
Program: 160119
Project: 160119
Buggy source:
public FilterObject(FilterObject filter){
  super(filter);
  this.abilities=filter.abilities.copy();
  this.notAbilities=filter.notAbilities;
  this.cardType.addAll(filter.cardType);
  this.notCardTypeList.addAll(filter.notCardTypeList);
  this.scopeCardType=filter.scopeCardType;
  this.notCardType=filter.notCardType;
  this.notScopeCardType=filter.notScopeCardType;
  this.colorless=filter.colorless;
  this.useColorless=filter.useColorless;
  this.useColor=filter.useColor;
  this.color=filter.color.copy();
  this.scopeColor=filter.scopeColor;
  this.notColor=filter.notColor;
  this.name.addAll(filter.name);
  this.notName=filter.notName;
  this.subtype.addAll(filter.subtype);
  this.scopeSubtype=filter.scopeSubtype;
  this.notSubtype=filter.notSubtype;
  this.supertype.addAll(filter.supertype);
  this.scopeSupertype=filter.scopeSupertype;
  this.notSupertype=filter.notSupertype;
  this.convertedManaCost=filter.convertedManaCost;
  this.convertedManaCostComparison=filter.convertedManaCostComparison;
  this.power=filter.power;
  this.powerComparison=filter.powerComparison;
  this.toughness=filter.toughness;
  this.toughnessComparison=filter.toughnessComparison;
  this.another=filter.another;
}

Fixed version (ground truth):
public FilterObject(FilterObject filter){
  super(filter);
  this.abilities=filter.abilities.copy();
  this.notAbilities=filter.notAbilities;
  this.cardType.addAll(filter.cardType);
  this.notCardType.addAll(filter.notCardType);
  this.scopeCardType=filter.scopeCardType;
  this.scopeNotCardType=filter.scopeNotCardType;
  this.colorless=filter.colorless;
  this.useColorless=filter.useColorless;
  this.useColor=filter.useColor;
  this.color=filter.color.copy();
  this.scopeColor=filter.scopeColor;
  this.notColor=filter.notColor;
  this.name.addAll(filter.name);
  this.notName=filter.notName;
  this.subtype.addAll(filter.subtype);
  this.scopeSubtype=filter.scopeSubtype;
  this.notSubtype=filter.notSubtype;
  this.supertype.addAll(filter.supertype);
  this.scopeSupertype=filter.scopeSupertype;
  this.notSupertype=filter.notSupertype;
  this.convertedManaCost=filter.convertedManaCost;
  this.convertedManaCostComparison=filter.convertedManaCostComparison;
  this.power=filter.power;
  this.powerComparison=filter.powerComparison;
  this.toughness=filter.toughness;
  this.toughnessComparison=filter.toughnessComparison;
  this.another=filter.another;
}
Program: 160121
Project: 160121
Buggy source:
public List<CardType> getNotCardType(){
  return this.notCardTypeList;
}

Fixed version (ground truth):
public List<CardType> getNotCardType(){
  return this.notCardType;
}
Program: 160122
Project: 160122
Buggy source:
public void addAbility(Ability ability){
  if (ability instanceof StaticAbility) {
    for (    Mode mode : ability.getModes().values()) {
      for (      Effect effect : mode.getEffects()) {
        if (effect instanceof ContinuousEffect) {
          addEffect((ContinuousEffect)effect,ability);
        }
      }
    }
  }
 else   if (ability instanceof TriggeredAbility) {
    this.triggers.add((TriggeredAbility)ability);
  }
}

Fixed version (ground truth):
public void addAbility(Ability ability){
  if (ability instanceof StaticAbility) {
    if (ability instanceof KickerAbility) {
      return;
    }
    for (    Mode mode : ability.getModes().values()) {
      for (      Effect effect : mode.getEffects()) {
        if (effect instanceof ContinuousEffect) {
          addEffect((ContinuousEffect)effect,ability);
        }
      }
    }
  }
 else   if (ability instanceof TriggeredAbility) {
    this.triggers.add((TriggeredAbility)ability);
  }
}
Program: 160123
Project: 160123
Buggy source:
@Override public boolean moveToExile(UUID exileId,String name,UUID sourceId,Game game){
  Zone fromZone=game.getState().getZone(objectId);
  ZoneChangeEvent event=new ZoneChangeEvent(this.objectId,sourceId,ownerId,fromZone,Zone.EXILED);
  if (!game.replaceEvent(event)) {
    if (fromZone != null) {
switch (fromZone) {
case GRAVEYARD:
        game.getPlayer(ownerId).removeFromGraveyard(this,game);
      break;
case HAND:
    game.getPlayer(ownerId).removeFromHand(this,game);
  break;
case LIBRARY:
game.getPlayer(ownerId).removeFromLibrary(this,game);
break;
default :
}
game.rememberLKI(objectId,event.getFromZone(),this);
}
if (exileId == null) {
game.getExile().getPermanentExile().add(this);
}
 else {
game.getExile().createZone(exileId,name).add(this);
}
game.setZone(objectId,event.getToZone());
game.fireEvent(event);
return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean moveToExile(UUID exileId,String name,UUID sourceId,Game game){
  Zone fromZone=game.getState().getZone(objectId);
  ZoneChangeEvent event=new ZoneChangeEvent(this.objectId,sourceId,ownerId,fromZone,Zone.EXILED);
  if (!game.replaceEvent(event)) {
    if (fromZone != null) {
switch (fromZone) {
case GRAVEYARD:
        game.getPlayer(ownerId).removeFromGraveyard(this,game);
      break;
case HAND:
    game.getPlayer(ownerId).removeFromHand(this,game);
  break;
case LIBRARY:
game.getPlayer(ownerId).removeFromLibrary(this,game);
break;
default :
}
game.rememberLKI(objectId,event.getFromZone(),this);
}
if (exileId == null) {
game.getExile().getPermanentExile().add(this);
}
 else {
game.getExile().createZone(exileId,name).add(this);
}
updateZoneChangeCounter();
game.setZone(objectId,event.getToZone());
game.fireEvent(event);
return true;
}
return false;
}
Program: 160125
Project: 160125
Buggy source:
public boolean isFlipCard(){
  return flipCard;
}

Fixed version (ground truth):
@Override public boolean isFlipCard(){
  return flipCard;
}
Program: 160126
Project: 160126
Buggy source:
@Override public boolean putOntoBattlefield(Game game,Zone fromZone,UUID sourceId,UUID controllerId){
  ZoneChangeEvent event=new ZoneChangeEvent(this.objectId,sourceId,controllerId,fromZone,Zone.BATTLEFIELD);
  if (!game.replaceEvent(event)) {
    if (fromZone != null) {
      boolean removed=false;
switch (fromZone) {
case GRAVEYARD:
        removed=game.getPlayer(ownerId).removeFromGraveyard(this,game);
      break;
case HAND:
    removed=game.getPlayer(ownerId).removeFromHand(this,game);
  break;
case LIBRARY:
removed=game.getPlayer(ownerId).removeFromLibrary(this,game);
break;
default :
}
game.rememberLKI(objectId,event.getFromZone(),this);
if (!removed) {
logger.warn("String_Node_Str" + getName() + "String_Node_Str"+ fromZone);
}
}
PermanentCard permanent=new PermanentCard(this,controllerId);
game.getBattlefield().addPermanent(permanent);
game.setZone(objectId,Zone.BATTLEFIELD);
game.applyEffects();
permanent.entersBattlefield(sourceId,game);
game.applyEffects();
game.fireEvent(new ZoneChangeEvent(permanent,controllerId,fromZone,Zone.BATTLEFIELD));
return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean putOntoBattlefield(Game game,Zone fromZone,UUID sourceId,UUID controllerId){
  ZoneChangeEvent event=new ZoneChangeEvent(this.objectId,sourceId,controllerId,fromZone,Zone.BATTLEFIELD);
  if (!game.replaceEvent(event)) {
    if (fromZone != null) {
      boolean removed=false;
switch (fromZone) {
case GRAVEYARD:
        removed=game.getPlayer(ownerId).removeFromGraveyard(this,game);
      break;
case HAND:
    removed=game.getPlayer(ownerId).removeFromHand(this,game);
  break;
case LIBRARY:
removed=game.getPlayer(ownerId).removeFromLibrary(this,game);
break;
default :
}
game.rememberLKI(objectId,event.getFromZone(),this);
if (!removed) {
logger.warn("String_Node_Str" + getName() + "String_Node_Str"+ fromZone);
}
}
updateZoneChangeCounter();
PermanentCard permanent=new PermanentCard(this,controllerId);
game.getBattlefield().addPermanent(permanent);
game.setZone(objectId,Zone.BATTLEFIELD);
game.applyEffects();
permanent.entersBattlefield(sourceId,game);
game.applyEffects();
game.fireEvent(new ZoneChangeEvent(permanent,controllerId,fromZone,Zone.BATTLEFIELD));
return true;
}
return false;
}
Program: 160127
Project: 160127
Buggy source:
@Override public void remove(UUID id){
  if (targets.containsKey(id))   targets.remove(id);
}

Fixed version (ground truth):
@Override public void remove(UUID id){
  if (targets.containsKey(id)) {
    targets.remove(id);
    zoneChangeCounters.remove(id);
  }
}
Program: 160128
Project: 160128
Buggy source:
@Override public void clearChosen(){
  targets.clear();
  chosen=false;
}

Fixed version (ground truth):
@Override public void clearChosen(){
  targets.clear();
  zoneChangeCounters.clear();
  chosen=false;
}
Program: 160129
Project: 160129
Buggy source:
@Override public void add(UUID id,Game game){
  if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) {
    if (!targets.containsKey(id)) {
      targets.put(id,0);
    }
  }
}

Fixed version (ground truth):
@Override public void add(UUID id,Game game){
  if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) {
    if (!targets.containsKey(id)) {
      targets.put(id,0);
      rememberZoneChangeCounter(id,game);
    }
  }
}
Program: 160130
Project: 160130
Buggy source:
@Override public void addTarget(UUID id,int amount,Ability source,Game game,boolean skipEvent){
  if (targets.containsKey(id)) {
    amount+=targets.get(id);
  }
  if (source != null) {
    if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET,id,source.getId(),source.getControllerId()))) {
      targets.put(id,amount);
      chosen=targets.size() >= minNumberOfTargets;
      if (!skipEvent)       game.fireEvent(GameEvent.getEvent(EventType.TARGETED,id,source.getId(),source.getControllerId()));
    }
  }
 else {
    targets.put(id,amount);
  }
}

Fixed version (ground truth):
@Override public void addTarget(UUID id,int amount,Ability source,Game game,boolean skipEvent){
  if (targets.containsKey(id)) {
    amount+=targets.get(id);
  }
  if (source != null) {
    if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET,id,source.getId(),source.getControllerId()))) {
      targets.put(id,amount);
      rememberZoneChangeCounter(id,game);
      chosen=targets.size() >= minNumberOfTargets;
      if (!skipEvent)       game.fireEvent(GameEvent.getEvent(EventType.TARGETED,id,source.getId(),source.getControllerId()));
    }
  }
 else {
    targets.put(id,amount);
    rememberZoneChangeCounter(id,game);
  }
}
Program: 160131
Project: 160131
Buggy source:
@Override public boolean isLegal(Ability source,Game game){
  for (  UUID targetId : targets.keySet()) {
    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;
  }
  return false;
}
Program: 160132
Project: 160132
Buggy source:
public TargetImpl(final TargetImpl<T> target){
  this.targetName=target.targetName;
  this.zone=target.zone;
  this.maxNumberOfTargets=target.maxNumberOfTargets;
  this.minNumberOfTargets=target.minNumberOfTargets;
  this.required=target.required;
  this.chosen=target.chosen;
  this.targets.putAll(target.targets);
}

Fixed version (ground truth):
public TargetImpl(final TargetImpl<T> target){
  this.targetName=target.targetName;
  this.zone=target.zone;
  this.maxNumberOfTargets=target.maxNumberOfTargets;
  this.minNumberOfTargets=target.minNumberOfTargets;
  this.required=target.required;
  this.chosen=target.chosen;
  this.targets.putAll(target.targets);
  this.zoneChangeCounters.putAll(target.zoneChangeCounters);
}
Program: 160133
Project: 160133
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player player=game.getPlayer(source.getControllerId());
  if (player != null) {
    if (player.getLibrary().size() > 0) {
      Card card=player.getLibrary().getFromTop(game);
      player.revealCards("String_Node_Str",new CardsImpl(card),game);
      if (card.getCardType().contains(CardType.CREATURE)) {
        FilterControlledCreaturePermanent filter=new FilterControlledCreaturePermanent();
        filter.getSubtype().addAll(card.getSubtype());
        filter.setScopeSubtype(Filter.ComparisonScope.Any);
        int count=game.getBattlefield().getAllActivePermanents(filter,player.getId(),game).size();
        if (count > 0) {
          game.informPlayers("String_Node_Str");
          if (player.chooseUse(Constants.Outcome.Benefit,"String_Node_Str",game)) {
            player.cast(card.getSpellAbility(),game,true);
          }
 else {
            game.informPlayers("String_Node_Str" + player.getName() + "String_Node_Str");
            player.getLibrary().putOnBottom(card,game);
          }
        }
 else {
          game.informPlayers("String_Node_Str");
          player.getLibrary().putOnBottom(card,game);
        }
      }
 else {
        player.getLibrary().putOnBottom(card,game);
      }
      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) {
    if (player.getLibrary().size() > 0) {
      Card card=player.getLibrary().getFromTop(game);
      player.revealCards("String_Node_Str",new CardsImpl(card),game);
      if (card.getCardType().contains(CardType.CREATURE)) {
        FilterControlledCreaturePermanent filter=new FilterControlledCreaturePermanent();
        filter.getSubtype().addAll(card.getSubtype());
        filter.setScopeSubtype(Filter.ComparisonScope.Any);
        int count=game.getBattlefield().getAllActivePermanents(filter,player.getId(),game).size();
        if (count > 0) {
          game.informPlayers("String_Node_Str");
          if (player.chooseUse(Constants.Outcome.Benefit,"String_Node_Str",game)) {
            player.cast(card.getSpellAbility(),game,true);
          }
 else {
            game.informPlayers("String_Node_Str" + player.getName() + "String_Node_Str");
            player.getLibrary().putOnBottom(card,game);
          }
        }
 else {
          game.informPlayers("String_Node_Str");
          player.getLibrary().putOnBottom(card,game);
        }
      }
 else {
        game.informPlayers("String_Node_Str" + card.getName() + "String_Node_Str");
        player.getLibrary().putOnBottom(card,game);
      }
      return true;
    }
  }
  return false;
}
Program: 160134
Project: 160134
Buggy source:
public void putOnBottom(Card card,Game game){
  if (card.getOwnerId().equals(playerId)) {
    game.setZone(card.getId(),Zone.LIBRARY);
    library.add(card.getId());
  }
 else {
    game.getPlayer(card.getOwnerId()).getLibrary().putOnBottom(card,game);
  }
}

Fixed version (ground truth):
public void putOnBottom(Card card,Game game){
  if (card.getOwnerId().equals(playerId)) {
    game.setZone(card.getId(),Zone.LIBRARY);
    if (library.contains(card.getId())) {
      library.remove(card.getId());
    }
    library.add(card.getId());
  }
 else {
    game.getPlayer(card.getOwnerId()).getLibrary().putOnBottom(card,game);
  }
}
Program: 160135
Project: 160135
Buggy source:
/** 
 * Tests copied card should NOT be possible to transform
 */
@Test public void testCopyCantTransform(){
  addCard(Constants.Zone.BATTLEFIELD,playerA,"String_Node_Str",2);
  addCard(Constants.Zone.HAND,playerA,"String_Node_Str");
  addCard(Constants.Zone.BATTLEFIELD,playerB,"String_Node_Str",4);
  addCard(Constants.Zone.HAND,playerB,"String_Node_Str");
  castSpell(1,Constants.PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str");
  castSpell(2,Constants.PhaseStep.PRECOMBAT_MAIN,playerB,"String_Node_Str");
  setStopAt(5,Constants.PhaseStep.BEGIN_COMBAT);
  execute();
  assertHandCount(playerA,2);
  assertHandCount(playerB,1);
  assertPermanentCount(playerA,"String_Node_Str",1);
  assertPermanentCount(playerB,"String_Node_Str",1);
}

Fixed version (ground truth):
/** 
 * Tests copied card should NOT be possible to transform
 */
@Test public void testCopyCantTransform(){
  addCard(Constants.Zone.BATTLEFIELD,playerA,"String_Node_Str",2);
  addCard(Constants.Zone.HAND,playerA,"String_Node_Str");
  addCard(Constants.Zone.BATTLEFIELD,playerB,"String_Node_Str",4);
  addCard(Constants.Zone.HAND,playerB,"String_Node_Str");
  castSpell(1,Constants.PhaseStep.PRECOMBAT_MAIN,playerA,"String_Node_Str");
  castSpell(2,Constants.PhaseStep.PRECOMBAT_MAIN,playerB,"String_Node_Str");
  setStopAt(5,Constants.PhaseStep.BEGIN_COMBAT);
  execute();
  assertHandCount(playerA,2);
  assertHandCount(playerB,2);
  assertPermanentCount(playerA,"String_Node_Str",1);
  assertPermanentCount(playerB,"String_Node_Str",1);
}