nus-yam/ex-repair huggingface dataset:
Program: 3987
Project: 3987
Buggy source:
@Override public void initialize(){
  fileManager.getManagedFileList().addManagedListStatusListener(new EventListener<ManagedListStatusEvent>(){
    @Override public void handleEvent(    ManagedListStatusEvent event){
      handleManagedListStatusEvent(event);
    }
  }
);
  fileManager.getGnutellaSharedFileList().addFileListListener(new EventListener<FileListChangedEvent>(){
    @Override public void handleEvent(    FileListChangedEvent event){
      handleFileListEvent(event);
    }
  }
);
}

Fixed version (ground truth):
void initialize(){
  fileManager.getManagedFileList().addManagedListStatusListener(new EventListener<ManagedListStatusEvent>(){
    @Override public void handleEvent(    ManagedListStatusEvent event){
      handleManagedListStatusEvent(event);
    }
  }
);
  fileManager.getGnutellaSharedFileList().addFileListListener(new EventListener<FileListChangedEvent>(){
    @Override public void handleEvent(    FileListChangedEvent event){
      handleFileListEvent(event);
    }
  }
);
}
Program: 3988
Project: 3988
Buggy source:
@Inject void register(ServiceRegistry registry){
  registry.register(new Service(){
    @Override public String getServiceName(){
      return "String_Node_Str";
    }
    @Override public void initialize(){
      fileManager.getManagedFileList().addManagedListStatusListener(new EventListener<ManagedListStatusEvent>(){
        @Override public void handleEvent(        ManagedListStatusEvent event){
          handleManagedListStatusEvent(event);
        }
      }
);
      fileManager.getGnutellaSharedFileList().addFileListListener(new EventListener<FileListChangedEvent>(){
        @Override public void handleEvent(        FileListChangedEvent event){
          handleFileListEvent(event);
        }
      }
);
    }
    @Override public void start(){
    }
    @Override public void stop(){
    }
  }
);
}

Fixed version (ground truth):
@Inject void register(ServiceRegistry registry){
  registry.register(new Service(){
    @Override public String getServiceName(){
      return "String_Node_Str";
    }
    @Override public void initialize(){
      CreationTimeCache.this.initialize();
    }
    @Override public void start(){
    }
    @Override public void stop(){
    }
  }
);
}
Program: 3990
Project: 3990
Buggy source:
@Override protected void configure(){
  bind(FileManager.class).to(MyFileManager.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(FileManager.class).to(FileManagerStub.class);
}
Program: 3992
Project: 3992
Buggy source:
@Override public void setUp() throws Exception {
  hash1=URN.createSHA1Urn("String_Node_Str");
  hash2=URN.createSHA1Urn("String_Node_Str");
  hash3=URN.createSHA1Urn("String_Node_Str");
  hash4=URN.createSHA1Urn("String_Node_Str");
  injector=LimeTestUtils.createInjector(new AbstractModule(){
    @Override protected void configure(){
      bind(FileManager.class).to(MyFileManager.class);
    }
  }
);
  fileManager=(MyFileManager)injector.getInstance(FileManager.class);
  fileManager.setDefaultUrn(hash1);
  fileManager.setValidUrns(new HashSet<URN>(Arrays.asList(hash1,hash2,hash3,hash4)));
}

Fixed version (ground truth):
@Override public void setUp() throws Exception {
  hash1=URN.createSHA1Urn("String_Node_Str");
  hash2=URN.createSHA1Urn("String_Node_Str");
  hash3=URN.createSHA1Urn("String_Node_Str");
  hash4=URN.createSHA1Urn("String_Node_Str");
  injector=LimeTestUtils.createInjector(new AbstractModule(){
    @Override protected void configure(){
      bind(FileManager.class).to(FileManagerStub.class);
    }
  }
);
  fileManager=(FileManagerStub)injector.getInstance(FileManager.class);
  fd1=new FileDescStub("String_Node_Str",hash1,0);
  fd2=new FileDescStub("String_Node_Str",hash2,1);
  fd3=new FileDescStub("String_Node_Str",hash3,2);
  fd4=new FileDescStub("String_Node_Str",hash4,3);
  fileManager.getGnutellaSharedFileList().add(fd1);
  fileManager.getGnutellaSharedFileList().add(fd2);
  fileManager.getGnutellaSharedFileList().add(fd3);
  fileManager.getGnutellaSharedFileList().add(fd4);
}
Program: 3993
Project: 3993
Buggy source:
/** 
 * Pumps through each waiting download, either removing it because it was stopped, or adding it because there's an active slot and it requires attention.
 */
protected synchronized void pumpDownloads(){
  int index=1;
  for (Iterator<CoreDownloader> i=waiting.iterator(); i.hasNext(); ) {
    CoreDownloader md=i.next();
    if (md.isAlive()) {
      continue;
    }
 else     if (md.shouldBeRemoved()) {
      i.remove();
      cleanupCompletedDownload(md,false);
    }
 else     if (storeDownloadCount == 0 && md.getDownloadType() == DownloaderType.STORE) {
      i.remove();
      storeDownloadCount++;
      active.add(md);
      md.startDownload();
    }
 else     if (hasFreeSlot() && (md.shouldBeRestarted()) && (md.getDownloadType() != DownloaderType.STORE)) {
      i.remove();
      if (md.getDownloadType() == DownloaderType.INNETWORK)       innetworkCount++;
      active.add(md);
      md.startDownload();
    }
 else {
      if (md.isQueuable())       md.setInactivePriority(index++);
      md.handleInactivity();
    }
  }
}

Fixed version (ground truth):
/** 
 * Pumps through each waiting download, either removing it because it was stopped, or adding it because there's an active slot and it requires attention.
 */
protected synchronized void pumpDownloads(){
  int index=1;
  for (Iterator<CoreDownloader> i=waiting.iterator(); i.hasNext(); ) {
    CoreDownloader md=i.next();
    if (md.isAlive()) {
      continue;
    }
 else     if (md.shouldBeRemoved()) {
      i.remove();
      cleanupCompletedDownload(md,false);
    }
 else     if (storeDownloadCount < 3 && md.getDownloadType() == DownloaderType.STORE) {
      i.remove();
      storeDownloadCount++;
      active.add(md);
      md.startDownload();
    }
 else     if (hasFreeSlot() && (md.shouldBeRestarted()) && (md.getDownloadType() != DownloaderType.STORE)) {
      i.remove();
      if (md.getDownloadType() == DownloaderType.INNETWORK)       innetworkCount++;
      active.add(md);
      md.startDownload();
    }
 else {
      if (md.isQueuable())       md.setInactivePriority(index++);
      md.handleInactivity();
    }
  }
}
Program: 3994
Project: 3994
Buggy source:
@Override public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  LocalFileItem item=(LocalFileItem)value;
  setIcon(thumbnailManager.getThumbnailForFile(item.getFile(),list,index));
  if (isSelected)   this.setBorder(selectedBorder);
 else   this.setBorder(border);
  return this;
}

