nus-yam/ex-repair huggingface dataset:
Program: 159103
Project: 159103
Buggy source:
public void remove(DisconnectReason reason){
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ gameSessions.size());
  for (  GameSessionPlayer gameSession : gameSessions.values()) {
    logger.debug("String_Node_Str" + gameSession.getGameId());
    gameSession.quitGame();
  }
  gameSessions.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ draftSessions.size());
  for (  DraftSession draftSession : draftSessions.values()) {
    draftSession.setKilled();
  }
  draftSessions.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ tournamentSessions.size());
  for (  TournamentSession tournamentSession : tournamentSessions.values()) {
    tournamentSession.setKilled();
  }
  tournamentSessions.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ tables.size());
  for (  Entry<UUID,Table> entry : tables.entrySet()) {
    logger.debug("String_Node_Str" + entry.getValue().getId());
    TableManager.getInstance().leaveTable(userId,entry.getValue().getId());
  }
  tables.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ watchedGames.size());
  for (  UUID gameId : watchedGames) {
    GameManager.getInstance().stopWatching(gameId,userId);
  }
  watchedGames.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str");
  ChatManager.getInstance().removeUser(userId,reason);
}

Fixed version (ground truth):
public void remove(DisconnectReason reason){
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ gameSessions.size());
  for (  GameSessionPlayer gameSession : gameSessions.values()) {
    logger.debug("String_Node_Str" + gameSession.getGameId());
    gameSession.quitGame();
  }
  gameSessions.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ draftSessions.size());
  for (  DraftSession draftSession : draftSessions.values()) {
    draftSession.setKilled();
  }
  draftSessions.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ tournamentSessions.size());
  for (  TournamentSession tournamentSession : tournamentSessions.values()) {
    TournamentController tournamentController=TournamentManager.getInstance().getTournamentController(tournamentSession.getTournamentId());
    if (tournamentController != null) {
      tournamentController.quit(userId);
    }
    tournamentSession.setKilled();
  }
  tournamentSessions.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ tables.size());
  for (  Entry<UUID,Table> entry : tables.entrySet()) {
    logger.debug("String_Node_Str" + entry.getValue().getId());
    TableManager.getInstance().leaveTable(userId,entry.getValue().getId());
  }
  tables.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str"+ watchedGames.size());
  for (  UUID gameId : watchedGames) {
    GameManager.getInstance().stopWatching(gameId,userId);
  }
  watchedGames.clear();
  logger.debug("String_Node_Str" + getName() + "String_Node_Str");
  ChatManager.getInstance().removeUser(userId,reason);
}
Program: 159105
Project: 159105
Buggy source:
/** 
 * Checks if cards put into play with Lord of the Void triggered ability are correctly controlled by the controller of Lord of the Void e.g. the top card of the library of the current controller of Oracle of Mul Daya is revealed
 */
@Test public void testLordOfTheVoid(){
  skipInitShuffling();
  addCard(Zone.LIBRARY,playerA,"String_Node_Str",4);
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str");
  attack(2,playerB,"String_Node_Str");
  setChoice(playerB,"String_Node_Str");
  setStopAt(2,PhaseStep.POSTCOMBAT_MAIN);
  execute();
  assertLife(playerA,13);
  assertPermanentCount(playerB,"String_Node_Str",1);
  Assert.assertTrue("String_Node_Str",playerB.isTopCardRevealed());
  Assert.assertFalse("String_Node_Str",playerA.isTopCardRevealed());
}

Fixed version (ground truth):
/** 
 * Checks if cards put into play with Lord of the Void triggered ability are correctly controlled by the controller of Lord of the Void e.g. the top card of the library of the current controller of Oracle of Mul Daya is revealed
 */
@Test public void testLordOfTheVoid(){
  skipInitShuffling();
  addCard(Zone.LIBRARY,playerA,"String_Node_Str",4);
  addCard(Zone.BATTLEFIELD,playerB,"String_Node_Str");
  attack(2,playerB,"String_Node_Str");
  setChoice(playerB,"String_Node_Str");
  setStopAt(2,PhaseStep.POSTCOMBAT_MAIN);
  execute();
  assertLife(playerA,13);
  assertPermanentCount(playerB,"String_Node_Str",1);
  Assert.assertFalse("String_Node_Str",playerA.isTopCardRevealed());
  Assert.assertTrue("String_Node_Str",playerB.isTopCardRevealed());
}
Program: 159107
Project: 159107
Buggy source:
/** 
 * since control could change several times during applyEvents we only want to fire control changed events after all control change effects have been applied
 * @param game 
 */
public boolean fireControlChangeEvents(Game game){
  boolean controlChanged=false;
  for (  Permanent perm : field.values()) {
    if (perm.isPhasedIn()) {
      controlChanged|=perm.checkControlChanged(game);
    }
  }
  return controlChanged;
}

Fixed version (ground truth):
/** 
 * since control could change several times during applyEvents we only want to fire control changed events after all control change effects have been applied
 * @param game 
 * @return
 */
