Program: 158981
Project: 158981
Buggy source:
public CardPanel(CardView newGameCard,UUID gameId,final boolean loadImage,ActionCallback callback,final boolean foil,Dimension dimension){
  this.gameCard=newGameCard;
  this.callback=callback;
  this.gameId=gameId;
  this.setCardBounds(0,0,dimension.width,dimension.height);
  this.isPermanent=this.gameCard instanceof PermanentView;
  if (isPermanent) {
    this.hasSickness=((PermanentView)this.gameCard).hasSummoningSickness();
  }
  if (this.gameCard.canTransform()) {
    buttonPanel=new JPanel();
    buttonPanel.setLayout(null);
    buttonPanel.setOpaque(false);
    add(buttonPanel);
    dayNightButton=new JButton("String_Node_Str");
    dayNightButton.setLocation(2,2);
    dayNightButton.setSize(25,25);
    buttonPanel.setVisible(true);
    BufferedImage day=ImageManagerImpl.getInstance().getDayImage();
    dayNightButton.setIcon(new ImageIcon(day));
    buttonPanel.add(dayNightButton);
    dayNightButton.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent e){
        if (animationInProgress || isTapped() || isPermanent) {
          return;
        }
        Animation.transformCard(CardPanel.this,CardPanel.this,true);
      }
    }
);
  }
  counterPanel=new JPanel();
  counterPanel.setLayout(null);
  counterPanel.setOpaque(false);
  add(counterPanel);
  plusCounterLabel=new JLabel("String_Node_Str");
  plusCounterLabel.setToolTipText("String_Node_Str");
  counterPanel.add(plusCounterLabel);
  minusCounterLabel=new JLabel("String_Node_Str");
  minusCounterLabel.setToolTipText("String_Node_Str");
  counterPanel.add(minusCounterLabel);
  loyaltyCounterLabel=new JLabel("String_Node_Str");
  loyaltyCounterLabel.setToolTipText("String_Node_Str");
  counterPanel.add(loyaltyCounterLabel);
  otherCounterLabel=new JLabel("String_Node_Str");
  counterPanel.add(otherCounterLabel);
  counterPanel.setVisible(false);
  if (newGameCard.isAbility()) {
    if (AbilityType.TRIGGERED.equals(newGameCard.getAbilityType())) {
      setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(),"String_Node_Str");
    }
 else     if (AbilityType.ACTIVATED.equals(newGameCard.getAbilityType())) {
      setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(),"String_Node_Str");
    }
  }
  if (this.gameCard.isToken()) {
    setTypeIcon(ImageManagerImpl.getInstance().getTokenIconImage(),"String_Node_Str");
  }
  if (this.gameCard instanceof PermanentView) {
    copyIconPanel=new JPanel();
    copyIconPanel.setLayout(null);
    copyIconPanel.setOpaque(false);
    add(copyIconPanel);
    showCopySourceButton=new JButton("String_Node_Str");
    showCopySourceButton.setLocation(2,2);
    showCopySourceButton.setSize(25,25);
    showCopySourceButton.setToolTipText("String_Node_Str");
    copyIconPanel.setVisible(((PermanentView)this.gameCard).isCopy());
    showCopySourceButton.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getCopyInformIconImage()));
    copyIconPanel.add(showCopySourceButton);
    showCopySourceButton.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent e){
        ActionCallback callback=Plugins.getInstance().getActionCallback();
        ((MageActionCallback)callback).enlargeCard(EnlargeMode.COPY);
      }
    }
);
  }
  setBackground(Color.black);
  setOpaque(false);
  addMouseListener(this);
  addMouseMotionListener(this);
  addMouseWheelListener(this);
  addComponentListener(this);
  displayTitleAnyway=PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_CARD_NAMES,"String_Node_Str").equals("String_Node_Str");
  titleText=new GlowText();
  setText(gameCard);
  titleText.setFont(getFont().deriveFont(Font.BOLD,13f));
  titleText.setForeground(Color.white);
  titleText.setGlow(Color.black,TEXT_GLOW_SIZE,TEXT_GLOW_INTENSITY);
  titleText.setWrap(true);
  add(titleText);
  ptText=new GlowText();
  if (CardUtil.isCreature(gameCard)) {
    ptText.setText(gameCard.getPower() + "String_Node_Str" + gameCard.getToughness());
  }
 else   if (CardUtil.isPlaneswalker(gameCard)) {
    ptText.setText(gameCard.getLoyalty());
  }
  ptText.setFont(getFont().deriveFont(Font.BOLD,13f));
  ptText.setForeground(Color.white);
  ptText.setGlow(Color.black,TEXT_GLOW_SIZE,TEXT_GLOW_INTENSITY);
  add(ptText);
  BufferedImage sickness=ImageManagerImpl.getInstance().getSicknessImage();
  overlayPanel=new ImagePanel(sickness,ImagePanel.SCALED);
  overlayPanel.setOpaque(false);
  add(overlayPanel);
  imagePanel=new ScaledImagePanel();
  imagePanel.setBorder(BorderFactory.createLineBorder(Color.white));
  add(imagePanel);
  imagePanel.setScaleLarger(true);
  imagePanel.setScalingType(ScalingType.nearestNeighbor);
  imagePanel.setScalingMultiPassType(MultipassType.none);
  String cardType=getType(newGameCard);
  popupText.setText(getText(cardType,newGameCard));
  Util.threadPool.submit(new Runnable(){
    @Override public void run(){
      try {
        tappedAngle=isTapped() ? CardPanel.TAPPED_ANGLE : 0;
        flippedAngle=isFlipped() ? CardPanel.FLIPPED_ANGLE : 0;
        if (!loadImage) {
          return;
        }
        BufferedImage srcImage;
        if (gameCard.isFaceDown()) {
          srcImage=getFaceDownImage();
        }
 else {
          srcImage=ImageCache.getImage(gameCard,getCardWidth(),getCardHeight());
        }
        if (srcImage != null) {
          hasImage=true;
          setText(gameCard);
          setImage(srcImage);
        }
        if (gameCard.isTransformed()) {
          toggleTransformed();
        }
        setText(gameCard);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
catch (      Error err) {
        err.printStackTrace();
      }
    }
  }
);
}