Fixed version (ground truth):
@Override public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  LocalFileItem item=(LocalFileItem)value;
  setIcon(thumbnailManager.getThumbnailForFile(item.getFile(),list,index));
  if (thumbnailManager.isErrorIcon(item.getFile()))   setText(item.getFileName());
 else   setText("String_Node_Str");
  if (isSelected)   this.setBorder(selectedBorder);
 else   this.setBorder(border);
  return this;
}
Program: 3995
Project: 3995
Buggy source:
public ImageCellRenderer(int width,int height,ThumbnailManager thumbnailManager){
  super(width,height);
  this.thumbnailManager=thumbnailManager;
  super.topPadding=topPadding;
  GuiUtils.assignResources(this);
  setBackground(this.cellBackgroundColor);
  border=BorderFactory.createMatteBorder(1,1,1,1,cellBorderColor);
  selectedBorder=BorderFactory.createMatteBorder(2,2,2,2,cellBorderSelectionColor);
}

Fixed version (ground truth):
public ImageCellRenderer(int width,int height,ThumbnailManager thumbnailManager){
  super(width,height);
  this.thumbnailManager=thumbnailManager;
  GuiUtils.assignResources(this);
  setBackground(this.cellBackgroundColor);
  border=BorderFactory.createMatteBorder(1,1,1,1,cellBorderColor);
  selectedBorder=BorderFactory.createMatteBorder(2,2,2,2,cellBorderSelectionColor);
}
Program: 3996
Project: 3996
Buggy source:
/** 
 * Sets the subComponent on this. This gets painted below the image.
 */
public void setButtonComponent(JComponent buttonPanel){
  this.removeAll();
  this.buttonComponent=buttonPanel;
  calculateSubPanelDimensions();
  add(buttonPanel);
}

Fixed version (ground truth):
/** 
 * Sets the subComponent on this. This gets painted below the image.
 */
public void setButtonComponent(JComponent buttonPanel){
  this.removeAll();
  this.buttonComponent=buttonPanel;
  calculateSubPanelDimensions();
  add(buttonPanel);
  add(label);
}
Program: 3997
Project: 3997
Buggy source:
public ImageLabel(int width,int height){
  GuiUtils.assignResources(this);
  setOpaque(true);
  setPreferredSize(new Dimension(width,height));
  setSize(getPreferredSize());
  setLayout(null);
}

Fixed version (ground truth):
public ImageLabel(int width,int height){
  GuiUtils.assignResources(this);
  setOpaque(true);
  setPreferredSize(new Dimension(width,height));
  setSize(getPreferredSize());
  setLayout(null);
  label=new JLabel();
  label.setVisible(false);
  label.setOpaque(false);
  label.setForeground(Color.BLACK);
  label.setHorizontalAlignment(SwingConstants.CENTER);
  calculateLabelDimnensions();
  add(label);
}
Program: 3998
Project: 3998
Buggy source:
public LibraryImageCellRenderer(int width,int height,ThumbnailManager thumbnailManager){
  super(width,height,thumbnailManager);
}

Fixed version (ground truth):
public LibraryImageCellRenderer(int width,int height,ThumbnailManager thumbnailManager){
  super(width,height,thumbnailManager);
  GuiUtils.assignResources(this);
  border=BorderFactory.createMatteBorder(1,1,1,1,cellBorderColor);
  selectedBorder=BorderFactory.createMatteBorder(2,2,2,2,cellBorderSelectionColor);
}
Program: 3999
Project: 3999
Buggy source:
public ShareTableRendererEditor(Action shareAction){
  GuiUtils.assignResources(this);
  gnutellaLabel=new JLabel(shareGnutellaIcon);
  friendsLabel=new JLabel(shareFriendsIcon);
  shareButton=new IconButton(shareButtonIcon,shareButtonIcon,shareButtonPressedIcon);
  shareButton.addActionListener(shareAction);
  friendsLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
  friendsLabel.setIconTextGap(4);
  setLayout(new MigLayout("String_Node_Str"));
  add(gnutellaLabel);
  add(friendsLabel,"String_Node_Str");
  add(shareButton);
}

Fixed version (ground truth):
public ShareTableRendererEditor(Action shareAction){
  GuiUtils.assignResources(this);
  setOpaque(false);
  gnutellaLabel=new JLabel(shareGnutellaIcon);
  friendsLabel=new JLabel(shareFriendsIcon);
  shareButton=new IconButton(shareButtonIcon,shareButtonIcon,shareButtonPressedIcon);
  shareButton.addActionListener(shareAction);
  friendsLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
  friendsLabel.setIconTextGap(4);
  setLayout(new MigLayout("String_Node_Str"));
  add(gnutellaLabel);
  add(friendsLabel,"String_Node_Str");
  add(shareButton);
}
Program: 4000
Project: 4000
Buggy source:
public void removeAllActions(){
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.clear();
}

Fixed version (ground truth):
public void removeAllActions(){
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.clear();
  this.selectedAction=null;
  this.selectedComponent=null;
}
Program: 4001
Project: 4001
Buggy source:
public void removeAction(Action action){
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.remove(action);
}