public boolean fireControlChangeEvents(Game game){
  boolean controlChanged=false;
  for (  Permanent perm : field.values()) {
    if (perm.isPhasedIn()) {
      controlChanged|=perm.checkControlChanged(game);
    }
  }
  return controlChanged;
}
Program: 159108
Project: 159108
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          controller.moveCardToExileWithInfo(card,source.getSourceId(),sourceObject.getLogName(),source.getSourceId(),game,Zone.GRAVEYARD);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        controller.putOntoBattlefieldWithInfo(card,game,Zone.EXILED,source.getSourceId());
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          controller.moveCardToExileWithInfo(card,source.getSourceId(),sourceObject.getLogName(),source.getSourceId(),game,Zone.GRAVEYARD);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        Player player=game.getPlayer(card.getOwnerId());
        if (player != null) {
          player.putOntoBattlefieldWithInfo(card,game,Zone.EXILED,source.getSourceId());
        }
      }
    }
    return true;
  }
  return false;
}
Program: 159109
Project: 159109
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          controller.moveCardToExileWithInfo(card,source.getSourceId(),sourceObject.getLogName(),source.getSourceId(),game,Zone.GRAVEYARD);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        controller.putOntoBattlefieldWithInfo(card,game,Zone.EXILED,source.getSourceId());
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          controller.moveCardToExileWithInfo(card,source.getSourceId(),sourceObject.getLogName(),source.getSourceId(),game,Zone.GRAVEYARD);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        Player player=game.getPlayer(card.getOwnerId());
        if (player != null) {
          player.putOntoBattlefieldWithInfo(card,game,Zone.EXILED,source.getSourceId());
        }
      }
    }
    return true;
  }
  return false;
}
Program: 159110
Project: 159110
Buggy source:
@Override public void componentResized(ComponentEvent ce){
  doLayout();
  if (updateCard != null) {
    update(updateCard);
  }
}

