nus-yam/ex-repair huggingface dataset:
Program: 159950
Project: 159950
Buggy source:
private void handleError(Exception ex){
  logger.fatal("String_Node_Str",ex);
  JOptionPane.showMessageDialog(MageFrame.getDesktop(),"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
}

Fixed version (ground truth):
private void handleError(Exception ex){
  logger.fatal("String_Node_Str",ex);
  MageFrame.getInstance().showErrorDialog("String_Node_Str",ex.getMessage());
}
Program: 159951
Project: 159951
Buggy source:
@Override public boolean joinTable(UUID roomId,UUID tableId,String playerName,String playerType,int skill,DeckCardLists deckList){
  try {
    if (isConnected())     return server.joinTable(sessionId,roomId,tableId,playerName,playerType,skill,deckList);
  }
 catch (  GameException ex) {
    handleGameException(ex);
  }
catch (  MageException ex) {
    handleMageException(ex);
  }
catch (  Throwable t) {
    handleThrowable(t);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean joinTable(UUID roomId,UUID tableId,String playerName,String playerType,int skill,DeckCardLists deckList){
  try {
    if (isConnected())     return server.joinTable(sessionId,roomId,tableId,playerName,playerType,skill,deckList);
  }
 catch (  InvalidDeckException iex) {
    handleInvalidDeckException(iex);
  }
catch (  GameException ex) {
    handleGameException(ex);
  }
catch (  MageException ex) {
    handleMageException(ex);
  }
catch (  Throwable t) {
    handleThrowable(t);
  }
  return false;
}
Program: 159952
Project: 159952
Buggy source:
private void handleMageException(MageException ex){
  logger.fatal("String_Node_Str",ex);
}

Fixed version (ground truth):
private void handleMageException(MageException ex){
  logger.fatal("String_Node_Str",ex);
  client.showError(ex.getMessage());
}
Program: 159953
Project: 159953
Buggy source:
private JPanel getArrowsPanel(UUID gameId){
  if (!arrowPanels.containsKey(gameId)) {
    JPanel arrowPanel=new JPanel();
    arrowPanel.setVisible(true);
    arrowPanel.setOpaque(false);
    arrowPanel.setLayout(null);
    arrowPanel.setBorder(BorderFactory.createLineBorder(Color.blue));
    arrowPanel.setSize(currentWidth,currentHeight);
    arrowPanels.put(gameId,arrowPanel);
    getArrowsManagerPanel().add(arrowPanel);
    return arrowPanel;
  }
  return arrowPanels.get(gameId);
}

Fixed version (ground truth):
private JPanel getArrowsPanel(UUID gameId){
  if (!arrowPanels.containsKey(gameId)) {
    JPanel arrowPanel=new JPanel();
    arrowPanel.setVisible(true);
    arrowPanel.setOpaque(false);
    arrowPanel.setLayout(null);
    arrowPanel.setSize(currentWidth,currentHeight);
    arrowPanels.put(gameId,arrowPanel);
    getArrowsManagerPanel().add(arrowPanel);
    return arrowPanel;
  }
  return arrowPanels.get(gameId);
}
Program: 159954
Project: 159954
Buggy source:
@Override public SerraAvengerCost copy(){
  return new SerraAvengerCost(this);
}

Fixed version (ground truth):
@Override public CantCastSerraAvengerEffect copy(){
  return new CantCastSerraAvengerEffect(this);
}
Program: 159955
Project: 159955
Buggy source:
private void drawArrowsForEnchantPlayers(TransferData data,Point parentPoint){
  for (  PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
    PlayerPanelExt playAreaPanel=pa.getPlayerPanel();
    if (playAreaPanel != null && playAreaPanel.getPlayer() != null && playAreaPanel.getPlayer().hasAttachments()) {
      Point me=new Point(data.locationOnScreen);
      me.translate(-parentPoint.x,-parentPoint.y);
      for (      UUID attachmentId : playAreaPanel.getPlayer().getAttachments()) {
        if (attachmentId.equals(data.card.getId())) {
          Point player=pa.getLocationOnScreen();
          player.translate(-parentPoint.x,-parentPoint.y);
          ArrowBuilder.getBuilder().addArrow(data.gameId,(int)me.getX() + 35,(int)me.getY(),(int)player.getX() + 40,(int)player.getY() - 40,Color.magenta,ArrowBuilder.Type.ENCHANT_PLAYERS);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void drawArrowsForEnchantPlayers(TransferData data,Point parentPoint){
  if (data.gameId != null) {
    for (    PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
      PlayerPanelExt playAreaPanel=pa.getPlayerPanel();
      if (playAreaPanel != null && playAreaPanel.getPlayer() != null && playAreaPanel.getPlayer().hasAttachments()) {
        Point me=new Point(data.locationOnScreen);
        me.translate(-parentPoint.x,-parentPoint.y);
        for (        UUID attachmentId : playAreaPanel.getPlayer().getAttachments()) {
          if (attachmentId.equals(data.card.getId())) {
            Point player=pa.getLocationOnScreen();
            player.translate(-parentPoint.x,-parentPoint.y);
            ArrowBuilder.getBuilder().addArrow(data.gameId,(int)me.getX() + 35,(int)me.getY(),(int)player.getX() + 40,(int)player.getY() - 40,Color.magenta,ArrowBuilder.Type.ENCHANT_PLAYERS);
          }
        }
      }
    }
  }
}
Program: 159956
Project: 159956
Buggy source:
@Override public boolean apply(Game game,Ability source){
  int damage=source.getManaCostsToPay().getX();
  if (damage > 0) {
    Permanent permanent=game.getPermanent(getTargetPointer().getFirst(game,source));
    if (permanent != null) {
      permanent.damage(damage,source.getSourceId(),game,true,false);
    }
 else {
      Player player=game.getPlayer(getTargetPointer().getFirst(game,source));
      if (player != null) {
        player.damage(damage,source.getSourceId(),game,false,true);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  int amount=source.getManaCostsToPay().getX();
  if (amount > 0) {
    Permanent permanent=game.getPermanent(getTargetPointer().getFirst(game,source));
    if (permanent != null) {
      permanent.damage(amount,source.getSourceId(),game,true,false);
    }
 else {
      Player player=game.getPlayer(getTargetPointer().getFirst(game,source));
      if (player != null) {
        player.damage(amount,source.getSourceId(),game,false,true);
      }
 else {
        return false;
      }
    }
    Player controller=game.getPlayer(source.getSourceId());
    if (controller != null) {
      controller.gainLife(amount,game);
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 159958
Project: 159958
Buggy source:
@Override public void paint(Graphics g){
  if (!displayEnabled) {
    return;
  }
  if (!isValid()) {
    super.validate();
  }
  Graphics2D g2d=(Graphics2D)g;
  if (transformAngle < 1) {
    float edgeOffset=(cardWidth + cardXOffset) / 2f;
    g2d.translate(edgeOffset * (1 - transformAngle),0);
    g2d.scale(transformAngle,1);
  }
  if (tappedAngle + flippedAngle > 0) {
    g2d=(Graphics2D)g2d.create();
    float edgeOffset=cardWidth / 2f;
    g2d.rotate(tappedAngle + flippedAngle,cardXOffset + edgeOffset,cardYOffset + cardHeight - edgeOffset);
  }
  super.paint(g2d);
}

Fixed version (ground truth):
@Override public void paint(Graphics g){
  if (!displayEnabled) {
    return;
  }
  if (!isValid()) {
    super.validate();
  }
  Graphics2D g2d=(Graphics2D)g;
  if (transformAngle < 1) {
    float edgeOffset=(cardWidth + cardXOffset) / 2f;
    g2d.translate(edgeOffset * (1 - transformAngle),0);
    g2d.scale(transformAngle,1);
  }
  if (tappedAngle + flippedAngle > 0) {
    g2d=(Graphics2D)g2d.create();
    float edgeOffset=cardWidth / 2f;
    double angle=tappedAngle + (Math.abs(flippedAngle - FLIPPED_ANGLE) < 0.001 ? 0 : flippedAngle);
    g2d.rotate(angle,cardXOffset + edgeOffset,cardYOffset + cardHeight - edgeOffset);
  }
  super.paint(g2d);
}
Program: 159959
Project: 159959
Buggy source:
@Override public Token apply(Card source){
  if (target == null)   throw new IllegalArgumentException("String_Node_Str");
  target.setName(source.getName());
  target.getColor().setColor(source.getColor());
  target.getManaCost().clear();
  target.getManaCost().add(source.getManaCost());
  target.getCardType().clear();
  for (  Constants.CardType type : source.getCardType()) {
    target.getCardType().add(type);
  }
  target.getSubtype().clear();
  for (  String type : source.getSubtype()) {
    target.getSubtype().add(type);
  }
  target.getSupertype().clear();
  for (  String type : source.getSupertype()) {
    target.getSupertype().add(type);
  }
  target.getAbilities().clear();
  for (  Ability ability0 : source.getAbilities()) {
    Ability ability=ability0.copy();
    ability.newId();
    ability.setSourceId(target.getId());
    target.addAbility(ability);
  }
  target.getPower().setValue(Integer.parseInt(source.getPower().toString()));
  target.getToughness().setValue(Integer.parseInt(source.getToughness().toString()));
  return target;
}

Fixed version (ground truth):
@Override public Token apply(Card source){
  if (target == null)   throw new IllegalArgumentException("String_Node_Str");
  target.setName(source.getName());
  target.getColor().setColor(source.getColor());
  target.getManaCost().clear();
  target.getManaCost().add(source.getManaCost());
  target.getCardType().clear();
  for (  Constants.CardType type : source.getCardType()) {
    target.getCardType().add(type);
  }
  target.getSubtype().clear();
  for (  String type : source.getSubtype()) {
    target.getSubtype().add(type);
  }
  target.getSupertype().clear();
  for (  String type : source.getSupertype()) {
    target.getSupertype().add(type);
  }
  target.getAbilities().clear();
  for (  Ability ability0 : source.getAbilities()) {
    Ability ability=ability0.copy();
    ability.newId();
    ability.setSourceId(target.getId());
    target.addAbility(ability);
  }
  target.getPower().initValue(Integer.parseInt(source.getPower().toString()));
  target.getToughness().initValue(Integer.parseInt(source.getToughness().toString()));
  return target;
}
Program: 159960
Project: 159960
Buggy source:
@Override public boolean apply(Game game,Ability source){
  int value=amount.calculate(game,source);
  token.putOntoBattlefield(value,game,source.getSourceId(),source.getControllerId());
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  int value=amount.calculate(game,source);
  Token tokenCopy=token.copy();
  tokenCopy.getAbilities().newId();
  tokenCopy.putOntoBattlefield(value,game,source.getSourceId(),source.getControllerId());
  return true;
}
Program: 159963
Project: 159963
Buggy source:
public void pickPile(String message,CardsView pile1,CardsView pile2){
  PickPileDialog pickPileDialog=new PickPileDialog();
  pickPileDialog.loadCards(message,pile1,pile2,bigCard,Config.dimensions,gameId);
  session.sendPlayerBoolean(gameId,pickPileDialog.isPickedPile1());
}

Fixed version (ground truth):
public void pickPile(String message,CardsView pile1,CardsView pile2){
  hideAll();
  PickPileDialog pickPileDialog=new PickPileDialog();
  pickPileDialog.loadCards(message,pile1,pile2,bigCard,Config.dimensions,gameId);
  session.sendPlayerBoolean(gameId,pickPileDialog.isPickedPile1());
}
Program: 159964
Project: 159964
Buggy source:
private ShowCardsDialog showCards(String title,CardsView cards,boolean required,Map<String,Serializable> options){
  ShowCardsDialog showCards=new ShowCardsDialog();
  showCards.loadCards(title,cards,bigCard,Config.dimensionsEnlarged,gameId,required,options);
  return showCards;
}

Fixed version (ground truth):
private ShowCardsDialog showCards(String title,CardsView cards,boolean required,Map<String,Serializable> options){
  hideAll();
  ShowCardsDialog showCards=new ShowCardsDialog();
  showCards.loadCards(title,cards,bigCard,Config.dimensionsEnlarged,gameId,required,options);
  return showCards;
}
Program: 159965
Project: 159965
Buggy source:
public void pickAbility(AbilityPickerView choices){
  DialogManager.getManager(gameId).fadeOut();
  this.abilityPicker.show(choices,MageFrame.getDesktop().getMousePosition());
}

Fixed version (ground truth):
public void pickAbility(AbilityPickerView choices){
  hideAll();
  DialogManager.getManager(gameId).fadeOut();
  this.abilityPicker.show(choices,MageFrame.getDesktop().getMousePosition());
}
Program: 159966
Project: 159966
Buggy source:
public void getChoice(String message,String[] choices){
  PickChoiceDialog pickChoice=new PickChoiceDialog();
  pickChoice.showDialog(message,choices);
  session.sendPlayerString(gameId,pickChoice.getChoice());
}

Fixed version (ground truth):
public void getChoice(String message,String[] choices){
  hideAll();
  PickChoiceDialog pickChoice=new PickChoiceDialog();
  pickChoice.showDialog(message,choices);
  session.sendPlayerString(gameId,pickChoice.getChoice());
}
Program: 159967
Project: 159967
Buggy source:
public void showDialog(String message,String[] choices){
  this.lblMessage.setText(message);
  this.lstChoices.setListData(choices);
  MageFrame.getDesktop().add(this,JLayeredPane.PALETTE_LAYER);
  this.setVisible(true);
}

Fixed version (ground truth):
public void showDialog(String message,String[] choices){
  this.lblMessage.setText(message);
  this.lstChoices.setListData(choices);
  MageFrame.getDesktop().add(this,JLayeredPane.PALETTE_LAYER);
  Point centered=SettingsManager.getInstance().getComponentPosition(getWidth(),getHeight());
  this.setLocation(centered.x,centered.y);
  GuiDisplayUtil.keepComponentInsideScreen(centered.x,centered.y,this);
  this.setVisible(true);
}
Program: 159968
Project: 159968
Buggy source:
public void loadCards(String name,CardsView pile1,CardsView pile2,BigCard bigCard,CardDimensions dimension,UUID gameId){
  this.title=name;
  this.pile1.loadCardsNarrow(pile1,bigCard,dimension,gameId,null);
  this.pile2.loadCardsNarrow(pile2,bigCard,dimension,gameId,null);
  if (getParent() != MageFrame.getDesktop()) {
    MageFrame.getDesktop().add(this,JLayeredPane.POPUP_LAYER);
  }
  pack();
  this.revalidate();
  this.repaint();
  this.setModal(true);
  this.setVisible(true);
}

Fixed version (ground truth):
public void loadCards(String name,CardsView pile1,CardsView pile2,BigCard bigCard,CardDimensions dimension,UUID gameId){
  this.title=name;
  this.pile1.loadCardsNarrow(pile1,bigCard,dimension,gameId,null);
  this.pile2.loadCardsNarrow(pile2,bigCard,dimension,gameId,null);
  if (getParent() != MageFrame.getDesktop()) {
    MageFrame.getDesktop().add(this,JLayeredPane.POPUP_LAYER);
  }
  pack();
  Point centered=SettingsManager.getInstance().getComponentPosition(getWidth(),getHeight());
  this.setLocation(centered.x,centered.y);
  GuiDisplayUtil.keepComponentInsideScreen(centered.x,centered.y,this);
  this.revalidate();
  this.repaint();
  this.setModal(true);
  this.setVisible(true);
}
Program: 159969
Project: 159969
Buggy source:
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
    Permanent creature=game.getPermanent(event.getSourceId());
    Permanent damagedCreature=game.getPermanent(event.getTargetId());
    if (creature != null && damagedCreature != null && creature.getCardType().contains(CardType.CREATURE) && creature.getSubtype().contains("String_Node_Str") && creature.getControllerId().equals(controllerId)) {
      this.getEffects().get(0).setValue("String_Node_Str",event.getAmount());
      this.getEffects().get(0).setValue("String_Node_Str",damagedCreature.getControllerId());
      this.getEffects().get(0).setValue("String_Node_Str",event.getSourceId());
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean checkTrigger(GameEvent event,Game game){
  if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
    Permanent creature=game.getPermanent(event.getSourceId());
    Permanent damagedCreature=game.getPermanent(event.getTargetId());
    if (creature != null && damagedCreature != null && creature.getCardType().contains(CardType.CREATURE) && creature.hasSubtype("String_Node_Str") && creature.getControllerId().equals(controllerId)) {
      this.getEffects().get(0).setValue("String_Node_Str",event.getAmount());
      this.getEffects().get(0).setValue("String_Node_Str",damagedCreature.getControllerId());
      this.getEffects().get(0).setValue("String_Node_Str",event.getSourceId());
      return true;
    }
  }
  return false;
}
Program: 159970
Project: 159970
Buggy source:
@Override public boolean apply(Game game,Ability source){
  Integer damageAmount=(Integer)this.getValue("String_Node_Str");
  UUID controllerId=(UUID)this.getValue("String_Node_Str");
  UUID sourceOfDamage=(UUID)this.getValue("String_Node_Str");
  if (damageAmount != null && controllerId != null) {
    Permanent permanent=game.getPermanent(sourceOfDamage);
    if (permanent == null) {
      permanent=(Permanent)game.getLastKnownInformation(sourceOfDamage,Constants.Zone.BATTLEFIELD);
    }
    if (permanent != null) {
      Player player=game.getPlayer(controllerId);
      if (player != null) {
        player.damage(damageAmount,sourceOfDamage,game,false,true);
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean apply(Game game,Ability source){
  Integer damageAmount=(Integer)this.getValue("String_Node_Str");
  UUID controllerId=(UUID)this.getValue("String_Node_Str");
  UUID sourceOfDamage=(UUID)this.getValue("String_Node_Str");
  if (damageAmount != null && controllerId != null) {
    Permanent permanent=game.getPermanent(sourceOfDamage);
    if (permanent == null) {
      permanent=(Permanent)game.getLastKnownInformation(sourceOfDamage,Constants.Zone.BATTLEFIELD);
    }
    if (permanent != null) {
      Player player=game.getPlayer(controllerId);
      if (player != null) {
        player.damage(damageAmount,sourceOfDamage,game,false,true);
        game.informPlayers(new StringBuilder(permanent.getName()).append("String_Node_Str").append(damageAmount).append("String_Node_Str").append(player.getName()).toString());
        return true;
      }
    }
  }
  return false;
}
Program: 159971
Project: 159971
Buggy source:
private void resizeTooltipIfNeeded(StringBuilder buffer,Component container){
  if (container == null) {
    return;
  }
  int i=buffer.indexOf("String_Node_Str");
  int count=0;
  while (i != -1) {
    count++;
    i=buffer.indexOf("String_Node_Str",i + 1);
  }
  if (count > 5 && this.type == 0) {
    type=1;
    container.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MAX + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH);
    this.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MAX);
  }
 else   if (type == 1) {
    type=0;
    container.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH);
    this.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MIN);
  }
}

Fixed version (ground truth):
private void resizeTooltipIfNeeded(StringBuilder buffer,Component container){
  if (container == null) {
    return;
  }
  int i=buffer.indexOf("String_Node_Str");
  int count=0;
  while (i != -1) {
    count++;
    i=buffer.indexOf("String_Node_Str",i + 1);
  }
  if (count > 5 && this.type == 0) {
    type=1;
    container.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MAX + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH);
    this.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MAX);
  }
 else   if (count < 6 && type == 1) {
    type=0;
    container.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH);
    this.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN,org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MIN);
  }
}
Program: 159972
Project: 159972
Buggy source:
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType() == EventType.ZONE_CHANGE) {
    ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
    if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applies(GameEvent event,Ability source,Game game){
  if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
    ZoneChangeEvent zEvent=(ZoneChangeEvent)event;
    if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
      return true;
    }
  }
  return false;
}
Program: 159973
Project: 159973
Buggy source:
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Card card=game.getCard(event.getTargetId());
  if (card != null && event.getTargetId().equals(source.getSourceId())) {
    return card.moveToZone(Zone.LIBRARY,source.getId(),game,false);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean replaceEvent(GameEvent event,Ability source,Game game){
  Card card=game.getCard(event.getTargetId());
  if (card != null) {
    return card.moveToZone(Zone.LIBRARY,source.getId(),game,false);
  }
  return false;
}
Program: 159974
Project: 159974
Buggy source:
private void addTooltipContainer(){
  final JEditorPane cardInfoPane=(JEditorPane)Plugins.getInstance().getCardInfoPane();
  if (cardInfoPane == null) {
    return;
  }
  cardInfoPane.setSize(320,201);
  cardInfoPane.setLocation(40,40);
  cardInfoPane.setBackground(new Color(0,0,0,0));
  MageRoundPane popupContainer=new MageRoundPane();
  popupContainer.setLayout(null);
  popupContainer.add(cardInfoPane);
  popupContainer.setVisible(false);
  popupContainer.setBounds(0,0,320 + 80,201 + 80);
  desktopPane.add(popupContainer,JLayeredPane.POPUP_LAYER);
  ui.addComponent(MageComponents.CARD_INFO_PANE,cardInfoPane);
  ui.addComponent(MageComponents.POPUP_CONTAINER,popupContainer);
  JPanel cardPreviewContainer=new JPanel();
  cardPreviewContainer.setOpaque(false);
  cardPreviewContainer.setLayout(null);
  BigCard bigCard=new BigCard();
  bigCard.setSize(320,500);
  bigCard.setLocation(40,40);
  bigCard.setBackground(new Color(0,0,0,0));
  cardPreviewContainer.add(bigCard);
  cardPreviewContainer.setVisible(false);
  cardPreviewContainer.setBounds(0,0,320 + 80,500 + 30);
  ui.addComponent(MageComponents.CARD_PREVIEW_PANE,bigCard);
  ui.addComponent(MageComponents.CARD_PREVIEW_CONTAINER,cardPreviewContainer);
  desktopPane.add(cardPreviewContainer,JLayeredPane.POPUP_LAYER);
}

Fixed version (ground truth):
private void addTooltipContainer(){
  final JEditorPane cardInfoPane=(JEditorPane)Plugins.getInstance().getCardInfoPane();
  if (cardInfoPane == null) {
    return;
  }
  cardInfoPane.setSize(Constants.TOOLTIP_WIDTH_MIN,Constants.TOOLTIP_HEIGHT_MIN);
  cardInfoPane.setLocation(40,40);
  cardInfoPane.setBackground(new Color(0,0,0,0));
  MageRoundPane popupContainer=new MageRoundPane();
  popupContainer.setLayout(null);
  popupContainer.add(cardInfoPane);
  popupContainer.setVisible(false);
  popupContainer.setBounds(0,0,Constants.TOOLTIP_WIDTH_MIN + Constants.TOOLTIP_BORDER_WIDTH,Constants.TOOLTIP_HEIGHT_MIN + Constants.TOOLTIP_BORDER_WIDTH);
  desktopPane.add(popupContainer,JLayeredPane.POPUP_LAYER);
  ui.addComponent(MageComponents.CARD_INFO_PANE,cardInfoPane);
  ui.addComponent(MageComponents.POPUP_CONTAINER,popupContainer);
  JPanel cardPreviewContainer=new JPanel();
  cardPreviewContainer.setOpaque(false);
  cardPreviewContainer.setLayout(null);
  BigCard bigCard=new BigCard();
  bigCard.setSize(320,500);
  bigCard.setLocation(40,40);
  bigCard.setBackground(new Color(0,0,0,0));
  cardPreviewContainer.add(bigCard);
  cardPreviewContainer.setVisible(false);
  cardPreviewContainer.setBounds(0,0,320 + 80,500 + 30);
  ui.addComponent(MageComponents.CARD_PREVIEW_PANE,bigCard);
  ui.addComponent(MageComponents.CARD_PREVIEW_CONTAINER,cardPreviewContainer);
  desktopPane.add(cardPreviewContainer,JLayeredPane.POPUP_LAYER);
}
Program: 159976
Project: 159976
Buggy source:
private void sumbitShowPopupTask(final TransferData data,final Component parentComponent,final Point parentPoint){
  ThreadUtils.threadPool2.submit(new Runnable(){
    @Override public void run(){
      ThreadUtils.sleep(300);
      if (popupCard == null || !popupCard.equals(data.card)) {
        return;
      }
      try {
        if (session == null || !state || enlarged) {
          return;
        }
        final Component popupContainer=MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
        Component popup2=MageFrame.getUI().getComponent(MageComponents.CARD_INFO_PANE);
        ((CardInfoPane)popup2).setCard(data.card);
        Point location=new Point((int)data.locationOnScreen.getX() + data.popupOffsetX - 40,(int)data.locationOnScreen.getY() + data.popupOffsetY - 40);
        location=GuiDisplayUtil.keepComponentInsideParent(location,parentPoint,popup2,parentComponent);
        location.translate(-parentPoint.x,-parentPoint.y);
        popupContainer.setLocation(location);
        ThreadUtils.sleep(200);
        final Component c=MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE);
        SwingUtilities.invokeLater(new Runnable(){
          @Override public void run(){
            if (!state || enlarged) {
              return;
            }
            popupContainer.setVisible(true);
            c.repaint();
          }
        }
);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}

Fixed version (ground truth):
private void sumbitShowPopupTask(final TransferData data,final Component parentComponent,final Point parentPoint){
  ThreadUtils.threadPool2.submit(new Runnable(){
    @Override public void run(){
      ThreadUtils.sleep(300);
      if (popupCard == null || !popupCard.equals(data.card)) {
        return;
      }
      try {
        if (session == null || !state || enlarged) {
          return;
        }
        final Component popupContainer=MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
        Component popup2=MageFrame.getUI().getComponent(MageComponents.CARD_INFO_PANE);
        ((CardInfoPane)popup2).setCard(data.card,popupContainer);
        Point location=new Point((int)data.locationOnScreen.getX() + data.popupOffsetX - 40,(int)data.locationOnScreen.getY() + data.popupOffsetY - 40);
        location=GuiDisplayUtil.keepComponentInsideParent(location,parentPoint,popup2,parentComponent);
        location.translate(-parentPoint.x,-parentPoint.y);
        popupContainer.setLocation(location);
        ThreadUtils.sleep(200);
        final Component c=MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE);
        SwingUtilities.invokeLater(new Runnable(){
          @Override public void run(){
            if (!state || enlarged) {
              return;
            }
            popupContainer.setVisible(true);
            c.repaint();
          }
        }
);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}
Program: 159978
Project: 159978
Buggy source:
public void run(){
  if (!card.equals(currentCard))   return;
  setText(buffer.toString());
  setCaretPosition(0);
}

Fixed version (ground truth):
public void run(){
  if (!card.equals(currentCard)) {
    return;
  }
  resizeTooltipIfNeeded(buffer,container);
  setText(buffer.toString());
  setCaretPosition(0);
}
Program: 159979
Project: 159979
Buggy source:
void setCard(final CardView card);

Fixed version (ground truth):
void setCard(CardView card,Component container);
Program: 159981
Project: 159981
Buggy source:
@Override public void componentResized(ComponentEvent e){
  int width=((JComponent)e.getSource()).getWidth();
  int height=((JComponent)e.getSource()).getHeight();
  SettingsManager.getInstance().setScreenWidthAndHeight(width,height);
  if (!liteMode && !grayMode) {
    backgroundPane.setSize(width,height);
  }
  JPanel arrowsPanel=ArrowBuilder.getArrowsPanelRef();
  if (arrowsPanel != null) {
    arrowsPanel.setSize(width,height);
  }
  if (title != null) {
    title.setBounds((int)(width - titleRectangle.getWidth()) / 2,(int)(height - titleRectangle.getHeight()) / 2,titleRectangle.width,titleRectangle.height);
  }
}

Fixed version (ground truth):
@Override public void componentResized(ComponentEvent e){
  int width=((JComponent)e.getSource()).getWidth();
  int height=((JComponent)e.getSource()).getHeight();
  SettingsManager.getInstance().setScreenWidthAndHeight(width,height);
  if (!liteMode && !grayMode) {
    backgroundPane.setSize(width,height);
  }
  ArrowBuilder.getBuilder().setSize(width,height);
  if (title != null) {
    title.setBounds((int)(width - titleRectangle.getWidth()) / 2,(int)(height - titleRectangle.getHeight()) / 2,titleRectangle.width,titleRectangle.height);
  }
}
Program: 159982
Project: 159982
Buggy source:
public static void setActive(MagePane frame){
  if (frame == null) {
    return;
  }
  logger.debug("String_Node_Str" + frame.getTitle() + "String_Node_Str");
  if (activeFrame != null) {
    activeFrame.deactivated();
  }
  activeFrame=frame;
  activeFrame.setVisible(true);
  activeFrame.toFront();
  try {
    activeFrame.setSelected(true);
  }
 catch (  PropertyVetoException ex) {
    logger.error("String_Node_Str" + frame.getTitle() + "String_Node_Str");
  }
  activeFrame.activated();
}

Fixed version (ground truth):
public static void setActive(MagePane frame){
  if (frame == null) {
    return;
  }
  logger.debug("String_Node_Str" + frame.getTitle() + "String_Node_Str");
  if (activeFrame != null) {
    activeFrame.deactivated();
  }
  activeFrame=frame;
  activeFrame.setVisible(true);
  activeFrame.toFront();
  try {
    activeFrame.setSelected(true);
  }
 catch (  PropertyVetoException ex) {
    logger.error("String_Node_Str" + frame.getTitle() + "String_Node_Str");
  }
  activeFrame.activated();
  ArrowBuilder.getBuilder().hideAllPanels();
  if (frame instanceof GamePane) {
    ArrowBuilder.getBuilder().showPanel(((GamePane)frame).getGameId());
  }
}
Program: 159983
Project: 159983
Buggy source:
@Override public void mouseExited(MouseEvent arg0){
  if (getMousePosition(true) != null)   return;
  if (popup != null) {
    popup.hide();
    popupShowing=false;
    ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.TARGET);
    ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.PAIRED);
    ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.SOURCE);
  }
}

Fixed version (ground truth):
@Override public void mouseExited(MouseEvent arg0){
  if (getMousePosition(true) != null)   return;
  if (popup != null) {
    popup.hide();
    popupShowing=false;
    ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.TARGET);
    ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.PAIRED);
    ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.SOURCE);
  }
}
Program: 159985
Project: 159985
Buggy source:
public void hideCombat(UUID gameId){
  ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.COMBAT);
  combatAttackers.remove(gameId);
  combatBlockers.remove(gameId);
}

Fixed version (ground truth):
public void hideCombat(UUID gameId){
  ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.COMBAT);
  combatAttackers.remove(gameId);
  combatBlockers.remove(gameId);
}
Program: 159986
Project: 159986
Buggy source:
private void drawBlockers(CombatGroupView group,MagePermanent attackerCard,UUID gameId){
  for (  CardView blocker : group.getBlockers().values()) {
    for (    PlayAreaPanel pa : MageFrame.getGame(gameId).getPlayers().values()) {
      MagePermanent blockerCard=pa.getBattlefieldPanel().getPermanents().get(blocker.getId());
      if (blockerCard != null) {
        parentPoint=getParentPoint(blockerCard);
        Point blockerPoint=blockerCard.getLocationOnScreen();
        blockerPoint.translate(-parentPoint.x,-parentPoint.y);
        Point attackerPoint=attackerCard.getLocationOnScreen();
        attackerPoint.translate(-parentPoint.x,-parentPoint.y);
        double yRateA=(attackerCard.getSize().height / SettingsManager.getInstance().getCardSize().height);
        double xRateA=(attackerCard.getSize().width / SettingsManager.getInstance().getCardSize().width);
        double yRateB=(blockerCard.getSize().height / SettingsManager.getInstance().getCardSize().height);
        double xRateB=(blockerCard.getSize().width / SettingsManager.getInstance().getCardSize().width);
        ArrowBuilder.addArrow((int)blockerPoint.getX() + (int)(55 * xRateB),(int)blockerPoint.getY() + (int)(25 * xRateB),(int)attackerPoint.getX() + (int)(70 * xRateA),(int)attackerPoint.getY() + (int)(25 * yRateA),Color.blue,ArrowBuilder.Type.COMBAT);
        globalBlockersCount++;
      }
    }
  }
}

Fixed version (ground truth):
private void drawBlockers(CombatGroupView group,MagePermanent attackerCard,UUID gameId){
  for (  CardView blocker : group.getBlockers().values()) {
    for (    PlayAreaPanel pa : MageFrame.getGame(gameId).getPlayers().values()) {
      MagePermanent blockerCard=pa.getBattlefieldPanel().getPermanents().get(blocker.getId());
      if (blockerCard != null) {
        parentPoint=getParentPoint(blockerCard);
        Point blockerPoint=blockerCard.getLocationOnScreen();
        blockerPoint.translate(-parentPoint.x,-parentPoint.y);
        Point attackerPoint=attackerCard.getLocationOnScreen();
        attackerPoint.translate(-parentPoint.x,-parentPoint.y);
        double yRateA=(attackerCard.getSize().height / SettingsManager.getInstance().getCardSize().height);
        double xRateA=(attackerCard.getSize().width / SettingsManager.getInstance().getCardSize().width);
        double yRateB=(blockerCard.getSize().height / SettingsManager.getInstance().getCardSize().height);
        double xRateB=(blockerCard.getSize().width / SettingsManager.getInstance().getCardSize().width);
        ArrowBuilder.getBuilder().addArrow(gameId,(int)blockerPoint.getX() + (int)(55 * xRateB),(int)blockerPoint.getY() + (int)(25 * xRateB),(int)attackerPoint.getX() + (int)(70 * xRateA),(int)attackerPoint.getY() + (int)(25 * yRateA),Color.blue,ArrowBuilder.Type.COMBAT);
        globalBlockersCount++;
      }
    }
  }
}
Program: 159987
Project: 159987
Buggy source:
private void drawDefender(CombatGroupView group,MagePermanent attackerCard,UUID gameId){
  UUID defenderId=group.getDefenderId();
  if (defenderId != null) {
    parentPoint=getParentPoint(attackerCard);
    PlayAreaPanel p=MageFrame.getGame(gameId).getPlayers().get(defenderId);
    if (p != null) {
      Point target=p.getLocationOnScreen();
      target.translate(-parentPoint.x,-parentPoint.y);
      Point attackerPoint=attackerCard.getLocationOnScreen();
      attackerPoint.translate(-parentPoint.x,-parentPoint.y);
      ArrowBuilder.addArrow((int)attackerPoint.getX() + 45,(int)attackerPoint.getY() + 25,(int)target.getX() + 40,(int)target.getY() - 20,Color.red,ArrowBuilder.Type.COMBAT);
    }
 else {
      for (      PlayAreaPanel pa : MageFrame.getGame(gameId).getPlayers().values()) {
        MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(defenderId);
        if (permanent != null) {
          Point target=permanent.getLocationOnScreen();
          target.translate(-parentPoint.x,-parentPoint.y);
          Point attackerPoint=attackerCard.getLocationOnScreen();
          attackerPoint.translate(-parentPoint.x,-parentPoint.y);
          ArrowBuilder.addArrow((int)attackerPoint.getX() + 45,(int)attackerPoint.getY() + 25,(int)target.getX() + 40,(int)target.getY() + 10,Color.red,ArrowBuilder.Type.COMBAT);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void drawDefender(CombatGroupView group,MagePermanent attackerCard,UUID gameId){
  UUID defenderId=group.getDefenderId();
  if (defenderId != null) {
    parentPoint=getParentPoint(attackerCard);
    PlayAreaPanel p=MageFrame.getGame(gameId).getPlayers().get(defenderId);
    if (p != null) {
      Point target=p.getLocationOnScreen();
      target.translate(-parentPoint.x,-parentPoint.y);
      Point attackerPoint=attackerCard.getLocationOnScreen();
      attackerPoint.translate(-parentPoint.x,-parentPoint.y);
      ArrowBuilder.getBuilder().addArrow(gameId,(int)attackerPoint.getX() + 45,(int)attackerPoint.getY() + 25,(int)target.getX() + 40,(int)target.getY() - 20,Color.red,ArrowBuilder.Type.COMBAT);
    }
 else {
      for (      PlayAreaPanel pa : MageFrame.getGame(gameId).getPlayers().values()) {
        MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(defenderId);
        if (permanent != null) {
          Point target=permanent.getLocationOnScreen();
          target.translate(-parentPoint.x,-parentPoint.y);
          Point attackerPoint=attackerCard.getLocationOnScreen();
          attackerPoint.translate(-parentPoint.x,-parentPoint.y);
          ArrowBuilder.getBuilder().addArrow(gameId,(int)attackerPoint.getX() + 45,(int)attackerPoint.getY() + 25,(int)target.getX() + 40,(int)target.getY() + 10,Color.red,ArrowBuilder.Type.COMBAT);
        }
      }
    }
  }
}
Program: 159988
Project: 159988
Buggy source:
public void showCombat(List<CombatGroupView> combatView,UUID gameId){
  ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.COMBAT);
  displayArrows(combatView,gameId);
}

Fixed version (ground truth):
public void showCombat(List<CombatGroupView> combatView,UUID gameId){
  ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.COMBAT);
  displayArrows(combatView,gameId);
}
Program: 159990
Project: 159990
Buggy source:
public void replayGame(UUID gameId){
  this.setTitle("String_Node_Str" + gameId);
  gamePanel.replayGame(gameId);
}

Fixed version (ground truth):
public void replayGame(UUID gameId){
  this.setTitle("String_Node_Str" + gameId);
  this.gameId=gameId;
  gamePanel.replayGame(gameId);
}
Program: 159991
Project: 159991
Buggy source:
public void showGame(UUID gameId,UUID playerId){
  this.setTitle("String_Node_Str" + gameId);
  gamePanel.showGame(gameId,playerId);
}

Fixed version (ground truth):
public void showGame(UUID gameId,UUID playerId){
  this.setTitle("String_Node_Str" + gameId);
  this.gameId=gameId;
  gamePanel.showGame(gameId,playerId);
}
Program: 159992
Project: 159992
Buggy source:
public void watchGame(UUID gameId){
  this.setTitle("String_Node_Str" + gameId);
  gamePanel.watchGame(gameId);
}

Fixed version (ground truth):
public void watchGame(UUID gameId){
  this.setTitle("String_Node_Str" + gameId);
  this.gameId=gameId;
  gamePanel.watchGame(gameId);
}
Program: 159994
Project: 159994
Buggy source:
public void endMessage(String message){
  this.feedbackPanel.getFeedback(FeedbackMode.END,message,false,null);
}

Fixed version (ground truth):
public void endMessage(String message){
  this.feedbackPanel.getFeedback(FeedbackMode.END,message,false,null);
  ArrowBuilder.getBuilder().removeAllArrows(gameId);
}
Program: 159995
Project: 159995
Buggy source:
private void sizeToScreen(){
  Rectangle rect=this.getBounds();
  if (rect.height < 720) {
    if (!smallMode) {
      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) {
      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);
      }
    }
  }
  DialogManager.getManager(gameId).setScreenWidth(rect.width);
  DialogManager.getManager(gameId).setScreenHeight(rect.height);
  DialogManager.getManager(gameId).setBounds(0,0,rect.width,rect.height);
}

Fixed version (ground truth):
private void sizeToScreen(){
  Rectangle rect=this.getBounds();
  if (rect.height < 720) {
    if (!smallMode) {
      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) {
      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);
      }
    }
  }
  ArrowBuilder.getBuilder().setSize(rect.width,rect.height);
  DialogManager.getManager(gameId).setScreenWidth(rect.width);
  DialogManager.getManager(gameId).setScreenHeight(rect.height);
  DialogManager.getManager(gameId).setBounds(0,0,rect.width,rect.height);
}
Program: 159996
Project: 159996
Buggy source:
private void drawArrowsForTargets(TransferData data,Point parentPoint){
  List<UUID> targets=data.card.getTargets();
  if (targets != null) {
    Point me=new Point(data.locationOnScreen);
    me.translate(-parentPoint.x,-parentPoint.y);
    for (    UUID uuid : targets) {
      PlayAreaPanel p=MageFrame.getGame(data.gameId).getPlayers().get(uuid);
      if (p != null) {
        Point target=p.getLocationOnScreen();
        target.translate(-parentPoint.x,-parentPoint.y);
        ArrowBuilder.addArrow((int)me.getX() + 35,(int)me.getY(),(int)target.getX() + 40,(int)target.getY() - 40,Color.red,ArrowBuilder.Type.TARGET);
      }
 else {
        for (        PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
          MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(uuid);
          if (permanent != null) {
            Point target=permanent.getLocationOnScreen();
            target.translate(-parentPoint.x,-parentPoint.y);
            ArrowBuilder.addArrow((int)me.getX() + 35,(int)me.getY(),(int)target.getX() + 40,(int)target.getY() + 10,Color.red,ArrowBuilder.Type.TARGET);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void drawArrowsForTargets(TransferData data,Point parentPoint){
  List<UUID> targets=data.card.getTargets();
  if (targets != null) {
    Point me=new Point(data.locationOnScreen);
    me.translate(-parentPoint.x,-parentPoint.y);
    for (    UUID uuid : targets) {
      PlayAreaPanel p=MageFrame.getGame(data.gameId).getPlayers().get(uuid);
      if (p != null) {
        Point target=p.getLocationOnScreen();
        target.translate(-parentPoint.x,-parentPoint.y);
        ArrowBuilder.getBuilder().addArrow(data.gameId,(int)me.getX() + 35,(int)me.getY(),(int)target.getX() + 40,(int)target.getY() - 40,Color.red,ArrowBuilder.Type.TARGET);
      }
 else {
        for (        PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
          MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(uuid);
          if (permanent != null) {
            Point target=permanent.getLocationOnScreen();
            target.translate(-parentPoint.x,-parentPoint.y);
            ArrowBuilder.getBuilder().addArrow(data.gameId,(int)me.getX() + 35,(int)me.getY(),(int)target.getX() + 40,(int)target.getY() + 10,Color.red,ArrowBuilder.Type.TARGET);
          }
        }
      }
    }
  }
}
Program: 159997
Project: 159997
Buggy source:
@Override public void mouseExited(MouseEvent e,final TransferData data){
  hideAll();
}

Fixed version (ground truth):
@Override public void mouseExited(MouseEvent e,final TransferData data){
  hideAll(data.gameId);
}
Program: 159998
Project: 159998
Buggy source:
private void drawArrowsForPairedCards(TransferData data,Point parentPoint){
  if (data.card.getPairedCard() != null) {
    Point me=new Point(data.locationOnScreen);
    me.translate(-parentPoint.x,-parentPoint.y);
    UUID uuid=data.card.getPairedCard();
    for (    PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
      MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(uuid);
      if (permanent != null) {
        Point target=permanent.getLocationOnScreen();
        target.translate(-parentPoint.x,-parentPoint.y);
        ArrowBuilder.addArrow((int)me.getX() + 35,(int)me.getY(),(int)target.getX() + 40,(int)target.getY() + 10,Color.green,ArrowBuilder.Type.PAIRED);
      }
    }
  }
}

Fixed version (ground truth):
private void drawArrowsForPairedCards(TransferData data,Point parentPoint){
  if (data.card.getPairedCard() != null) {
    Point me=new Point(data.locationOnScreen);
    me.translate(-parentPoint.x,-parentPoint.y);
    UUID uuid=data.card.getPairedCard();
    for (    PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
      MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(uuid);
      if (permanent != null) {
        Point target=permanent.getLocationOnScreen();
        target.translate(-parentPoint.x,-parentPoint.y);
        ArrowBuilder.getBuilder().addArrow(data.gameId,(int)me.getX() + 35,(int)me.getY(),(int)target.getX() + 40,(int)target.getY() + 10,Color.green,ArrowBuilder.Type.PAIRED);
      }
    }
  }
}
Program: 159999
Project: 159999
Buggy source:
public void hideAll(){
  hidePopup();
  startHideTimeout();
  this.state=false;
  ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.TARGET);
  ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.PAIRED);
  ArrowBuilder.removeArrowsByType(ArrowBuilder.Type.SOURCE);
}

Fixed version (ground truth):
public void hideAll(UUID gameId){
  hidePopup();
  startHideTimeout();
  this.state=false;
  ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.TARGET);
  ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.PAIRED);
  ArrowBuilder.getBuilder().removeArrowsByType(gameId,ArrowBuilder.Type.SOURCE);
}
Program: 160000
Project: 160000
Buggy source:
private void drawArrowsForSource(TransferData data,Point parentPoint){
  if (data.card.isAbility()) {
    Point me=new Point(data.locationOnScreen);
    me.translate(-parentPoint.x,-parentPoint.y);
    UUID uuid=data.card.getParentId();
    for (    PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
      MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(uuid);
      if (permanent != null) {
        Point source=permanent.getLocationOnScreen();
        source.translate(-parentPoint.x,-parentPoint.y);
        ArrowBuilder.addArrow((int)source.getX() + 40,(int)source.getY() + 10,(int)me.getX() + 35,(int)me.getY() + 20,Color.blue,ArrowBuilder.Type.SOURCE);
      }
    }
  }
}

Fixed version (ground truth):
private void drawArrowsForSource(TransferData data,Point parentPoint){
  if (data.card.isAbility()) {
    Point me=new Point(data.locationOnScreen);
    me.translate(-parentPoint.x,-parentPoint.y);
    UUID uuid=data.card.getParentId();
    for (    PlayAreaPanel pa : MageFrame.getGame(data.gameId).getPlayers().values()) {
      MagePermanent permanent=pa.getBattlefieldPanel().getPermanents().get(uuid);
      if (permanent != null) {
        Point source=permanent.getLocationOnScreen();
        source.translate(-parentPoint.x,-parentPoint.y);
        ArrowBuilder.getBuilder().addArrow(data.gameId,(int)source.getX() + 40,(int)source.getY() + 10,(int)me.getX() + 35,(int)me.getY() + 20,Color.blue,ArrowBuilder.Type.SOURCE);
      }
    }
  }
}