Fixed version (ground truth):
public void removeAction(Action action){
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.remove(action);
  if (action == this.selectedAction) {
    this.selectedAction=null;
    this.selectedComponent=null;
  }
}
Program: 4002
Project: 4002
Buggy source:
private void updateSize(){
  if (this.getText() == null && this.actions.isEmpty())   return;
  if (this.getGraphics() == null)   return;
  this.hasSize=true;
  Rectangle2D labelRect=null;
  if (this.getText() != null && !this.getText().isEmpty()) {
    labelRect=this.getLongestTextArea(this.getText());
  }
 else {
    labelRect=this.getLongestTextArea(this.actions.toArray());
  }
  int ix1=0;
  int ix2=0;
  int iy1=0;
  int iy2=0;
  if (this.getBorder() != null) {
    Insets insets=this.getBorder().getBorderInsets(this);
    ix1=insets.left;
    ix2=insets.right;
    iy1=insets.top;
    iy2=insets.bottom;
  }
  this.setPreferredSize(new Dimension((int)labelRect.getWidth() + ix1 + ix2,(int)labelRect.getHeight() + iy1 + iy2));
  this.setSize(this.getPreferredSize());
  this.invalidate();
}

Fixed version (ground truth):
private void updateSize(){
  if (this.getText() == null && this.actions.isEmpty())   return;
  if (this.getGraphics() == null)   return;
  this.hasSize=true;
  Rectangle2D labelRect=null;
  if (this.getText() != null && !this.getText().isEmpty()) {
    labelRect=this.getLongestTextArea(this.getText());
  }
 else {
    labelRect=this.getLongestTextArea(this.actions.toArray());
  }
  int ix1=0;
  int ix2=0;
  int iy1=0;
  int iy2=0;
  if (this.getBorder() != null) {
    Insets insets=this.getBorder().getBorderInsets(this);
    ix1=insets.left;
    ix2=insets.right;
    iy1=insets.top;
    iy2=insets.bottom;
  }
  this.setPreferredSize(new Dimension((int)labelRect.getWidth() + ix1 + ix2,(int)labelRect.getHeight() + iy1 + iy2));
  this.setSize(this.getPreferredSize());
  this.repaint();
}
Program: 4003
Project: 4003
Buggy source:
private String unpackText(Object object){
  if (object instanceof Action)   return ((Action)object).getValue("String_Node_Str").toString();
 else   return object.toString();
}

Fixed version (ground truth):
private String unpackText(Object object){
  if (object == null)   return null;
  if (object instanceof Action)   return ((Action)object).getValue("String_Node_Str").toString();
 else   return object.toString();
}
Program: 4004
Project: 4004
Buggy source:
public void addAction(Action action){
  if (action == null)   throw new IllegalArgumentException("String_Node_Str");
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.add(action);
}

Fixed version (ground truth):
public void addAction(Action action){
  if (action == null)   throw new IllegalArgumentException("String_Node_Str");
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.add(action);
  if (this.selectedAction == null)   this.selectedAction=actions.get(0);
  this.updateSize();
}
Program: 4005
Project: 4005
Buggy source:
LimeComboBox(List<Action> actions){
  final Color ITEM_BACK=(Color)UIManager.get("String_Node_Str");
  this.setText(null);
  this.actions=new LinkedList<Action>();
  this.addActions(actions);
  if (!this.actions.isEmpty())   this.selectedAction=actions.get(0);
 else   this.selectedAction=null;
  this.setModel(this.getModel());
  this.menu=new JPopupMenu();
  this.initMenu();
  this.addMouseListener(new MouseAdapter(){
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseExited(    MouseEvent e){
    }
    @Override public void mousePressed(    MouseEvent e){
      if (menu.isEnabled()) {
        menu.setVisible(false);
        menu.setEnabled(false);
        return;
      }
      updateMenu();
      if (getText() == null)       menu.setPreferredSize(new Dimension(getWidth(),(int)menu.getPreferredSize().getHeight()));
      menu.show((Component)e.getSource(),0,getHeight() - 1);
      menu.setEnabled(true);
    }
  }
);
}

Fixed version (ground truth):
LimeComboBox(List<Action> actions){
  final Color ITEM_BACK=(Color)UIManager.get("String_Node_Str");
  this.setText(null);
  this.actions=new LinkedList<Action>();
  this.addActions(actions);
  if (!this.actions.isEmpty())   this.selectedAction=actions.get(0);
 else   this.selectedAction=null;
  this.setModel(this.getModel());
  this.menu=new JPopupMenu();
  this.initMenu();
  this.addMouseListener(new MouseAdapter(){
    private boolean hide=false;
    @Override public void mouseEntered(    MouseEvent e){
      if (menu.isVisible())       this.hide=true;
    }
    @Override public void mouseExited(    MouseEvent e){
      this.hide=false;
    }
    @Override public void mousePressed(    MouseEvent e){
      if (this.hide) {
        this.hide=false;
        return;
      }
      updateMenu();
      if (getText() == null)       menu.setPreferredSize(new Dimension(getWidth(),(int)menu.getPreferredSize().getHeight()));
      menu.show((Component)e.getSource(),0,getHeight() - 1);
      this.hide=true;
    }
  }
);
}
Program: 4006
Project: 4006
Buggy source:
public void addActions(List<Action> actions){
  if (actions == null)   return;
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.addAll(actions);
  this.updateSize();
}

Fixed version (ground truth):
public void addActions(List<Action> actions){
  if (actions == null)   return;
  this.isMenuUpdated=false;
  this.hasSize=false;
  this.actions.addAll(actions);
  if (this.selectedAction == null)   this.selectedAction=actions.get(0);
  this.updateSize();
}
Program: 4007
Project: 4007
Buggy source:
public void setSelectedAction(Action action){
  this.selectedAction=action;
  this.isMenuUpdated=false;
}

Fixed version (ground truth):
public void setSelectedAction(Action action){
  if (!this.actions.contains(action))   return;
  this.selectedAction=action;
  this.isMenuUpdated=false;
}
Program: 4008
Project: 4008
Buggy source:
private void initMenu(){
  this.menu.setBorder(BorderFactory.createLineBorder(Color.BLACK,1));
  this.menu.setBackground(Color.WHITE);
  this.menu.setForeground(Color.BLACK);
  this.menu.setEnabled(false);
  this.menu.addMouseListener(new MouseListener(){
    @Override public void mouseClicked(    MouseEvent e){
    }
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseExited(    MouseEvent e){
    }
    @Override public void mousePressed(    MouseEvent e){
    }
    @Override public void mouseReleased(    MouseEvent e){
    }
  }
);
}