Fixed version (ground truth):
public CardPanel(CardView newGameCard,UUID gameId,final boolean loadImage,ActionCallback callback,final boolean foil,Dimension dimension){
  this.gameCard=newGameCard;
  this.callback=callback;
  this.gameId=gameId;
  this.setCardBounds(0,0,dimension.width,dimension.height);
  this.isPermanent=this.gameCard instanceof PermanentView;
  if (isPermanent) {
    this.hasSickness=((PermanentView)this.gameCard).hasSummoningSickness();
  }
  if (this.gameCard.canTransform()) {
    buttonPanel=new JPanel();
    buttonPanel.setLayout(null);
    buttonPanel.setOpaque(false);
    add(buttonPanel);
    dayNightButton=new JButton("String_Node_Str");
    dayNightButton.setLocation(2,2);
    dayNightButton.setSize(25,25);
    buttonPanel.setVisible(true);
    BufferedImage day=ImageManagerImpl.getInstance().getDayImage();
    dayNightButton.setIcon(new ImageIcon(day));
    buttonPanel.add(dayNightButton);
    dayNightButton.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent e){
        if (animationInProgress || isTapped() || isPermanent) {
          return;
        }
        Animation.transformCard(CardPanel.this,CardPanel.this,true);
      }
    }
);
  }
  if (!newGameCard.isAbility()) {
    counterPanel=new JPanel();
    counterPanel.setLayout(null);
    counterPanel.setOpaque(false);
    add(counterPanel);
    plusCounterLabel=new JLabel("String_Node_Str");
    plusCounterLabel.setToolTipText("String_Node_Str");
    counterPanel.add(plusCounterLabel);
    minusCounterLabel=new JLabel("String_Node_Str");
    minusCounterLabel.setToolTipText("String_Node_Str");
    counterPanel.add(minusCounterLabel);
    loyaltyCounterLabel=new JLabel("String_Node_Str");
    loyaltyCounterLabel.setToolTipText("String_Node_Str");
    counterPanel.add(loyaltyCounterLabel);
    otherCounterLabel=new JLabel("String_Node_Str");
    counterPanel.add(otherCounterLabel);
    counterPanel.setVisible(false);
  }
  if (newGameCard.isAbility()) {
    if (AbilityType.TRIGGERED.equals(newGameCard.getAbilityType())) {
      setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(),"String_Node_Str");
    }
 else     if (AbilityType.ACTIVATED.equals(newGameCard.getAbilityType())) {
      setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(),"String_Node_Str");
    }
  }
  if (this.gameCard.isToken()) {
    setTypeIcon(ImageManagerImpl.getInstance().getTokenIconImage(),"String_Node_Str");
  }
  if (this.gameCard instanceof PermanentView) {
    copyIconPanel=new JPanel();
    copyIconPanel.setLayout(null);
    copyIconPanel.setOpaque(false);
    add(copyIconPanel);
    showCopySourceButton=new JButton("String_Node_Str");
    showCopySourceButton.setLocation(2,2);
    showCopySourceButton.setSize(25,25);
    showCopySourceButton.setToolTipText("String_Node_Str");
    copyIconPanel.setVisible(((PermanentView)this.gameCard).isCopy());
    showCopySourceButton.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getCopyInformIconImage()));
    copyIconPanel.add(showCopySourceButton);
    showCopySourceButton.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent e){
        ActionCallback callback=Plugins.getInstance().getActionCallback();
        ((MageActionCallback)callback).enlargeCard(EnlargeMode.COPY);
      }
    }
);
  }
  setBackground(Color.black);
  setOpaque(false);
  addMouseListener(this);
  addMouseMotionListener(this);
  addMouseWheelListener(this);
  addComponentListener(this);
  displayTitleAnyway=PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_CARD_NAMES,"String_Node_Str").equals("String_Node_Str");
  titleText=new GlowText();
  setText(gameCard);
  titleText.setFont(getFont().deriveFont(Font.BOLD,13f));
  titleText.setForeground(Color.white);
  titleText.setGlow(Color.black,TEXT_GLOW_SIZE,TEXT_GLOW_INTENSITY);
  titleText.setWrap(true);
  add(titleText);
  ptText=new GlowText();
  if (CardUtil.isCreature(gameCard)) {
    ptText.setText(gameCard.getPower() + "String_Node_Str" + gameCard.getToughness());
  }
 else   if (CardUtil.isPlaneswalker(gameCard)) {
    ptText.setText(gameCard.getLoyalty());
  }
  ptText.setFont(getFont().deriveFont(Font.BOLD,13f));
  ptText.setForeground(Color.white);
  ptText.setGlow(Color.black,TEXT_GLOW_SIZE,TEXT_GLOW_INTENSITY);
  add(ptText);
  BufferedImage sickness=ImageManagerImpl.getInstance().getSicknessImage();
  overlayPanel=new ImagePanel(sickness,ImagePanel.SCALED);
  overlayPanel.setOpaque(false);
  add(overlayPanel);
  imagePanel=new ScaledImagePanel();
  imagePanel.setBorder(BorderFactory.createLineBorder(Color.white));
  add(imagePanel);
  imagePanel.setScaleLarger(true);
  imagePanel.setScalingType(ScalingType.nearestNeighbor);
  imagePanel.setScalingMultiPassType(MultipassType.none);
  String cardType=getType(newGameCard);
  popupText.setText(getText(cardType,newGameCard));
  Util.threadPool.submit(new Runnable(){
    @Override public void run(){
      try {
        tappedAngle=isTapped() ? CardPanel.TAPPED_ANGLE : 0;
        flippedAngle=isFlipped() ? CardPanel.FLIPPED_ANGLE : 0;
        if (!loadImage) {
          return;
        }
        BufferedImage srcImage;
        if (gameCard.isFaceDown()) {
          srcImage=getFaceDownImage();
        }
 else {
          srcImage=ImageCache.getImage(gameCard,getCardWidth(),getCardHeight());
        }
        if (srcImage != null) {
          hasImage=true;
          setText(gameCard);
          setImage(srcImage);
        }
        if (gameCard.isTransformed()) {
          toggleTransformed();
        }
        setText(gameCard);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
catch (      Error err) {
        err.printStackTrace();
      }
    }
  }
);
}