Fixed version (ground truth):
@Override public void componentResized(ComponentEvent ce){
  doLayout();
  if (updateCard != null && (updateCard instanceof PermanentView)) {
    update(updateCard);
  }
}
Program: 159111
Project: 159111
Buggy source:
@Override public boolean chooseTarget(Outcome outcome,Cards cards,TargetCard target,Ability source,Game game){
  log.debug("String_Node_Str");
  if (cards == null || cards.isEmpty()) {
    if (!target.isRequired(source)) {
      return false;
    }
    return true;
  }
  ArrayList<Card> cardChoices=new ArrayList<Card>(cards.getCards(target.getFilter(),game));
  while (!target.doneChosing()) {
    Card card=pickTarget(cardChoices,outcome,target,source,game);
    if (card != null) {
      target.addTarget(card.getId(),source,game);
      cardChoices.remove(card);
    }
    if (outcome.equals(Outcome.Neutral) && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
      return true;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean chooseTarget(Outcome outcome,Cards cards,TargetCard target,Ability source,Game game){
  log.debug("String_Node_Str");
  if (cards == null || cards.isEmpty()) {
    if (!target.isRequired(source)) {
      return false;
    }
    return true;
  }
  ArrayList<Card> cardChoices=new ArrayList<>(cards.getCards(target.getFilter(),game));
  while (!target.doneChosing()) {
    Card card=pickTarget(cardChoices,outcome,target,source,game);
    if (card != null) {
      target.addTarget(card.getId(),source,game);
      cardChoices.remove(card);
    }
    if (outcome.equals(Outcome.Neutral) && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
      return true;
    }
  }
  return true;
}
Program: 159112
Project: 159112
Buggy source:
@Override public void actionPerformed(java.awt.event.ActionEvent evt){
  playerActionPerformed(evt);
}

Fixed version (ground truth):
@Override public void actionPerformed(java.awt.event.ActionEvent evt){
  if (!automaticChange) {
    playerActionPerformed(evt);
  }
}
Program: 159113
Project: 159113
Buggy source:
private void playerActionPerformed(java.awt.event.ActionEvent evt){
  boolean start=false;
  int selectedIndex=0;
  for (  TournamentPlayerPanel player : players) {
    if (!start) {
      if (evt.getSource().equals(player.getPlayerType())) {
        start=true;
        selectedIndex=player.getPlayerType().getSelectedIndex();
      }
    }
 else {
      player.getPlayerType().setSelectedIndex(selectedIndex);
    }
  }
}

Fixed version (ground truth):
private void playerActionPerformed(java.awt.event.ActionEvent evt){
  boolean start=false;
  int selectedIndex=0;
  automaticChange=true;
  for (  TournamentPlayerPanel player : players) {
    if (!start) {
      if (evt.getSource().equals(player.getPlayerType())) {
        start=true;
        selectedIndex=player.getPlayerType().getSelectedIndex();
      }
    }
 else {
      player.getPlayerType().setSelectedIndex(selectedIndex);
    }
  }
  automaticChange=false;
}
Program: 159114
Project: 159114
Buggy source:
private void drawPlayers(){
  this.pnlOtherPlayers.removeAll();
  for (  TournamentPlayerPanel panel : players) {
    this.pnlOtherPlayers.add(panel);
    panel.getPlayerType().addActionListener(new java.awt.event.ActionListener(){
      @Override public void actionPerformed(      java.awt.event.ActionEvent evt){
        playerActionPerformed(evt);
      }
    }
);
  }
  this.pack();
  this.revalidate();
  this.repaint();
}

Fixed version (ground truth):
private void drawPlayers(){
  this.pnlOtherPlayers.removeAll();
  for (  TournamentPlayerPanel panel : players) {
    this.pnlOtherPlayers.add(panel);
    panel.getPlayerType().addActionListener(new java.awt.event.ActionListener(){
      @Override public void actionPerformed(      java.awt.event.ActionEvent evt){
        if (!automaticChange) {
          playerActionPerformed(evt);
        }
      }
    }
);
  }
  this.pack();
  this.revalidate();
  this.repaint();
}
Program: 159115
Project: 159115
Buggy source:
@Override public boolean replacePlayer(Player oldPlayer,Player newPlayer){
  if (newPlayer != null) {
    DraftPlayer newDraftPlayer=new DraftPlayer(newPlayer);
    DraftPlayer oldDraftPlayer=players.get(oldPlayer.getId());
    newDraftPlayer.setBooster(oldDraftPlayer.getBooster());
    Map<UUID,DraftPlayer> newPlayers=new HashMap<>();
    PlayerList newTable=new PlayerList();
synchronized (players) {
      for (      Map.Entry<UUID,DraftPlayer> entry : players.entrySet()) {
        if (entry.getKey().equals(oldPlayer.getId())) {
          newPlayers.put(newPlayer.getId(),newDraftPlayer);
        }
 else {
          newPlayers.put(entry.getKey(),entry.getValue());
        }
      }
      players.clear();
      for (      Map.Entry<UUID,DraftPlayer> entry : newPlayers.entrySet()) {
        players.put(entry.getKey(),entry.getValue());
      }
    }
synchronized (table) {
      for (      UUID playerId : table) {
        if (playerId.equals(oldPlayer.getId())) {
          newTable.add(newPlayer.getId());
        }
 else {
          newTable.add(playerId);
        }
      }
      table.clear();
      table.addAll(newTable);
    }
    if (oldDraftPlayer.isPicking()) {
      newDraftPlayer.setPicking();
      newDraftPlayer.getPlayer().pickCard(newDraftPlayer.getBooster(),newDraftPlayer.getDeck(),this);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean replacePlayer(Player oldPlayer,Player newPlayer){
  if (newPlayer != null) {
    DraftPlayer newDraftPlayer=new DraftPlayer(newPlayer);
    DraftPlayer oldDraftPlayer=players.get(oldPlayer.getId());
    newDraftPlayer.setBooster(oldDraftPlayer.getBooster());
    Map<UUID,DraftPlayer> newPlayers=new LinkedHashMap<>();
synchronized (players) {
      for (      Map.Entry<UUID,DraftPlayer> entry : players.entrySet()) {
        if (entry.getKey().equals(oldPlayer.getId())) {
          newPlayers.put(newPlayer.getId(),newDraftPlayer);
        }
 else {
          newPlayers.put(entry.getKey(),entry.getValue());
        }
      }
      players.clear();
      for (      Map.Entry<UUID,DraftPlayer> entry : newPlayers.entrySet()) {
        players.put(entry.getKey(),entry.getValue());
      }
    }
synchronized (table) {
      UUID currentId=table.get();
      if (currentId.equals(oldPlayer.getId())) {
        currentId=newPlayer.getId();
      }
      table.clear();
      for (      UUID playerId : players.keySet()) {
        table.add(playerId);
      }
      table.setCurrent(currentId);
    }
    if (oldDraftPlayer.isPicking()) {
      newDraftPlayer.setPicking();
      newDraftPlayer.getPlayer().pickCard(newDraftPlayer.getBooster(),newDraftPlayer.getDeck(),this);
    }
    return true;
  }
  return false;
}
Program: 159116
Project: 159116
Buggy source:
@Override public void setStartTime(){
  this.stepStartTime=new Date();
}

Fixed version (ground truth):
@Override public void setStartTime(){
  this.startTime=new Date();
}
Program: 159117
Project: 159117
Buggy source:
protected void copyFromCard(Card card){
  this.name=card.getName();
  this.abilities.clear();
  this.abilities.addAll(card.getAbilities());
  this.abilities.setControllerId(this.controllerId);
  this.watchers.addAll(card.getWatchers());
  this.cardType.clear();
  this.cardType.addAll(card.getCardType());
  this.color=card.getColor().copy();
  this.manaCost=card.getManaCost().copy();
  this.power=card.getPower().copy();
  this.toughness=card.getToughness().copy();
  if (card instanceof PermanentCard) {
    this.maxLevelCounters=((PermanentCard)card).maxLevelCounters;
  }
  this.subtype.clear();
  this.subtype.addAll(card.getSubtype());
  this.supertype.clear();
  this.supertype.addAll(card.getSupertype());
  this.expansionSetCode=card.getExpansionSetCode();
  this.rarity=card.getRarity();
  this.cardNumber=card.getCardNumber();
  this.usesVariousArt=card.getUsesVariousArt();
  this.zoneChangeCounter=card.getZoneChangeCounter();
  canTransform=card.canTransform();
  if (canTransform) {
    secondSideCard=card.getSecondCardFace();
    nightCard=card.isNightCard();
  }
  this.flipCard=card.isFlipCard();
  this.flipCardName=card.getFlipCardName();
  this.morphCard=card.isMorphCard();
  this.faceDown=card.isFaceDown();
}

Fixed version (ground truth):
protected void copyFromCard(Card card){
  this.name=card.getName();
  this.abilities.clear();
  this.abilities.addAll(card.getAbilities().copy());
  this.abilities.setControllerId(this.controllerId);
  this.watchers.addAll(card.getWatchers());
  this.cardType.clear();
  this.cardType.addAll(card.getCardType());
  this.color=card.getColor().copy();
  this.manaCost=card.getManaCost().copy();
  this.power=card.getPower().copy();
  this.toughness=card.getToughness().copy();
  if (card instanceof PermanentCard) {
    this.maxLevelCounters=((PermanentCard)card).maxLevelCounters;
  }
  this.subtype.clear();
  this.subtype.addAll(card.getSubtype());
  this.supertype.clear();
  this.supertype.addAll(card.getSupertype());
  this.expansionSetCode=card.getExpansionSetCode();
  this.rarity=card.getRarity();
  this.cardNumber=card.getCardNumber();
  this.usesVariousArt=card.getUsesVariousArt();
  this.zoneChangeCounter=card.getZoneChangeCounter();
  canTransform=card.canTransform();
  if (canTransform) {
    secondSideCard=card.getSecondCardFace();
    nightCard=card.isNightCard();
  }
  this.flipCard=card.isFlipCard();
  this.flipCardName=card.getFlipCardName();
  this.morphCard=card.isMorphCard();
  this.faceDown=card.isFaceDown();
}
Program: 159119
Project: 159119
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          card.moveToExile(source.getSourceId(),"String_Node_Str",source.getSourceId(),game);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    for (    Card card : game.getState().getExile().getExileZone(source.getSourceId()).getCards(game)) {
      card.putOntoBattlefield(game,Zone.EXILED,source.getSourceId(),card.getOwnerId());
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          controller.moveCardToExileWithInfo(card,source.getSourceId(),sourceObject.getLogName(),source.getSourceId(),game,Zone.GRAVEYARD);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        controller.putOntoBattlefieldWithInfo(card,game,Zone.EXILED,source.getSourceId());
      }
    }
    return true;
  }
  return false;
}
Program: 159120
Project: 159120
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  if (controller != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          card.moveToExile(source.getSourceId(),"String_Node_Str",source.getSourceId(),game);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        card.putOntoBattlefield(game,Zone.EXILED,source.getSourceId(),card.getOwnerId());
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  MageObject sourceObject=game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null) {
    for (    UUID playerId : controller.getInRange()) {
      Player player=game.getPlayer(playerId);
      if (player != null) {
        for (        Card card : player.getGraveyard().getCards(new FilterCreatureCard(),game)) {
          controller.moveCardToExileWithInfo(card,source.getSourceId(),sourceObject.getLogName(),source.getSourceId(),game,Zone.GRAVEYARD);
        }
      }
    }
    for (    Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(),source.getControllerId(),game)) {
      permanent.sacrifice(source.getSourceId(),game);
    }
    ExileZone exileZone=game.getState().getExile().getExileZone(source.getSourceId());
    if (exileZone != null) {
      for (      Card card : exileZone.getCards(game)) {
        controller.putOntoBattlefieldWithInfo(card,game,Zone.EXILED,source.getSourceId());
      }
    }
    return true;
  }
  return false;
}
Program: 159121
Project: 159121
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (controller != null && sourcePermanent != null) {
    if (super.apply(game,source)) {
      Target target=getBluePrintPermanent().getSpellAbility().getTargets().get(0);
      Outcome auraOutcome=Outcome.BoostCreature;
      Ability:       for (      Ability ability : getBluePrintPermanent().getAbilities()) {
        if (ability instanceof SpellAbility) {
          for (          Effect effect : ability.getEffects()) {
            if (effect instanceof AttachEffect) {
              auraOutcome=effect.getOutcome();
              break Ability;
            }
          }
        }
      }
      if (controller.choose(auraOutcome,target,source.getSourceId(),game)) {
        UUID targetId=target.getFirstTarget();
        Permanent targetPermanent=game.getPermanent(targetId);
        Player targetPlayer=game.getPlayer(targetId);
        if (targetPermanent != null) {
          targetPermanent.addAttachment(sourcePermanent.getId(),game);
        }
 else         if (targetPlayer != null) {
          targetPlayer.addAttachment(sourcePermanent.getId(),game);
        }
 else {
          return false;
        }
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Player controller=game.getPlayer(source.getControllerId());
  Permanent sourcePermanent=game.getPermanent(source.getSourceId());
  if (controller != null && sourcePermanent != null) {
    if (super.apply(game,source)) {
      Permanent permanentToCopy=getBluePrintPermanent();
      if (permanentToCopy != null) {
        if (permanentToCopy.getSubtype().contains("String_Node_Str")) {
          Target target=getBluePrintPermanent().getSpellAbility().getTargets().get(0);
          Outcome auraOutcome=Outcome.BoostCreature;
          Ability:           for (          Ability ability : getBluePrintPermanent().getAbilities()) {
            if (ability instanceof SpellAbility) {
              for (              Effect effect : ability.getEffects()) {
                if (effect instanceof AttachEffect) {
                  auraOutcome=effect.getOutcome();
                  break Ability;
                }
              }
            }
          }
          if (controller.choose(auraOutcome,target,source.getSourceId(),game)) {
            UUID targetId=target.getFirstTarget();
            Permanent targetPermanent=game.getPermanent(targetId);
            Player targetPlayer=game.getPlayer(targetId);
            if (targetPermanent != null) {
              targetPermanent.addAttachment(sourcePermanent.getId(),game);
            }
 else             if (targetPlayer != null) {
              targetPlayer.addAttachment(sourcePermanent.getId(),game);
            }
 else {
              return false;
            }
          }
        }
        return true;
      }
    }
  }
  return false;
}
Program: 159122
Project: 159122
Buggy source:
public BileBlightEffect(){
  super(-3,-3,Duration.EndOfTurn);
  staticText="String_Node_Str";
}

Fixed version (ground truth):
public BileBlightEffect(final BileBlightEffect effect){
  super(effect);
}
Program: 159123
Project: 159123
Buggy source:
@Override public BileBlightEffect copy(){
  return new BileBlightEffect();
}

Fixed version (ground truth):
@Override public BileBlightEffect copy(){
  return new BileBlightEffect(this);
}
Program: 159124
Project: 159124
Buggy source:
protected void draft(){
  Draft draft=new BoosterDraft((DraftOptions)options.getLimitedOptions(),getSets());
  for (  TournamentPlayer player : players.values()) {
    draft.addPlayer(player.getPlayer());
    player.setState(TournamentPlayerState.DRAFTING);
  }
  tableEventSource.fireTableEvent(TableEvent.EventType.START_DRAFT,null,draft);
}

Fixed version (ground truth):
protected void draft(){
  draft=new BoosterDraft((DraftOptions)options.getLimitedOptions(),getSets());
  for (  TournamentPlayer player : players.values()) {
    draft.addPlayer(player.getPlayer());
    player.setState(TournamentPlayerState.DRAFTING);
  }
  tableEventSource.fireTableEvent(TableEvent.EventType.START_DRAFT,null,draft);
}
Program: 159126
Project: 159126
Buggy source:
private void sideboard(UUID playerId,Deck deck) throws MageException {
  for (  Entry<UUID,UUID> entry : userPlayerMap.entrySet()) {
    if (entry.getValue().equals(playerId)) {
      User user=UserManager.getInstance().getUser(entry.getKey());
      int remaining=(int)futureTimeout.getDelay(TimeUnit.SECONDS);
      if (user != null) {
        user.sideboard(deck,table.getId(),remaining,options.isLimited());
      }
      break;
    }
  }
}

Fixed version (ground truth):
private void sideboard(){
  table.sideboard();
  setupTimeout(Match.SIDEBOARD_TIME);
  if (table.isTournamentSubTable()) {
    for (    MatchPlayer matchPlayer : match.getPlayers()) {
      if (!matchPlayer.hasQuit()) {
        TournamentPlayer tournamentPlayer=table.getTournament().getPlayer(matchPlayer.getPlayer().getId());
        if (tournamentPlayer != null) {
          tournamentPlayer.setStateInfo("String_Node_Str");
        }
      }
    }
  }
  match.sideboard();
  cancelTimeout();
  if (table.isTournamentSubTable()) {
    for (    MatchPlayer matchPlayer : match.getPlayers()) {
      TournamentPlayer tournamentPlayer=table.getTournament().getPlayer(matchPlayer.getPlayer().getId());
      if (tournamentPlayer != null && tournamentPlayer.getStateInfo().equals("String_Node_Str")) {
        tournamentPlayer.setStateInfo("String_Node_Str");
      }
    }
  }
}
Program: 159127
Project: 159127
Buggy source:
/** 
 * Ends the current game and starts if neccessary the next game
 * @return true if table can be closed
 */
public boolean endGameAndStartNextGame(){
  Game game=match.getGame();
  if (game == null) {
    return true;
  }
  UUID choosingPlayerId=match.getChooser();
  match.endGame();
  if (ConfigSettings.getInstance().isSaveGameActivated() && !game.isSimulation()) {
    if (GameManager.getInstance().saveGame(game.getId())) {
      match.setReplayAvailable(true);
    }
  }
  GameManager.getInstance().removeGame(game.getId());
  try {
    if (!match.hasEnded()) {
      table.sideboard();
      setupTimeout(Match.SIDEBOARD_TIME);
      match.sideboard();
      cancelTimeout();
      if (!match.hasEnded()) {
        startGame(choosingPlayerId);
      }
 else {
        closeTable();
      }
    }
 else {
      closeTable();
    }
  }
 catch (  GameException ex) {
    logger.fatal(null,ex);
  }
  return match.hasEnded();
}

Fixed version (ground truth):
/** 
 * Ends the current game and starts if neccessary the next game
 * @return true if table can be closed
 */
public boolean endGameAndStartNextGame(){
  Game game=match.getGame();
  if (game == null) {
    return true;
  }
  UUID choosingPlayerId=match.getChooser();
  match.endGame();
  if (ConfigSettings.getInstance().isSaveGameActivated() && !game.isSimulation()) {
    if (GameManager.getInstance().saveGame(game.getId())) {
      match.setReplayAvailable(true);
    }
  }
  GameManager.getInstance().removeGame(game.getId());
  try {
    if (!match.hasEnded()) {
      sideboard();
      if (!match.hasEnded()) {
        startGame(choosingPlayerId);
      }
 else {
        closeTable();
      }
    }
 else {
      closeTable();
    }
  }
 catch (  GameException ex) {
    logger.fatal(null,ex);
  }
  return match.hasEnded();
}
Program: 159129
Project: 159129
Buggy source:
public void userQuitTournamentSubTables(UUID tournamentId,UUID userId){
  for (  TableController controller : controllers.values()) {
    if (controller.getTable().isTournamentSubTable() && controller.getTable().getTournament().getId().equals(tournamentId)) {
      if (controller.isPlayer(userId)) {
        Match match=controller.getTable().getMatch();
        if (match != null) {
          if (!match.hasEnded() && match.getGame() != null) {
            GameManager.getInstance().quitMatch(match.getGame().getId(),userId);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void userQuitTournamentSubTables(UUID tournamentId,UUID userId){
  for (  TableController controller : controllers.values()) {
    if (controller.getTable().isTournamentSubTable() && controller.getTable().getTournament().getId().equals(tournamentId)) {
      if (controller.hasPlayer(userId)) {
        controller.leaveTable(userId);
      }
    }
  }
}
Program: 159131
Project: 159131
Buggy source:
@Override public boolean apply(Game game,Ability source){
  boolean isMountain=false;
  Card sourceCard=game.getCard(source.getSourceId());
  Player player=game.getPlayer(source.getControllerId());
  if (player == null || sourceCard == null) {
    return false;
  }
  Cards cards=new CardsImpl();
  while (player.getLibrary().size() > 0) {
    Card card=player.getLibrary().removeFromTop(game);
    if (card != null) {
      cards.add(card);
      if (card.getCardType().contains(CardType.LAND)) {
        if (card.getSubtype().contains("String_Node_Str")) {
          isMountain=true;
        }
        break;
      }
    }
 else {
      break;
    }
  }
  player.revealCards(sourceCard.getName(),cards,game);
  int damage=cards.size();
  if (isMountain == true) {
    damage*=2;
  }
  Permanent permanent=game.getPermanent(targetPointer.getFirst(game,source));
  if (permanent != null) {
    permanent.damage(damage,source.getSourceId(),game,false,true);
  }
 else {
    Player targetPlayer=game.getPlayer(targetPointer.getFirst(game,source));
    if (targetPlayer != null) {
      targetPlayer.damage(damage,source.getSourceId(),game,false,true);
    }
  }
  TargetCard target=new TargetCard(Zone.LIBRARY,new FilterCard("String_Node_Str"));
  while (player.isInGame() && cards.size() > 1) {
    player.choose(Outcome.Neutral,cards,target,game);
    Card card=cards.get(target.getFirstTarget(),game);
    if (card != null) {
      player.moveCardToLibraryWithInfo(card,source.getSourceId(),game,Zone.LIBRARY,false,true);
    }
    target.clearChosen();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  boolean isMountain=false;
  Card sourceCard=game.getCard(source.getSourceId());
  Player player=game.getPlayer(source.getControllerId());
  if (player == null || sourceCard == null) {
    return false;
  }
  Cards cards=new CardsImpl();
  while (player.getLibrary().size() > 0) {
    Card card=player.getLibrary().removeFromTop(game);
    if (card != null) {
      cards.add(card);
      if (card.getCardType().contains(CardType.LAND)) {
        if (card.getSubtype().contains("String_Node_Str")) {
          isMountain=true;
        }
        break;
      }
    }
 else {
      break;
    }
  }
  player.revealCards(sourceCard.getName(),cards,game);
  int damage=cards.size();
  if (isMountain == true) {
    damage*=2;
  }
  Permanent permanent=game.getPermanent(targetPointer.getFirst(game,source));
  if (permanent != null) {
    permanent.damage(damage,source.getSourceId(),game,false,true);
  }
 else {
    Player targetPlayer=game.getPlayer(targetPointer.getFirst(game,source));
    if (targetPlayer != null) {
      targetPlayer.damage(damage,source.getSourceId(),game,false,true);
    }
  }
  player.putCardsOnBottomOfLibrary(cards,game,source,true);
  return true;
}
Program: 159132
Project: 159132
Buggy source:
public VileRequiem(final VileRequiem card){
  super(card);
}

Fixed version (ground truth):
public VileRequiem(final VileRequiem card){
  super(card);
  this.originalId=card.originalId;
}
Program: 159134
Project: 159134
Buggy source:
@Override public VastwoodAnimist copy(){
  return new VastwoodAnimist(this);
}

Fixed version (ground truth):
@Override public VastwoodAnimistEffect copy(){
  return new VastwoodAnimistEffect(this);
}
Program: 159135
Project: 159135
Buggy source:
public MatchOptions(String name,String gameType){
  this.name=name;
  this.gameType=gameType;
}

Fixed version (ground truth):
public MatchOptions(String name,String gameType){
  this.name=name;
  this.gameType=gameType;
  this.password="String_Node_Str";
}
Program: 159136
Project: 159136
Buggy source:
@Override public GameInfo createGameInfo(Game game){
  StringBuilder playersInfo=new StringBuilder();
  int counter=0;
  Player currentPlayer=null;
  PlayerList playerList=game.getPlayerList();
  if (game.getStartingPlayerId() != null) {
    playerList.setCurrent(game.getStartingPlayerId());
    currentPlayer=game.getPlayer(game.getStartingPlayerId());
  }
  if (currentPlayer == null) {
    currentPlayer=playerList.getCurrent(game);
  }
  do {
    if (counter > 0) {
      playersInfo.append("String_Node_Str");
    }
    playersInfo.append(currentPlayer.getName());
    counter++;
    currentPlayer=game.getPlayer(playerList.getNext());
  }
 while (!currentPlayer.getId().equals(game.getStartingPlayerId()));
  String state;
  String result;
  String duelingTime="String_Node_Str";
  if (game.hasEnded()) {
    if (game.getEndTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result=game.getWinner();
  }
 else {
    if (game.getStartTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result="String_Node_Str";
  }
  return new GameInfo(0,this.getId(),game.getId(),state,result,playersInfo.toString(),tableId);
}

Fixed version (ground truth):
@Override public GameInfo createGameInfo(Game game){
  StringBuilder playersInfo=new StringBuilder();
  int counter=0;
  Player currentPlayer=null;
  PlayerList playerList=game.getPlayerList();
  if (game.getStartingPlayerId() != null) {
    playerList.setCurrent(game.getStartingPlayerId());
    currentPlayer=game.getPlayer(game.getStartingPlayerId());
  }
  if (currentPlayer == null) {
    currentPlayer=playerList.getCurrent(game);
  }
  if (currentPlayer != null) {
    do {
      if (counter > 0) {
        playersInfo.append("String_Node_Str");
      }
      playersInfo.append(currentPlayer.getName());
      counter++;
      currentPlayer=game.getPlayer(playerList.getNext());
    }
 while (!currentPlayer.getId().equals(game.getStartingPlayerId()));
  }
 else {
    playersInfo.append("String_Node_Str");
  }
  String state;
  String result;
  String duelingTime="String_Node_Str";
  if (game.hasEnded()) {
    if (game.getEndTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result=game.getWinner();
  }
 else {
    if (game.getStartTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result="String_Node_Str";
  }
  return new GameInfo(0,this.getId(),game.getId(),state,result,playersInfo.toString(),tableId);
}
Program: 159138
Project: 159138
Buggy source:
KeranosGodOfStormsTriggeredAbility(final KeranosGodOfStormsTriggeredAbility ability){
  super(ability);
}

Fixed version (ground truth):
KeranosGodOfStormsTriggeredAbility(final KeranosGodOfStormsTriggeredAbility ability){
  super(ability);
  this.lastTriggeredTurn=ability.lastTriggeredTurn;
}
Program: 159139
Project: 159139
Buggy source:
@Override public GameInfo createGameInfo(Game game){
  StringBuilder playersInfo=new StringBuilder();
  int counter=0;
  PlayerList playerList=game.getPlayerList();
  playerList.setCurrent(game.getStartingPlayerId());
  Player currentPlayer=game.getPlayer(game.getStartingPlayerId());
  do {
    if (counter > 0) {
      playersInfo.append("String_Node_Str");
    }
    playersInfo.append(currentPlayer.getName());
    counter++;
    currentPlayer=game.getPlayer(playerList.getNext());
  }
 while (!currentPlayer.getId().equals(game.getStartingPlayerId()));
  String state;
  String result;
  String duelingTime="String_Node_Str";
  if (game.hasEnded()) {
    if (game.getEndTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result=game.getWinner();
  }
 else {
    if (game.getStartTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result="String_Node_Str";
  }
  return new GameInfo(0,this.getId(),game.getId(),state,result,playersInfo.toString(),tableId);
}

Fixed version (ground truth):
@Override public GameInfo createGameInfo(Game game){
  StringBuilder playersInfo=new StringBuilder();
  int counter=0;
  Player currentPlayer=null;
  PlayerList playerList=game.getPlayerList();
  if (game.getStartingPlayerId() != null) {
    playerList.setCurrent(game.getStartingPlayerId());
    currentPlayer=game.getPlayer(game.getStartingPlayerId());
  }
  if (currentPlayer == null) {
    currentPlayer=playerList.getCurrent(game);
  }
  do {
    if (counter > 0) {
      playersInfo.append("String_Node_Str");
    }
    playersInfo.append(currentPlayer.getName());
    counter++;
    currentPlayer=game.getPlayer(playerList.getNext());
  }
 while (!currentPlayer.getId().equals(game.getStartingPlayerId()));
  String state;
  String result;
  String duelingTime="String_Node_Str";
  if (game.hasEnded()) {
    if (game.getEndTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result=game.getWinner();
  }
 else {
    if (game.getStartTime() != null) {
      duelingTime="String_Node_Str" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + "String_Node_Str";
    }
    state="String_Node_Str" + duelingTime;
    result="String_Node_Str";
  }
  return new GameInfo(0,this.getId(),game.getId(),state,result,playersInfo.toString(),tableId);
}
Program: 159144
Project: 159144
Buggy source:
@Override public void run(){
  try {
    player.quit(game);
  }
 catch (  Exception ex) {
    if (ex != null) {
      logger.fatal("String_Node_Str" + (ex.getMessage() == null ? "String_Node_Str" : ex.getMessage()));
      if (ex.getCause() != null) {
        logger.debug("String_Node_Str" + (ex.getCause().getMessage() == null ? "String_Node_Str" : ex.getCause().getMessage()));
      }
      ex.printStackTrace();
    }
 else {
      logger.fatal("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    player.quit(game);
  }
 catch (  Exception ex) {
    if (ex != null) {
      logger.fatal("String_Node_Str" + (ex.getMessage() == null ? "String_Node_Str" : ex.getMessage()));
      logger.debug("String_Node_Str" + game.getId() + "String_Node_Str"+ playerId);
      if (ex.getCause() != null) {
        logger.debug("String_Node_Str" + (ex.getCause().getMessage() == null ? "String_Node_Str" : ex.getCause().getMessage()));
      }
      ex.printStackTrace();
    }
 else {
      logger.fatal("String_Node_Str" + game.getId() + "String_Node_Str"+ playerId);
    }
  }
}
Program: 159145
Project: 159145
Buggy source:
public void quitGame(){
  if (game != null) {
    final Player player=game.getPlayer(playerId);
    if (player != null && player.isInGame()) {
      callExecutor.execute(new Runnable(){
        @Override public void run(){
          try {
            player.quit(game);
          }
 catch (          Exception ex) {
            if (ex != null) {
              logger.fatal("String_Node_Str" + (ex.getMessage() == null ? "String_Node_Str" : ex.getMessage()));
              if (ex.getCause() != null) {
                logger.debug("String_Node_Str" + (ex.getCause().getMessage() == null ? "String_Node_Str" : ex.getCause().getMessage()));
              }
              ex.printStackTrace();
            }
 else {
              logger.fatal("String_Node_Str");
            }
          }
        }
      }
);
    }
  }
 else {
    logger.error("String_Node_Str" + (playerId == null ? "String_Node_Str" : playerId));
  }
}

Fixed version (ground truth):
public void quitGame(){
  if (game != null) {
    final Player player=game.getPlayer(playerId);
    if (player != null && player.isInGame()) {
      callExecutor.execute(new Runnable(){
        @Override public void run(){
          try {
            player.quit(game);
          }
 catch (          Exception ex) {
            if (ex != null) {
              logger.fatal("String_Node_Str" + (ex.getMessage() == null ? "String_Node_Str" : ex.getMessage()));
              logger.debug("String_Node_Str" + game.getId() + "String_Node_Str"+ playerId);
              if (ex.getCause() != null) {
                logger.debug("String_Node_Str" + (ex.getCause().getMessage() == null ? "String_Node_Str" : ex.getCause().getMessage()));
              }
              ex.printStackTrace();
            }
 else {
              logger.fatal("String_Node_Str" + game.getId() + "String_Node_Str"+ playerId);
            }
          }
        }
      }
);
    }
  }
 else {
    logger.error("String_Node_Str" + (playerId == null ? "String_Node_Str" : playerId));
  }
}
Program: 159146
Project: 159146
Buggy source:
@Override public boolean isPaid(){
  return paid | payment.getColorless() == 1;
}

Fixed version (ground truth):
@Override public boolean isPaid(){
  if (paid) {
    return true;
  }
  return this.isColorlessPaid(1);
}
Program: 159148
Project: 159148
Buggy source:
public int emptyManaType(List<ManaType> manaTypeArray){
  int total=count();
  Iterator<ManaPoolItem> it=manaItems.iterator();
  while (it.hasNext()) {
    ManaPoolItem item=it.next();
    for (    ManaType manaType : manaTypeArray) {
      if (item.get(manaType) > 0) {
        total+=item.get(manaType);
        item.remove(manaType);
      }
    }
    if (item.count() == 0) {
      it.remove();
    }
  }
  return total;
}

Fixed version (ground truth):
public int emptyManaType(List<ManaType> manaTypeArray){
  int total=count();
  Iterator<ManaPoolItem> it=manaItems.iterator();
  while (it.hasNext()) {
    ManaPoolItem item=it.next();
    for (    ManaType manaType : manaTypeArray) {
      if (item.get(manaType) > 0) {
        total+=item.get(manaType);
        while (item.get(manaType) > 0) {
          item.remove(manaType);
        }
      }
    }
    if (item.count() == 0) {
      it.remove();
    }
  }
  return total;
}
Program: 159149
Project: 159149
Buggy source:
public ContinuousEffectImpl(final ContinuousEffectImpl effect){
  super(effect);
  this.duration=effect.duration;
  this.layer=effect.layer;
  this.sublayer=effect.sublayer;
  this.timestamp=new Date(effect.timestamp.getTime());
  this.used=effect.used;
  this.discarded=effect.discarded;
  this.affectedObjectsSet=effect.affectedObjectsSet;
  this.objects.addAll(effect.objects);
}

Fixed version (ground truth):
public ContinuousEffectImpl(final ContinuousEffectImpl effect){
  super(effect);
  this.duration=effect.duration;
  this.layer=effect.layer;
  this.sublayer=effect.sublayer;
  this.timestamp=new Date(effect.timestamp.getTime());
  this.used=effect.used;
  this.discarded=effect.discarded;
  this.affectedObjectsSet=effect.affectedObjectsSet;
  this.objects.addAll(effect.objects);
  this.startingTurn=effect.startingTurn;
  this.startingControllerId=effect.startingControllerId;
}