Fixed version (ground truth):
private void initMenu(){
  this.menu.setBorder(BorderFactory.createLineBorder(Color.BLACK,1));
  this.menu.setBackground(Color.WHITE);
  this.menu.setForeground(Color.BLACK);
  this.menu.setVisible(false);
  this.menu.addMouseListener(new MouseListener(){
    @Override public void mouseClicked(    MouseEvent e){
    }
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseExited(    MouseEvent e){
    }
    @Override public void mousePressed(    MouseEvent e){
    }
    @Override public void mouseReleased(    MouseEvent e){
    }
  }
);
}
Program: 4010
Project: 4010
Buggy source:
public boolean isCategorized(){
  return categorizeCheckBox.isSelected();
}

Fixed version (ground truth):
public boolean isCategorized(){
  return categoriseCheckBox.isSelected();
}
Program: 4011
Project: 4011
Buggy source:
/** 
 * @param category
 * @param friend the friend whose library is being viewed.  Null for MyLibrary.
 */
public LibraryHeaderPanel(Category category,Friend friend){
  super(new MigLayout());
  GuiUtils.assignResources(this);
  this.category=category;
  this.friend=friend;
  titleLabel=new HeadingLabel(getTitle());
  titleLabel.setForeground(fontColor);
  titleLabel.setFont(headerFont);
  filterField=new PromptTextField();
  filterField.setPromptText(I18n.tr("String_Node_Str"));
  if (isShareButtonShown()) {
    shareAllButton=new JXButton(I18n.tr("String_Node_Str"),shareIcon);
    shareAllButton.setForeground(fontColor);
    shareAllButton.setHorizontalTextPosition(SwingConstants.LEFT);
    shareAllButton.setBackgroundPainter(new ButtonPainter());
    shareAllButton.setFont(buttonFont);
    shareAllButton.setOpaque(false);
    shareAllButton.setFocusPainted(false);
    shareAllButton.setContentAreaFilled(false);
  }
  add(titleLabel);
  add(filterField,"String_Node_Str");
  if (isShareButtonShown()) {
    add(shareAllButton);
  }
  setBackgroundPainter(new SubpanelPainter());
}

Fixed version (ground truth):
/** 
 * @param category
 * @param friend the friend whose library is being viewed.  Null for MyLibrary.
 */
public LibraryHeaderPanel(Category category,Friend friend){
  super(new MigLayout());
  GuiUtils.assignResources(this);
  this.category=category;
  this.friend=friend;
  titleLabel=new HeadingLabel(getTitle());
  titleLabel.setForeground(fontColor);
  titleLabel.setFont(headerFont);
  filterField=new PromptTextField();
  filterField.setPromptText(I18n.tr("String_Node_Str"));
  if (isShareButtonShown()) {
    shareAllButton=new JXButton(I18n.tr("String_Node_Str"),shareIcon);
    shareAllButton.setForeground(fontColor);
    shareAllButton.setHorizontalTextPosition(SwingConstants.LEFT);
    shareAllButton.setBackgroundPainter(new ButtonPainter());
    shareAllButton.setBorderPainted(false);
    shareAllButton.setFont(buttonFont);
    shareAllButton.setOpaque(false);
    shareAllButton.setFocusPainted(false);
    shareAllButton.setContentAreaFilled(false);
  }
  add(titleLabel);
  add(filterField,"String_Node_Str");
  if (isShareButtonShown()) {
    add(shareAllButton);
  }
  setBackgroundPainter(new SubpanelPainter());
}
Program: 4012
Project: 4012
Buggy source:
private void createComponents(){
  titleLabel=new HeadingLabel(staticText);
  titleLabel.setForeground(fontColor);
  FontUtils.setSize(titleLabel,fontSize);
  FontUtils.changeStyle(titleLabel,Font.PLAIN);
  filterBox=new PromptTextField();
  libraryButton=new LibraryButton(new GoToLibraryAction(navigator,null));
  libraryButton.setPreferredSize(new Dimension(buttonWidth,buttonHeight));
  libraryButton.setForeground(fontColor);
  libraryButton.setBackgroundPainter(new ButtonPainter());
  shareButton=new JXButton(I18n.tr("String_Node_Str"),downIcon);
  shareButton.setVisible(false);
  shareButton.setForeground(fontColor);
  shareButton.setHorizontalTextPosition(SwingConstants.LEFT);
  shareButton.setBackgroundPainter(new ButtonPainter());
  shareButton.addActionListener(new PopupActionListener());
}

Fixed version (ground truth):
private void createComponents(){
  titleLabel=new HeadingLabel(staticText);
  titleLabel.setForeground(fontColor);
  FontUtils.setSize(titleLabel,fontSize);
  FontUtils.changeStyle(titleLabel,Font.PLAIN);
  filterBox=new PromptTextField();
  libraryButton=new LibraryButton(new GoToLibraryAction(navigator,null));
  libraryButton.setPreferredSize(new Dimension(buttonWidth,buttonHeight));
  libraryButton.setForeground(fontColor);
  libraryButton.setBackgroundPainter(new ButtonPainter());
  libraryButton.setBorderPainted(false);
  shareButton=new JXButton(I18n.tr("String_Node_Str"),downIcon);
  shareButton.setVisible(false);
  shareButton.setForeground(fontColor);
  shareButton.setHorizontalTextPosition(SwingConstants.LEFT);
  shareButton.setBackgroundPainter(new ButtonPainter());
  shareButton.addActionListener(new PopupActionListener());
}
Program: 4013
Project: 4013
Buggy source:
@Override public void componentResized(ComponentEvent e){
  if (table.getPreferredSize().height < scrollPane.getViewport().getSize().height) {
    layer.setPreferredSize(scrollPane.getViewport().getSize());
  }
 else {
    layer.setPreferredSize(table.getPreferredSize());
  }
}

Fixed version (ground truth):
@Override public void componentResized(ComponentEvent e){
  adjustSize();
}
Program: 4015
Project: 4015
Buggy source:
public void dispose(){
  table.dispose();
  ((EventTableModel)table.getModel()).dispose();
  if (sharePanel != null) {
    sharePanel.dispose();
  }
}

Fixed version (ground truth):
public void dispose(){
  table.dispose();
  eventList.removeListEventListener(listListener);
  ((EventTableModel)table.getModel()).dispose();
  if (sharePanel != null) {
    sharePanel.dispose();
  }
}
Program: 4016
Project: 4016
Buggy source:
/** 
 * Forwards necessary events to the AutoCompleteList. 
 */
@Override public void keyPressed(KeyEvent evt){
  if (evt.getKeyCode() == KeyEvent.VK_UP || evt.getKeyCode() == KeyEvent.VK_DOWN)   evt.consume();
  if (dict != null) {
switch (evt.getKeyCode()) {
case KeyEvent.VK_UP:
      if (popup != null)       entryList.decrementSelection();
 else       showPopup(dict.iterator());
    break;
case KeyEvent.VK_DOWN:
  if (popup != null)   entryList.incrementSelection();
 else   showPopup(dict.iterator());
break;
}
}
}

Fixed version (ground truth):
/** 
 * Forwards necessary events to the AutoCompleteList. 
 */
@Override public void keyPressed(KeyEvent evt){
  if (evt.getKeyCode() == KeyEvent.VK_UP || evt.getKeyCode() == KeyEvent.VK_DOWN) {
    evt.consume();
  }
  if (dict != null) {
switch (evt.getKeyCode()) {
case KeyEvent.VK_UP:
      if (popup != null)       entryList.decrementSelection();
 else       showPopup(dict.iterator());
    break;
case KeyEvent.VK_DOWN:
  if (popup != null)   entryList.incrementSelection();
 else   showPopup(dict.iterator());
break;
}
}
}
Program: 4017
Project: 4017
Buggy source:
/** 
 * Displays the popup window with a list of auto-completable choices, if any exist.
 */
public void autoCompleteInput(){
  String input=textField.getText();
  if (input != null && input.length() > 0) {
    Iterator<String> it=dict.iterator(input);
    if (it.hasNext())     showPopup(it);
 else     hidePopup();
  }
 else {
    hidePopup();
  }
}

Fixed version (ground truth):
/** 
 * Displays the popup window with a list of auto-completable choices, if any exist.
 */
public void autoCompleteInput(){
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      String input=textField.getText();
      if (input != null && input.length() > 0) {
        Iterator<String> it=dict.iterator(input);
        if (it.hasNext())         showPopup(it);
 else         hidePopup();
      }
 else {
        hidePopup();
      }
    }
  }
);
}
Program: 4018
Project: 4018
Buggy source:
public void listChanged(ListEvent<RemoteFileItem> listChanges){
  while (listChanges.next()) {
    if (listChanges.getType() == ListEvent.INSERT) {
      RemoteFileItem newFile=listChanges.getSourceList().get(listChanges.getIndex());
      LOG.debugf("String_Node_Str",newFile.getName());
      addToIndex(newFile,newFile.getName());
      StringTokenizer st=new StringTokenizer(newFile.getName());
      while (st.hasMoreElements()) {
        String word=st.nextToken();
        addToIndex(newFile,word);
      }
    }
  }
}

Fixed version (ground truth):
public void listChanged(ListEvent<RemoteFileItem> listChanges){
  while (listChanges.next()) {
    if (listChanges.getType() == ListEvent.INSERT) {
      RemoteFileItem newFile=listChanges.getSourceList().get(listChanges.getIndex());
      LOG.debugf("String_Node_Str",newFile.getName(),presenceId);
      addToIndex(newFile,newFile.getName());
      StringTokenizer st=new StringTokenizer(newFile.getName());
      if (st.countTokens() > 1) {
        while (st.hasMoreElements()) {
          String word=st.nextToken();
          addToIndex(newFile,word);
        }
      }
    }
  }
}
Program: 4019
Project: 4019
Buggy source:
LibraryListener(LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>> library){
  this.library=library;
}

Fixed version (ground truth):
LibraryListener(String presenceId,LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>> library){
  this.presenceId=presenceId;
  this.library=library;
}
Program: 4020
Project: 4020
Buggy source:
@Inject void register(RemoteLibraryManager remoteLibraryManager){
  remoteLibraryManager.getFriendLibraryList().addListEventListener(new ListEventListener<FriendLibrary>(){
    @Override public void listChanged(    ListEvent<FriendLibrary> listChanges){
      while (listChanges.next()) {
        int type=listChanges.getType();
        if (type == ListEvent.INSERT) {
          FriendLibrary friendLibrary=listChanges.getSourceList().get(listChanges.getIndex());
          new AbstractListEventListener<PresenceLibrary>(){
            @Override protected void itemAdded(            PresenceLibrary item){
              LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>> trie=new LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>>(true);
              if (libraries.putIfAbsent(item.getPresence().getPresenceId(),trie) == null) {
                LOG.debugf("String_Node_Str",item.getPresence().getPresenceId());
                item.getModel().addListEventListener(new LibraryListener(trie));
              }
            }
            @Override protected void itemRemoved(            PresenceLibrary item){
              LOG.debugf("String_Node_Str",item.getPresence());
              libraries.remove(item.getPresence().getPresenceId());
            }
            @Override protected void itemUpdated(            PresenceLibrary item){
            }
          }
.install(friendLibrary.getPresenceLibraryList());
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Inject void register(RemoteLibraryManager remoteLibraryManager){
  remoteLibraryManager.getFriendLibraryList().addListEventListener(new ListEventListener<FriendLibrary>(){
    @Override public void listChanged(    ListEvent<FriendLibrary> listChanges){
      while (listChanges.next()) {
        int type=listChanges.getType();
        if (type == ListEvent.INSERT) {
          FriendLibrary friendLibrary=listChanges.getSourceList().get(listChanges.getIndex());
          new AbstractListEventListener<PresenceLibrary>(){
            @Override protected void itemAdded(            PresenceLibrary item){
              LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>> trie=new LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>>(true);
              if (libraries.putIfAbsent(item.getPresence().getPresenceId(),trie) == null) {
                LOG.debugf("String_Node_Str",item.getPresence().getPresenceId());
                item.getModel().addListEventListener(new LibraryListener(item.getPresence().getPresenceId(),trie));
              }
            }
            @Override protected void itemRemoved(            PresenceLibrary item){
              LOG.debugf("String_Node_Str",item.getPresence());
              libraries.remove(item.getPresence().getPresenceId());
            }
            @Override protected void itemUpdated(            PresenceLibrary item){
            }
          }
.install(friendLibrary.getPresenceLibraryList());
        }
      }
    }
  }
);
}
Program: 4021
Project: 4021
Buggy source:
@Override protected void itemAdded(PresenceLibrary item){
  LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>> trie=new LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>>(true);
  if (libraries.putIfAbsent(item.getPresence().getPresenceId(),trie) == null) {
    LOG.debugf("String_Node_Str",item.getPresence().getPresenceId());
    item.getModel().addListEventListener(new LibraryListener(trie));
  }
}

Fixed version (ground truth):
@Override protected void itemAdded(PresenceLibrary item){
  LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>> trie=new LockableStringTrie<ConcurrentLinkedQueue<RemoteFileItem>>(true);
  if (libraries.putIfAbsent(item.getPresence().getPresenceId(),trie) == null) {
    LOG.debugf("String_Node_Str",item.getPresence().getPresenceId());
    item.getModel().addListEventListener(new LibraryListener(item.getPresence().getPresenceId(),trie));
  }
}
Program: 4022
Project: 4022
Buggy source:
/** 
 * Resolves a   {@link FirewalledAddress} to the {@link Connectable} of its {@link FirewalledAddress#getPrivateAddress() private address} if this peerand the peer the address belongs to are behind the same firewall. Otherwise resolves the address to a  {@link ResolvedFirewalledAddress} tomark it as resolved.
 */
@Override public void resolve(Address addr,int timeout,AddressResolutionObserver observer){
  FirewalledAddress address=(FirewalledAddress)addr;
  waitForLocalAddress();
  byte[] publicAddress=networkManager.getExternalAddress();
  if (!Arrays.equals(publicAddress,address.getPublicAddress().getInetAddress().getAddress())) {
    LOG.debugf("String_Node_Str",address.getPublicAddress());
    observer.resolved(new ResolvedFirewalledAddress(address.getPublicAddress(),address.getPrivateAddress(),address.getClientGuid(),address.getPushProxies(),address.getFwtVersion()));
    return;
  }
  byte[] privateAddress=networkManager.getAddress();
  if (NetworkUtils.areInSameSiteLocalNetwork(privateAddress,address.getPrivateAddress().getInetAddress().getAddress())) {
    LOG.debug("String_Node_Str");
    observer.resolved(address.getPrivateAddress());
  }
 else {
    LOG.debugf("String_Node_Str",address.getPrivateAddress());
    observer.resolved(new ResolvedFirewalledAddress(address.getPublicAddress(),address.getPrivateAddress(),address.getClientGuid(),address.getPushProxies(),address.getFwtVersion()));
  }
}

Fixed version (ground truth):
/** 
 * Resolves a   {@link FirewalledAddress} to the {@link Connectable} of its {@link FirewalledAddress#getPrivateAddress() private address} if this peerand the peer the address belongs to are behind the same firewall. Otherwise resolves the address to a  {@link ResolvedFirewalledAddress} tomark it as resolved.
 */
@Override public void resolve(Address addr,int timeout,AddressResolutionObserver observer){
  FirewalledAddress address=(FirewalledAddress)addr;
  waitForLocalAddress();
  byte[] publicAddress=networkManager.getExternalAddress();
  if (!Arrays.equals(publicAddress,address.getPublicAddress().getInetAddress().getAddress())) {
    LOG.debugf("String_Node_Str",toString(publicAddress),address.getPublicAddress());
    observer.resolved(new ResolvedFirewalledAddress(address.getPublicAddress(),address.getPrivateAddress(),address.getClientGuid(),address.getPushProxies(),address.getFwtVersion()));
    return;
  }
  byte[] privateAddress=networkManager.getNonForcedAddress();
  if (NetworkUtils.areInSameSiteLocalNetwork(privateAddress,address.getPrivateAddress().getInetAddress().getAddress())) {
    LOG.debug("String_Node_Str");
    observer.resolved(address.getPrivateAddress());
  }
 else {
    LOG.debugf("String_Node_Str",toString(privateAddress),address.getPrivateAddress());
    observer.resolved(new ResolvedFirewalledAddress(address.getPublicAddress(),address.getPrivateAddress(),address.getClientGuid(),address.getPushProxies(),address.getFwtVersion()));
  }
}
Program: 4023
Project: 4023
Buggy source:
public byte[] getNonForcedAddress(){
  return null;
}

Fixed version (ground truth):
public byte[] getNonForcedAddress(){
  return getAddress();
}
Program: 4024
Project: 4024
Buggy source:
@Override public void mouseExited(MouseEvent e){
  if (!menu.isVisible()) {
    headerPanel.setBorder(noBorder);
  }
}

Fixed version (ground truth):
@Override public void mouseExited(MouseEvent e){
  hideTimer.start();
}
Program: 4025
Project: 4025
Buggy source:
private void updateMenus(){
  if (people.length == 0)   return;
  if (people.length == 1) {
    String person=people[0];
    menu.add(getChatAction(person));
    menu.add(getLibraryAction(person));
    menu.add(getSharingAction(person));
  }
 else {
    for (    String person : people) {
      JMenu submenu=new JMenu(person);
      submenu.add(getChatAction(person));
      submenu.add(getLibraryAction(person));
      menu.add(submenu);
    }
  }
}

Fixed version (ground truth):
private void updateMenus(){
  if (people.length == 0)   return;
  if (people.length == 1) {
    String person=people[0];
    menu.add(getChatAction(person));
    menu.add(getLibraryAction(person));
    menu.add(getSharingAction(person));
  }
 else {
    for (    String person : people) {
      JMenu submenu=new JMenu(person);
      submenu.addMouseListener(menuHider);
      JMenuItem chatItem=new JMenuItem(getChatAction(person));
      chatItem.addMouseListener(menuHider);
      submenu.add(chatItem);
      JMenuItem libraryItem=new JMenuItem(getLibraryAction(person));
      libraryItem.addMouseListener(menuHider);
      submenu.add(libraryItem);
      menu.add(submenu);
    }
  }
}
Program: 4026
Project: 4026
Buggy source:
public FromWidget(){
  menu=new JPopupMenu();
  menu.setBorder(border);
  configureHeader();
  layoutComponents();
  setOpaque(false);
}

Fixed version (ground truth):
public FromWidget(){
  menu=new JPopupMenu();
  menuHider=new MenuHider();
  menu.setBorder(border);
  configureHeader();
  layoutComponents();
  setOpaque(false);
}
Program: 4027
Project: 4027
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  fromActions.showFilesSharedBy(person);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (menu.isVisible()) {
    menu.setVisible(false);
  }
  ((Timer)e.getSource()).stop();
}
Program: 4028
Project: 4028
Buggy source:
@Override public void mouseEntered(MouseEvent e){
  headerPanel.setBorder(border);
}

Fixed version (ground truth):
@Override public void mouseEntered(MouseEvent e){
  hideTimer.stop();
}
Program: 4029
Project: 4029
Buggy source:
private void configureHeader(){
  headerPanel.add(headerLabel);
  headerPanel.setBorder(noBorder);
  headerPanel.setOpaque(false);
  menu.addMouseListener(new MouseAdapter(){
    @Override public void mouseExited(    MouseEvent e){
      if (menu.isVisible()) {
        menu.setVisible(false);
      }
    }
  }
);
  headerLabel.addMouseListener(new MouseAdapter(){
    @Override public void mouseEntered(    MouseEvent e){
      headerPanel.setBorder(border);
    }
    @Override public void mouseExited(    MouseEvent e){
      if (!menu.isVisible()) {
        headerPanel.setBorder(noBorder);
      }
    }
    @Override public void mousePressed(    MouseEvent e){
      if (people.length > 0) {
        menu.show((Component)e.getSource(),-R,-R);
      }
    }
  }
);
}

Fixed version (ground truth):
private void configureHeader(){
  headerPanel.add(headerLabel);
  headerPanel.setBorder(noBorder);
  headerPanel.setOpaque(false);
  menu.addMouseListener(menuHider);
  headerLabel.addMouseListener(new MouseAdapter(){
    @Override public void mouseEntered(    MouseEvent e){
      headerPanel.setBorder(border);
    }
    @Override public void mouseExited(    MouseEvent e){
      if (!menu.isVisible()) {
        headerPanel.setBorder(noBorder);
      }
    }
    @Override public void mousePressed(    MouseEvent e){
      if (people.length > 0) {
        menu.show((Component)e.getSource(),-R,-R);
      }
    }
  }
);
}
Program: 4030
Project: 4030
Buggy source:
public MultiLineLabel(String text,int lineWidth){
  super(text);
  setMaxLineSpan(lineWidth);
  setLineWrap(true);
  Object viewObj=getClientProperty(BasicHTML.propertyKey);
  if (viewObj instanceof View) {
    View view=(View)viewObj;
    int width=(int)view.getPreferredSpan(View.X_AXIS);
    int height=(int)view.getPreferredSpan(View.Y_AXIS);
    setPreferredSize(new Dimension(width,height));
  }
}

Fixed version (ground truth):
public MultiLineLabel(String text,int lineWidth){
  super(text);
  setMaxLineSpan(lineWidth);
  setLineWrap(true);
}
Program: 4031
Project: 4031
Buggy source:
public void resetAvailability(){
  if (hasChangedAvailability) {
    new SelfAvailabilityUpdateEvent(Mode.available).publish();
    hasChangedAvailability=false;
  }
}

Fixed version (ground truth):
public void resetAvailability(){
  Mode mode=currentMode.get();
  if (mode == null || !mode.equals(Mode.available)) {
    new SelfAvailabilityUpdateEvent(Mode.available).publish();
  }
}
Program: 4032
Project: 4032
Buggy source:
public IdleTimer(int delay,SelfAvailabilityAction listener){
  super(delay,listener);
  this.availabilityAction=listener;
}

Fixed version (ground truth):
public IdleTimer(int delay,AutomatedAvailabilityAction listener){
  super(delay,listener);
  this.availabilityAction=listener;
}
Program: 4034
Project: 4034
Buggy source:
@Override protected void configure(){
  bind(SocketsManager.class).to(SocketsManagerImpl.class);
  bind(ProxyManager.class).to(ProxyManagerImpl.class);
  bind(WhoIsRequestFactory.class).to(WhoIsRequestFactoryImpl.class);
  bind(FirewallService.class).to(FirewallServiceImpl.class);
  bind(AddressFactory.class).to(AddressFactoryImpl.class);
  bind(ConnectableSerializer.class);
  bind(ConnectableConnector.class);
  if (OSUtils.isSocketChallengedWindows())   bind(SocketController.class).to(LimitedSocketController.class);
 else   bind(SocketController.class).to(SimpleSocketController.class);
  if (proxySettings != null)   bind(ProxySettings.class).to(proxySettings);
  if (socketBindingSettings != null)   bind(SocketBindingSettings.class).to(socketBindingSettings);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(SocketsManager.class).to(SocketsManagerImpl.class);
  bind(ProxyManager.class).to(ProxyManagerImpl.class);
  bind(WhoIsRequestFactory.class).to(WhoIsRequestFactoryImpl.class);
  bind(FirewallService.class).to(FirewallServiceImpl.class);
  bind(AddressFactory.class).to(AddressFactoryImpl.class);
  bind(ConnectableSerializer.class);
  if (OSUtils.isSocketChallengedWindows())   bind(SocketController.class).to(LimitedSocketController.class);
 else   bind(SocketController.class).to(SimpleSocketController.class);
  if (proxySettings != null)   bind(ProxySettings.class).to(proxySettings);
  if (socketBindingSettings != null)   bind(SocketBindingSettings.class).to(socketBindingSettings);
}
Program: 4035
Project: 4035
Buggy source:
private static void appendIsTypingMessage(StringBuilder builder,String senderName,ChatState chatState,boolean friendSignedOff){
  String stateMessage=null;
  if (friendSignedOff) {
    stateMessage=I18n.tr("String_Node_Str",senderName);
  }
 else   if (chatState == ChatState.composing) {
    stateMessage=I18n.tr("String_Node_Str",senderName);
  }
 else   if (chatState == ChatState.paused) {
    stateMessage=I18n.tr("String_Node_Str",senderName);
  }
 else {
    return;
  }
  String cssClass="String_Node_Str";
  builder.append("String_Node_Str").append(cssClass).append("String_Node_Str").append(stateMessage).append("String_Node_Str").append("String_Node_Str");
}

Fixed version (ground truth):
private static void appendIsTypingMessage(StringBuilder builder,String senderName,ChatState chatState,boolean friendSignedOff){
  String stateMessage=null;
  if (friendSignedOff) {
    stateMessage=tr("String_Node_Str",senderName);
  }
 else   if (chatState == ChatState.composing) {
    stateMessage=tr("String_Node_Str",senderName);
  }
 else   if (chatState == ChatState.paused) {
    stateMessage=tr("String_Node_Str",senderName);
  }
 else {
    return;
  }
  String cssClass="String_Node_Str";
  builder.append("String_Node_Str").append(cssClass).append("String_Node_Str").append(stateMessage).append("String_Node_Str").append("String_Node_Str");
}
Program: 4036
Project: 4036
Buggy source:
@Override public void handleEvent(RosterEvent event){
  if (event.getType().equals(User.EventType.USER_ADDED)) {
    LocalFileList fileList=libraryManager.getOrCreateFriendShareList(event.getSource());
    eventList.add(new FriendItemImpl(event.getSource(),fileList.getModel()));
  }
 else   if (event.getType().equals(User.EventType.USER_REMOVED)) {
    libraryManager.removeFriendShareList(event.getSource());
  }
 else   if (event.getType().equals(User.EventType.USER_UPDATED)) {
  }
}

Fixed version (ground truth):
@Override public void handleEvent(RosterEvent event){
  if (event.getType().equals(User.EventType.USER_ADDED)) {
    LocalFileList fileList=libraryManager.getOrCreateFriendShareList(event.getSource());
    friendsList.add(new FriendItemImpl(event.getSource(),fileList.getModel()));
  }
 else   if (event.getType().equals(User.EventType.USER_REMOVED)) {
    libraryManager.removeFriendShareList(event.getSource());
  }
 else   if (event.getType().equals(User.EventType.USER_UPDATED)) {
  }
}
Program: 4037
Project: 4037
Buggy source:
@Inject public FriendSharePanel(LibraryManager libraryManager,SharingFriendEmptyPanel emptyPanel,Navigator navigator,IconManager iconManager,ThumbnailManager thumbnailManager){
  GuiUtils.assignResources(this);
  EventAnnotationProcessor.subscribe(this);
  this.libraryManager=libraryManager;
  this.iconManager=iconManager;
  this.thumbnailManager=thumbnailManager;
  viewCardLayout=new CardLayout();
  JPanel cardPanel=new JPanel();
  cardPanel.setLayout(viewCardLayout);
  cardPanel.add(emptyPanel,ViewSelectionPanel.DISABLED);
  eventList=new BasicEventList<FriendItem>();
  friendTable=new FriendNameTable(eventList,new FriendTableFormat(),libraryManager,navigator);
  headerPanel=createHeader(cardPanel);
  createCenterCards(headerPanel,cardPanel);
  viewCardLayout.show(cardPanel,ViewSelectionPanel.DISABLED);
  FriendSelectionListener friendSelectionListener=new FriendSelectionListener(friendTable,headerPanel,emptyPanel,cardPanel);
  friendTable.getSelectionModel().addListSelectionListener(friendSelectionListener);
  setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  add(headerPanel,"String_Node_Str");
  add(new JScrollPane(friendTable),"String_Node_Str");
  add(cardPanel,"String_Node_Str");
}

Fixed version (ground truth):
@Inject public FriendSharePanel(LibraryManager libraryManager,SharingFriendEmptyPanel emptyPanel,Navigator navigator,IconManager iconManager,ThumbnailManager thumbnailManager){
  GuiUtils.assignResources(this);
  EventAnnotationProcessor.subscribe(this);
  this.libraryManager=libraryManager;
  this.iconManager=iconManager;
  this.thumbnailManager=thumbnailManager;
  viewCardLayout=new CardLayout();
  JPanel cardPanel=new JPanel();
  cardPanel.setLayout(viewCardLayout);
  cardPanel.add(emptyPanel,ViewSelectionPanel.DISABLED);
  friendsList=GlazedLists.threadSafeList(new BasicEventList<FriendItem>());
  friendTable=new FriendNameTable(friendsList,new FriendTableFormat(),libraryManager,navigator);
  headerPanel=createHeader(cardPanel);
  createCenterCards(headerPanel,cardPanel);
  viewCardLayout.show(cardPanel,ViewSelectionPanel.DISABLED);
  FriendSelectionListener friendSelectionListener=new FriendSelectionListener(friendTable,headerPanel,emptyPanel,cardPanel);
  friendTable.getSelectionModel().addListSelectionListener(friendSelectionListener);
  setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  add(headerPanel,"String_Node_Str");
  add(new JScrollPane(friendTable),"String_Node_Str");
  add(cardPanel,"String_Node_Str");
}
Program: 4038
Project: 4038
Buggy source:
@EventSubscriber public void handleSignoff(SignoffEvent event){
  eventList.clear();
}

Fixed version (ground truth):
@EventSubscriber public void handleSignoff(SignoffEvent event){
  friendsList.clear();
}
Program: 4039
Project: 4039
Buggy source:
public ConfigurableTable(boolean showHeaders){
  this.showHeaders=showHeaders;
  setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  if (showHeaders) {
    final JTableHeader header=getTableHeader();
    header.setToolTipText("String_Node_Str");
    header.addMouseListener(new MouseAdapter(){
      @Override public void mouseClicked(      MouseEvent e){
        if (e.getButton() == 1) {
          int col=columnAtPoint(e.getPoint());
          String headerName=tableFormat.getColumnName(col);
        }
 else         if (e.getButton() == 3) {
          if (headerPopup != null) {
            headerPopup.show(ConfigurableTable.this,e.getX(),e.getY() - header.getHeight());
          }
        }
      }
    }
);
  }
 else {
    setTableHeader(null);
  }
  TableColumnModel tcm=getColumnModel();
  for (int i=0; i < tcm.getColumnCount(); i++) {
    tcm.getColumn(i).setPreferredWidth(100);
  }
}

Fixed version (ground truth):
public ConfigurableTable(boolean showHeaders){
  this.showHeaders=showHeaders;
  setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  if (showHeaders) {
    final JTableHeader header=getTableHeader();
    header.setToolTipText("String_Node_Str");
    header.addMouseListener(new MouseAdapter(){
      @Override public void mouseClicked(      MouseEvent e){
        if (e.getButton() == 1) {
          int col=columnAtPoint(e.getPoint());
          String headerName=tableFormat.getColumnName(col);
        }
 else         if (e.getButton() == 3) {
          if (headerPopup != null) {
            headerPopup.show(ConfigurableTable.this,e.getX(),e.getY() - header.getHeight());
          }
        }
      }
    }
);
  }
 else {
    setTableHeader(null);
  }
}