nus-yam/ex-repair huggingface dataset:
Program: 3937
Project: 3937
Buggy source:
public MiniPlayerPanel(AudioPlayer player){
  super(new HorizontalLayout());
  GuiUtils.assignResources(this);
  this.player=player;
  setOpaque(false);
  playPauseButton=new JButton();
  playPauseButton.setMargin(new Insets(0,0,0,0));
  playPauseButton.setBorderPainted(false);
  playPauseButton.setContentAreaFilled(false);
  playPauseButton.setFocusPainted(false);
  playPauseButton.setRolloverEnabled(true);
  playPauseButton.setIcon(playIcon);
  playPauseButton.setRolloverIcon(playIconRollover);
  playPauseButton.setPressedIcon(playIconPressed);
  playPauseButton.setHideActionText(true);
  playPauseButton.addActionListener(new PlayListener());
  statusButton=new MarqueeButton("String_Node_Str",16);
  statusButton.setFont(font);
  statusButton.setForeground(foregroundColor);
  statusButton.addActionListener(new ShowPlayerListener());
  add(playPauseButton);
  add(statusButton);
  setMaximumSize(getPreferredSize());
  player.addAudioPlayerListener(new PlayerListener());
}

Fixed version (ground truth):
public MiniPlayerPanel(AudioPlayer player){
  GuiUtils.assignResources(this);
  this.player=player;
  setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  setOpaque(false);
  playPauseButton=new JXButton();
  playPauseButton.setMargin(new Insets(0,0,0,0));
  playPauseButton.setBorderPainted(false);
  playPauseButton.setContentAreaFilled(false);
  playPauseButton.setFocusPainted(false);
  playPauseButton.setRolloverEnabled(true);
  playPauseButton.setIcon(playIcon);
  Dimension playPauseDimensions=new Dimension(playIcon.getIconWidth(),playIcon.getIconHeight());
  playPauseButton.setMaximumSize(playPauseDimensions);
  playPauseButton.setPreferredSize(playPauseDimensions);
  playPauseButton.setRolloverIcon(playIconRollover);
  playPauseButton.setPressedIcon(playIconPressed);
  playPauseButton.setHideActionText(true);
  playPauseButton.addActionListener(new PlayListener());
  statusButton=new MarqueeButton("String_Node_Str",16);
  Dimension statusButtonDimensions=new Dimension(Integer.MAX_VALUE,playIcon.getIconHeight());
  statusButton.setMaximumSize(statusButtonDimensions);
  statusButton.setFont(font);
  statusButton.setForeground(foregroundColor);
  statusButton.addActionListener(new ShowPlayerListener());
  add(playPauseButton,"String_Node_Str");
  add(statusButton,"String_Node_Str");
  setMaximumSize(getPreferredSize());
  player.addAudioPlayerListener(new PlayerListener());
}
Program: 3938
Project: 3938
Buggy source:
@Override public void handleEvent(ConnectivityChangeEvent event){
  LOG.debug("String_Node_Str");
synchronized (librariesToBrowse) {
    for (Iterator<PresenceLibrary> i=librariesToBrowse.iterator(); i.hasNext(); ) {
      PresenceLibrary presenceLibrary=i.next();
      FriendPresence friendPresence=presenceLibrary.getPresence();
      AddressFeature addressFeature=(AddressFeature)friendPresence.getFeature(AddressFeature.ID);
      if (addressFeature != null) {
        Address address=addressFeature.getFeature();
        if (socketsManager.canConnect(address) || socketsManager.canResolve(address)) {
          i.remove();
          browse(presenceLibrary,friendPresence);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handleEvent(ConnectivityChangeEvent event){
  LOG.debug("String_Node_Str");
  remoteLibraryManager.getReadWriteLock().writeLock().lock();
  try {
synchronized (librariesToBrowse) {
      for (Iterator<PresenceLibrary> i=librariesToBrowse.iterator(); i.hasNext(); ) {
        PresenceLibrary presenceLibrary=i.next();
        FriendPresence friendPresence=presenceLibrary.getPresence();
        AddressFeature addressFeature=(AddressFeature)friendPresence.getFeature(AddressFeature.ID);
        if (addressFeature != null) {
          Address address=addressFeature.getFeature();
          if (socketsManager.canConnect(address) || socketsManager.canResolve(address)) {
            i.remove();
            browse(presenceLibrary,friendPresence);
          }
        }
      }
    }
  }
  finally {
    remoteLibraryManager.getReadWriteLock().writeLock().unlock();
  }
}
Program: 3939
Project: 3939
Buggy source:
@Inject public PresenceLibraryBrowser(BrowseFactory browseFactory,RemoteLibraryManager remoteLibraryManager,SocketsManager socketsManager,XMPPRemoteFileDescDeserializer remoteFileDescDeserializer){
  this.browseFactory=browseFactory;
  this.remoteLibraryManager=remoteLibraryManager;
  this.socketsManager=socketsManager;
  this.remoteFileDescDeserializer=remoteFileDescDeserializer;
  socketsManager.addListener(new ConnectivityChangeListener());
}

Fixed version (ground truth):
@Inject public PresenceLibraryBrowser(BrowseFactory browseFactory,RemoteLibraryManagerImpl remoteLibraryManager,SocketsManager socketsManager,XMPPRemoteFileDescDeserializer remoteFileDescDeserializer){
  this.browseFactory=browseFactory;
  this.remoteLibraryManager=remoteLibraryManager;
  this.socketsManager=socketsManager;
  this.remoteFileDescDeserializer=remoteFileDescDeserializer;
  socketsManager.addListener(new ConnectivityChangeListener());
}
Program: 3940
Project: 3940
Buggy source:
public void update(org.jivesoftware.smack.packet.Presence presence){
synchronized (this) {
    this.type=Type.valueOf(presence.getType().toString());
    this.status=presence.getStatus();
    this.priority=presence.getPriority();
    this.mode=presence.getMode() != null ? Mode.valueOf(presence.getMode().toString()) : Mode.available;
  }
}

Fixed version (ground truth):
public void update(org.jivesoftware.smack.packet.Presence presence){
  rwLock.writeLock().lock();
  try {
    this.type=Type.valueOf(presence.getType().toString());
    this.status=presence.getStatus();
    this.priority=presence.getPriority();
    this.mode=presence.getMode() != null ? Mode.valueOf(presence.getMode().toString()) : Mode.available;
  }
  finally {
    rwLock.writeLock().unlock();
  }
}
Program: 3941
Project: 3941
Buggy source:
@Override public String getStatus(){
synchronized (this) {
    return status;
  }
}

Fixed version (ground truth):
@Override public String getStatus(){
  rwLock.readLock().lock();
  try {
    return status;
  }
  finally {
    rwLock.readLock().unlock();
  }
}
Program: 3942
Project: 3942
Buggy source:
@Override public Type getType(){
synchronized (this) {
    return type;
  }
}

Fixed version (ground truth):
@Override public Type getType(){
  rwLock.readLock().lock();
  try {
    return type;
  }
  finally {
    rwLock.readLock().unlock();
  }
}
Program: 3943
Project: 3943
Buggy source:
@Override public int getPriority(){
synchronized (this) {
    return priority;
  }
}

Fixed version (ground truth):
@Override public int getPriority(){
  rwLock.readLock().lock();
  try {
    return priority;
  }
  finally {
    rwLock.readLock().unlock();
  }
}
Program: 3944
Project: 3944
Buggy source:
@Override public Mode getMode(){
synchronized (this) {
    return mode;
  }
}

Fixed version (ground truth):
@Override public Mode getMode(){
  rwLock.readLock().lock();
  try {
    return mode;
  }
  finally {
    rwLock.readLock().unlock();
  }
}
Program: 3945
Project: 3945
Buggy source:
/** 
 * Returns presence if presence is   {@link FriendPresence} and the resourceid matches the one in <code>address</code> and the address is available in the presence. Also ensures that auth-token and address feature are set.
 */
private FriendPresence getMatchingPresence(XMPPAddress xmppAddress,String resourceId,FriendPresence presence){
  String originalId=xmppAddress.getFullId();
  int slash=originalId.indexOf('/');
  if (slash == -1) {
    LOG.debugf("String_Node_Str",originalId);
    return null;
  }
  int toOffset=Math.min(originalId.length(),slash + 5);
  if (originalId.substring(0,toOffset).equals(resourceId.substring(0,toOffset))) {
    Address address=addressRegistry.get(xmppAddress);
    Feature authTokenFeature=presence.getFeature(AuthTokenFeature.ID);
    if (address != null && authTokenFeature != null) {
      return presence;
    }
    LOG.debugf("String_Node_Str",address,authTokenFeature);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns presence if presence is   {@link FriendPresence} and the resourceid matches the one in <code>address</code> and the address is available in the presence. Also ensures that auth-token and address feature are set.
 */
private FriendPresence getMatchingPresence(XMPPAddress xmppAddress,String resourceId,FriendPresence presence){
  String originalId=xmppAddress.getFullId();
  int slash=originalId.indexOf('/');
  if (slash == -1) {
    LOG.debugf("String_Node_Str",originalId);
    return null;
  }
  int toOffset=Math.min(originalId.length(),slash + 5);
  if (originalId.substring(0,toOffset).equals(resourceId.substring(0,toOffset))) {
    Address address=addressRegistry.get(new XMPPAddress(resourceId));
    Feature authTokenFeature=presence.getFeature(AuthTokenFeature.ID);
    if (address != null && authTokenFeature != null) {
      return presence;
    }
    LOG.debugf("String_Node_Str",address,authTokenFeature);
  }
  return null;
}
Program: 3946
Project: 3946
Buggy source:
private void handleAddressUpdate(AddressIQ iq){
synchronized (this) {
    User user=connection.getUser(StringUtils.parseBareAddress(iq.getFrom()));
    if (user != null) {
      FriendPresence presence=user.getFriendPresences().get(iq.getFrom());
      if (presence != null) {
        LOG.debugf("String_Node_Str",presence.getPresenceId(),iq.getAddress());
        presence.addFeature(new AddressFeature(iq.getAddress()));
      }
 else {
        LOG.debugf("String_Node_Str",iq.getAddress(),iq.getFrom());
        pendingAddresses.put(iq.getFrom(),address);
      }
    }
  }
}

Fixed version (ground truth):
private void handleAddressUpdate(AddressIQ iq){
synchronized (this) {
    User user=connection.getUser(StringUtils.parseBareAddress(iq.getFrom()));
    if (user != null) {
      FriendPresence presence=user.getFriendPresences().get(iq.getFrom());
      if (presence != null) {
        LOG.debugf("String_Node_Str",presence.getPresenceId(),iq.getAddress());
        presence.addFeature(new AddressFeature(iq.getAddress()));
      }
 else {
        LOG.debugf("String_Node_Str",iq.getAddress(),iq.getFrom());
        pendingAddresses.put(iq.getFrom(),iq.getAddress());
      }
    }
  }
}
Program: 3947
Project: 3947
Buggy source:
@Override public void initializeFeature(FriendPresence friendPresence){
synchronized (AddressIQListener.this) {
    if (address != null) {
      sendAddress(address,friendPresence.getPresenceId());
    }
    if (pendingAddresses.containsKey(friendPresence.getPresenceId())) {
      LOG.debugf("String_Node_Str",friendPresence.getPresenceId(),address);
      friendPresence.addFeature(new AddressFeature(pendingAddresses.remove(friendPresence.getPresenceId())));
    }
  }
}

Fixed version (ground truth):
@Override public void initializeFeature(FriendPresence friendPresence){
synchronized (AddressIQListener.this) {
    if (address != null) {
      sendAddress(address,friendPresence.getPresenceId());
    }
    if (pendingAddresses.containsKey(friendPresence.getPresenceId())) {
      Address pendingAddress=pendingAddresses.remove(friendPresence.getPresenceId());
      LOG.debugf("String_Node_Str",friendPresence.getPresenceId(),pendingAddress);
      friendPresence.addFeature(new AddressFeature(pendingAddress));
    }
  }
}
Program: 3948
Project: 3948
Buggy source:
/** 
 * Attempts to log in a connection using the specified configuration. Any existing connections will be logged out first.
 */
public void login(XMPPConnectionConfiguration configuration);

Fixed version (ground truth):
/** 
 * Attempts to log in a connection using the specified configuration. Any existing connections will be logged out first.
 */
public XMPPConnection login(XMPPConnectionConfiguration configuration) throws XMPPException ;
Program: 3950
Project: 3950
Buggy source:
@Override public void reconnectionSuccessful(){
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.CONNECTED));
}

Fixed version (ground truth):
@Override public void reconnectionSuccessful(){
}
Program: 3951
Project: 3951
Buggy source:
public void login() throws XMPPException {
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(this,XMPPConnectionEvent.Type.CONNECTING));
  loggingIn.set(true);
synchronized (this) {
    try {
      org.jivesoftware.smack.XMPPConnection.DEBUG_ENABLED=configuration.isDebugEnabled();
      connection=new org.jivesoftware.smack.XMPPConnection(getConnectionConfig(configuration));
      connection.addRosterListener(new RosterListenerImpl(connection));
      if (LOG.isInfoEnabled())       LOG.info("String_Node_Str" + configuration.getServiceName() + "String_Node_Str"+ configuration.getHost()+ "String_Node_Str"+ configuration.getPort()+ "String_Node_Str");
      connection.connect();
      LOG.info("String_Node_Str");
      if (LOG.isInfoEnabled())       LOG.infof("String_Node_Str" + configuration.getUsername() + "String_Node_Str"+ configuration.getResource());
      connection.login(configuration.getUsername(),configuration.getPassword(),configuration.getResource());
      LOG.info("String_Node_Str");
      connectionBroadcaster.broadcast(new XMPPConnectionEvent(this,XMPPConnectionEvent.Type.CONNECTED));
    }
 catch (    org.jivesoftware.smack.XMPPException e) {
      throw new XMPPException(e);
    }
 finally {
      loggingIn.set(false);
    }
  }
}

Fixed version (ground truth):
public void login() throws XMPPException {
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(this,XMPPConnectionEvent.Type.CONNECTING));
  loggingIn.set(true);
synchronized (this) {
    try {
      org.jivesoftware.smack.XMPPConnection.addConnectionCreationListener(smackConnectionListener);
      org.jivesoftware.smack.XMPPConnection.DEBUG_ENABLED=configuration.isDebugEnabled();
      connection=new org.jivesoftware.smack.XMPPConnection(getConnectionConfig(configuration));
      connection.addRosterListener(new RosterListenerImpl(connection));
      if (LOG.isInfoEnabled())       LOG.info("String_Node_Str" + configuration.getServiceName() + "String_Node_Str"+ configuration.getHost()+ "String_Node_Str"+ configuration.getPort()+ "String_Node_Str");
      connection.connect();
      LOG.info("String_Node_Str");
      if (LOG.isInfoEnabled())       LOG.infof("String_Node_Str" + configuration.getUsername() + "String_Node_Str"+ configuration.getResource());
      connection.login(configuration.getUsername(),configuration.getPassword(),configuration.getResource());
      LOG.info("String_Node_Str");
      connectionBroadcaster.broadcast(new XMPPConnectionEvent(this,XMPPConnectionEvent.Type.CONNECTED));
    }
 catch (    org.jivesoftware.smack.XMPPException e) {
      connectionBroadcaster.broadcast(new XMPPConnectionEvent(this,XMPPConnectionEvent.Type.CONNECT_FAILED,e));
      if (connection != null && connection.isConnected()) {
        connection.disconnect();
      }
      org.jivesoftware.smack.XMPPConnection.removeConnectionCreationListener(smackConnectionListener);
      throw new XMPPException(e);
    }
 finally {
      loggingIn.set(false);
    }
  }
}
Program: 3952
Project: 3952
Buggy source:
public void logout(){
synchronized (this) {
    if (connection != null) {
      if (LOG.isInfoEnabled())       LOG.info("String_Node_Str" + configuration.getServiceName() + "String_Node_Str"+ configuration.getHost()+ "String_Node_Str"+ configuration.getPort()+ "String_Node_Str");
      try {
        connection.disconnect();
      }
 catch (      NullPointerException npe) {
      }
      addressIQListener.dispose();
      authTokenIQListener.dispose();
      addressIQListener=null;
      fileTransferIQListener=null;
      authTokenIQListener=null;
synchronized (users) {
        users.clear();
      }
      LOG.info("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void logout(){
synchronized (this) {
    if (connection != null && connection.isAuthenticated()) {
      LOG.infof("String_Node_Str",configuration.getServiceName(),configuration.getHost(),configuration.getPort());
      connection.disconnect();
synchronized (users) {
        users.clear();
      }
      XMPPConnection.removeConnectionCreationListener(smackConnectionListener);
      connection=null;
      LOG.info("String_Node_Str");
    }
  }
}
Program: 3953
Project: 3953
Buggy source:
@Override public void reconnectionFailed(Exception e){
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.RECONNECTING_FAILED,e));
}

Fixed version (ground truth):
@Override public void reconnectionFailed(Exception e){
}
Program: 3954
Project: 3954
Buggy source:
@Override public void reconnectingIn(int seconds){
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.RECONNECTING));
}

Fixed version (ground truth):
@Override public void reconnectingIn(int seconds){
}
Program: 3955
Project: 3955
Buggy source:
XMPPConnectionImpl(XMPPConnectionConfiguration configuration,EventBroadcaster<RosterEvent> rosterBroadcaster,EventBroadcaster<FileOfferEvent> fileOfferBroadcaster,EventBroadcaster<LibraryChangedEvent> libraryChangedEventEventBroadcaster,EventBroadcaster<XMPPConnectionEvent> connectionBroadcaster,AddressFactory addressFactory,XMPPAuthenticator authenticator,EventMulticaster<FeatureEvent> featureSupport){
  this.configuration=configuration;
  this.fileOfferBroadcaster=fileOfferBroadcaster;
  this.libraryChangedEventEventBroadcaster=libraryChangedEventEventBroadcaster;
  this.connectionBroadcaster=connectionBroadcaster;
  this.addressFactory=addressFactory;
  this.authenticator=authenticator;
  this.rosterListeners=new EventListenerList<RosterEvent>();
  if (configuration.getRosterListener() != null) {
    this.rosterListeners.addListener(configuration.getRosterListener());
  }
  this.rosterListeners.addListener(new EventRebroadcaster<RosterEvent>(rosterBroadcaster));
  this.users=new TreeMap<String,UserImpl>(String.CASE_INSENSITIVE_ORDER);
  this.featureSupport=featureSupport;
}

Fixed version (ground truth):
XMPPConnectionImpl(XMPPConnectionConfiguration configuration,EventBroadcaster<RosterEvent> rosterBroadcaster,EventBroadcaster<FileOfferEvent> fileOfferBroadcaster,EventBroadcaster<LibraryChangedEvent> libraryChangedEventEventBroadcaster,EventBroadcaster<XMPPConnectionEvent> connectionBroadcaster,AddressFactory addressFactory,XMPPAuthenticator authenticator,EventMulticaster<FeatureEvent> featureSupport){
  this.configuration=configuration;
  this.fileOfferBroadcaster=fileOfferBroadcaster;
  this.libraryChangedEventEventBroadcaster=libraryChangedEventEventBroadcaster;
  this.connectionBroadcaster=connectionBroadcaster;
  this.addressFactory=addressFactory;
  this.authenticator=authenticator;
  this.rosterListeners=new EventListenerList<RosterEvent>();
  if (configuration.getRosterListener() != null) {
    this.rosterListeners.addListener(configuration.getRosterListener());
  }
  this.rosterListeners.addListener(new EventRebroadcaster<RosterEvent>(rosterBroadcaster));
  this.users=new TreeMap<String,UserImpl>(String.CASE_INSENSITIVE_ORDER);
  this.featureSupport=featureSupport;
  smackConnectionListener=new SmackConnectionListener();
}
Program: 3956
Project: 3956
Buggy source:
@Override public void connectionClosedOnError(Exception e){
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.DISCONNECTED,e));
}

Fixed version (ground truth):
@Override public void connectionClosedOnError(Exception e){
  cleanup();
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.DISCONNECTED,e));
}
Program: 3958
Project: 3958
Buggy source:
@Override public void connectionClosed(){
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.DISCONNECTED));
}

Fixed version (ground truth):
@Override public void connectionClosed(){
  cleanup();
  connectionBroadcaster.broadcast(new XMPPConnectionEvent(XMPPConnectionImpl.this,XMPPConnectionEvent.Type.DISCONNECTED));
}
Program: 3959
Project: 3959
Buggy source:
@Override @BlockingEvent public void handleEvent(XMPPConnectionEvent event){
  if (event.getType() == XMPPConnectionEvent.Type.DISCONNECTED && event.getData() != null) {
synchronized (XMPPServiceImpl.this) {
      XMPPConnection connection=event.getSource();
      XMPPConnectionConfiguration configuration=connection.getConfiguration();
      connections.remove(connection);
      connection=null;
      long sleepTime=10000;
      while (connection == null) {
        try {
          LOG.debugf("String_Node_Str" + configuration.getServiceName());
          connection=login(configuration);
        }
 catch (        XMPPException e) {
        }
        try {
          Thread.sleep(sleepTime);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override @BlockingEvent public void handleEvent(XMPPConnectionEvent event){
  if (event.getType() == XMPPConnectionEvent.Type.DISCONNECTED && event.getData() != null) {
    XMPPConnection connection=event.getSource();
    XMPPConnectionConfiguration configuration=connection.getConfiguration();
synchronized (XMPPServiceImpl.this) {
      connections.remove(connection);
    }
    connection=null;
    long sleepTime=10000;
    while (connection == null) {
      try {
        LOG.debugf("String_Node_Str" + configuration.getServiceName());
        connection=login(configuration,true);
      }
 catch (      XMPPException e) {
      }
      try {
        Thread.sleep(sleepTime);
      }
 catch (      InterruptedException e) {
      }
    }
  }
}
Program: 3960
Project: 3960
Buggy source:
@Override public XMPPConnection login(XMPPConnectionConfiguration configuration) throws XMPPException {
synchronized (this) {
    if (!multipleConnectionsAllowed) {
      XMPPConnection activeConnection=getActiveConnection();
      if (activeConnection != null && activeConnection.getConfiguration().equals(configuration)) {
        return activeConnection;
      }
 else {
        logout();
      }
    }
    XMPPConnectionImpl connection=new XMPPConnectionImpl(configuration,rosterBroadcaster.get(),fileOfferBroadcaster.get(),libraryChangedBroadcaster.get(),connectionBroadcaster.get(),addressFactory,authenticator,featureSupport);
    if (lastAddressEvent != null) {
      connection.handleEvent(lastAddressEvent);
    }
    try {
      connection.login();
      connections.add(connection);
      return connection;
    }
 catch (    XMPPException e) {
      LOG.debug(e.getMessage(),e);
      throw new XMPPException(e);
    }
  }
}

Fixed version (ground truth):
public XMPPConnection login(XMPPConnectionConfiguration configuration,boolean isReconnect) throws XMPPException {
synchronized (this) {
    if (!multipleConnectionsAllowed) {
      XMPPConnection activeConnection=getActiveConnection();
      if (isReconnect) {
        if (activeConnection != null) {
          return activeConnection;
        }
      }
 else {
        if (activeConnection != null && activeConnection.getConfiguration().equals(configuration)) {
          return activeConnection;
        }
 else {
          logout();
        }
      }
    }
    XMPPConnectionImpl connection=new XMPPConnectionImpl(configuration,rosterBroadcaster.get(),fileOfferBroadcaster.get(),libraryChangedBroadcaster.get(),connectionBroadcaster.get(),addressFactory,authenticator,featureSupport);
    if (lastAddressEvent != null) {
      connection.handleEvent(lastAddressEvent);
    }
    try {
      connection.login();
      connections.add(connection);
      return connection;
    }
 catch (    XMPPException e) {
      LOG.debug(e.getMessage(),e);
      throw new XMPPException(e);
    }
  }
}
Program: 3961
Project: 3961
Buggy source:
@Override public void setEnabled(boolean b){
  if (this.isEnabled() != b) {
    this.foregroundPainter.clearCache();
  }
  super.setEnabled(b);
}

Fixed version (ground truth):
@Override public void setEnabled(boolean b){
  if (this.isEnabled() != b) {
    this.foregroundPainter.clearCache();
    this.backgroundPainter.clearCache();
  }
  super.setEnabled(b);
}
Program: 3962
Project: 3962
Buggy source:
public LimeProgressBar(AbstractPainter<JProgressBar> foregroundPainter,Painter<JComponent> backgroundPainter){
  this.foregroundPainter=foregroundPainter;
  this.backgroundPainter=backgroundPainter;
  this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
}

Fixed version (ground truth):
public LimeProgressBar(AbstractPainter<JProgressBar> foregroundPainter,AbstractPainter<JComponent> backgroundPainter){
  this.foregroundPainter=foregroundPainter;
  this.backgroundPainter=backgroundPainter;
  this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
}
Program: 3963
Project: 3963
Buggy source:
@Override public void setValue(int v){
  if (this.getValue() != v) {
    this.foregroundPainter.clearCache();
  }
  super.setValue(v);
}

Fixed version (ground truth):
@Override public void setValue(int v){
  if (this.getValue() != v) {
    this.foregroundPainter.clearCache();
    this.backgroundPainter.clearCache();
  }
  super.setValue(v);
}
Program: 3964
Project: 3964
Buggy source:
public void setBackgroundPainter(Painter<JComponent> painter){
  this.backgroundPainter=painter;
}

Fixed version (ground truth):
public void setBackgroundPainter(AbstractPainter<JComponent> painter){
  this.backgroundPainter=painter;
}
Program: 3965
Project: 3965
Buggy source:
private void createMinView(){
  GridBagConstraints gbc=new GridBagConstraints();
  Insets insets=new Insets(0,10,0,0);
  gbc.insets=insets;
  gbc.fill=GridBagConstraints.NONE;
  gbc.anchor=GridBagConstraints.CENTER;
  gbc.weightx=0;
  gbc.weighty=0;
  gbc.gridheight=5;
  minPanel.add(minIconLabel,gbc);
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.anchor=GridBagConstraints.NORTHWEST;
  gbc.gridx=1;
  gbc.weightx=1;
  gbc.weighty=0;
  gbc.gridwidth=GridBagConstraints.REMAINDER;
  gbc.gridheight=1;
  minPanel.add(minTitleLabel,gbc);
  gbc.insets=new Insets(5,4,0,0);
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.anchor=GridBagConstraints.CENTER;
  gbc.gridx=4;
  gbc.gridy=0;
  gbc.weightx=1;
  gbc.weighty=0;
  gbc.gridwidth=1;
  gbc.gridheight=5;
  minPanel.add(minButtonPanel,gbc);
  gbc.insets=insets;
  gbc.fill=GridBagConstraints.NONE;
  gbc.anchor=GridBagConstraints.WEST;
  gbc.gridx=1;
  gbc.gridy=1;
  gbc.weightx=0;
  gbc.weighty=0;
  gbc.gridwidth=1;
  gbc.gridheight=0;
  minPanel.add(minStatusLabel,gbc);
  gbc.insets=new Insets(0,0,0,0);
  gbc.gridx++;
  minPanel.add(minLinkButton,gbc);
  gbc.fill=GridBagConstraints.NONE;
  gbc.anchor=GridBagConstraints.WEST;
  gbc.gridx=1;
  gbc.gridy=2;
  gbc.weightx=0;
  gbc.weighty=0;
  gbc.gridwidth=3;
  gbc.gridheight=0;
  minPanel.add(Box.createHorizontalStrut(progressBarWidth - 16),gbc);
}

Fixed version (ground truth):
private void createMinView(){
  GridBagConstraints gbc=new GridBagConstraints();
  Insets insets=new Insets(0,10,0,0);
  gbc.insets=insets;
  gbc.fill=GridBagConstraints.NONE;
  gbc.anchor=GridBagConstraints.CENTER;
  gbc.weightx=0;
  gbc.weighty=0;
  gbc.gridheight=5;
  minPanel.add(minIconLabel,gbc);
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.anchor=GridBagConstraints.NORTHWEST;
  gbc.gridx=1;
  gbc.weightx=1;
  gbc.weighty=0;
  gbc.gridwidth=GridBagConstraints.REMAINDER;
  gbc.gridheight=1;
  minPanel.add(minTitleLabel,gbc);
  gbc.insets=new Insets(6,4,0,0);
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.anchor=GridBagConstraints.CENTER;
  gbc.gridx=4;
  gbc.gridy=0;
  gbc.weightx=1;
  gbc.weighty=0;
  gbc.gridwidth=1;
  gbc.gridheight=5;
  minPanel.add(minButtonPanel,gbc);
  gbc.insets=insets;
  gbc.fill=GridBagConstraints.NONE;
  gbc.anchor=GridBagConstraints.WEST;
  gbc.gridx=1;
  gbc.gridy=1;
  gbc.weightx=0;
  gbc.weighty=0;
  gbc.gridwidth=1;
  gbc.gridheight=0;
  minPanel.add(minStatusLabel,gbc);
  gbc.insets=new Insets(0,0,0,0);
  gbc.gridx++;
  minPanel.add(minLinkButton,gbc);
  gbc.fill=GridBagConstraints.NONE;
  gbc.anchor=GridBagConstraints.WEST;
  gbc.gridx=1;
  gbc.gridy=2;
  gbc.weightx=0;
  gbc.weighty=0;
  gbc.gridwidth=3;
  gbc.gridheight=0;
  minPanel.add(Box.createHorizontalStrut(progressBarWidth - 16),gbc);
}
Program: 3966
Project: 3966
Buggy source:
public ProgressBarBackgroundPainter(Paint background,Paint border,Paint borderDisabled){
  this.background=background;
  this.border=border;
  this.borderDisabled=borderDisabled;
  this.setAntialiasing(false);
  this.setCacheable(true);
}

Fixed version (ground truth):
public ProgressBarBackgroundPainter(Paint background,Paint border,Paint borderDisabled){
  this.background=background;
  this.border=border;
  this.borderDisabled=borderDisabled;
  this.setAntialiasing(false);
  this.setCacheable(false);
}
Program: 3967
Project: 3967
Buggy source:
public Painter<JComponent> createBackgroundPainter(){
  return new ProgressBarBackgroundPainter(new GradientPaint(0,0,this.barBackgroundGradientTop,0,1,this.barBackgroundGradientBottom),this.border,this.borderDisabled);
}

Fixed version (ground truth):
public AbstractPainter<JComponent> createBackgroundPainter(){
  return new ProgressBarBackgroundPainter(new GradientPaint(0,0,this.barBackgroundGradientTop,0,1,this.barBackgroundGradientBottom),this.border,this.borderDisabled);
}
Program: 3968
Project: 3968
Buggy source:
@Override public synchronized XMPPConnection getLoggedInConnection(){
  try {
    return connections.pop();
  }
 catch (  NoSuchElementException nsex) {
    return null;
  }
}

Fixed version (ground truth):
@Override public synchronized XMPPConnection getLoggedInConnection(){
  return connections.peek();
}
Program: 3969
Project: 3969
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  injector=createInjector(getModules());
  registry=injector.getInstance(ServiceRegistry.class);
  registry.initialize();
  registry.start();
  service=injector.getInstance(XMPPServiceImpl.class);
  service.setMultipleConnectionsAllowed(true);
  aliceRosterListener=new RosterListenerMock();
  bobRosterListener=new RosterListenerMock();
  alice=new XMPPConnectionConfigurationMock(USERNAME_1,PASSWORD_1,HOST,PORT,SERVICE,aliceRosterListener);
  bob=new XMPPConnectionConfigurationMock(USERNAME_2,PASSWORD_2,HOST,PORT,SERVICE,bobRosterListener);
  service.login(alice);
  service.login(bob);
  Thread.sleep(SLEEP);
  assertEquals("String_Node_Str",1,aliceRosterListener.roster.get(USERNAME_2).size());
  assertEquals("String_Node_Str",1,bobRosterListener.roster.get(USERNAME_1).size());
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  injector=createInjector(getModules());
  registry=injector.getInstance(ServiceRegistry.class);
  registry.initialize();
  registry.start();
  service=injector.getInstance(XMPPServiceImpl.class);
  service.setMultipleConnectionsAllowed(true);
  service.setXmppErrorListener(new XMPPErrorListener(){
    public void register(    XMPPService xmppService){
      xmppService.setXmppErrorListener(this);
    }
    public void error(    XMPPException exception){
      exception.printStackTrace();
    }
  }
);
  aliceRosterListener=new RosterListenerMock();
  bobRosterListener=new RosterListenerMock();
  alice=new XMPPConnectionConfigurationMock(USERNAME_1,PASSWORD_1,HOST,PORT,SERVICE,aliceRosterListener);
  bob=new XMPPConnectionConfigurationMock(USERNAME_2,PASSWORD_2,HOST,PORT,SERVICE,bobRosterListener);
  service.login(alice);
  service.login(bob);
  Thread.sleep(SLEEP);
  assertEquals("String_Node_Str",1,aliceRosterListener.roster.get(USERNAME_2).size());
  assertEquals("String_Node_Str",1,bobRosterListener.roster.get(USERNAME_1).size());
}
Program: 3970
Project: 3970
Buggy source:
protected void configure(){
  binder().install(new LimeWireXMPPModule());
  bind(XmppPresenceLibraryAdder.class);
  bind(FriendShareListRefresher.FriendShareListEventImpl.class);
  bind(RemoteFileItemFactory.class).to(RemoteFileItemFactoryImpl.class);
  bind(CoreGlueXMPPService.class);
}

Fixed version (ground truth):
protected void configure(){
  binder().install(new LimeWireXMPPModule());
  bind(XmppPresenceLibraryAdder.class);
  bind(FriendShareListRefresher.FriendShareListEventImpl.class);
  bind(RemoteFileItemFactory.class).to(RemoteFileItemFactoryImpl.class);
  bind(CoreGlueXMPPService.class);
  bind(PasswordManager.class).to(PasswordManagerImpl.class);
  bind(XMPPResourceFactory.class).to(XMPPResourceFactoryImpl.class);
}
Program: 3971
Project: 3971
Buggy source:
@Inject public XMPPServiceImpl(Provider<EventBroadcaster<RosterEvent>> rosterBroadcaster,Provider<EventBroadcaster<FileOfferEvent>> fileOfferBroadcaster,Provider<EventBroadcaster<LibraryChangedEvent>> libraryChangedBroadcaster,Provider<EventBroadcaster<XMPPConnectionEvent>> connectionBroadcaster,AddressFactory addressFactory,XMPPAuthenticator authenticator,ListenerSupport<FriendPresenceEvent> presenceSupport,ApplicationServices applicationServices){
  this.rosterBroadcaster=rosterBroadcaster;
  this.fileOfferBroadcaster=fileOfferBroadcaster;
  this.libraryChangedBroadcaster=libraryChangedBroadcaster;
  this.connectionBroadcaster=connectionBroadcaster;
  this.addressFactory=addressFactory;
  this.authenticator=authenticator;
  this.presenceSupport=presenceSupport;
  byte[] hash=new SHA1().digest(applicationServices.getMyGUID());
  byte[] base64=Base64.encodeBase64(hash);
  resource=StringUtils.getUTF8String(base64);
  connections=new LinkedList<XMPPConnectionImpl>();
  multipleConnectionsAllowed=false;
}

Fixed version (ground truth):
@Inject public XMPPServiceImpl(Provider<EventBroadcaster<RosterEvent>> rosterBroadcaster,Provider<EventBroadcaster<FileOfferEvent>> fileOfferBroadcaster,Provider<EventBroadcaster<LibraryChangedEvent>> libraryChangedBroadcaster,Provider<EventBroadcaster<XMPPConnectionEvent>> connectionBroadcaster,AddressFactory addressFactory,XMPPAuthenticator authenticator,ListenerSupport<FriendPresenceEvent> presenceSupport){
  this.rosterBroadcaster=rosterBroadcaster;
  this.fileOfferBroadcaster=fileOfferBroadcaster;
  this.libraryChangedBroadcaster=libraryChangedBroadcaster;
  this.connectionBroadcaster=connectionBroadcaster;
  this.addressFactory=addressFactory;
  this.authenticator=authenticator;
  this.presenceSupport=presenceSupport;
  connections=new LinkedList<XMPPConnectionImpl>();
  multipleConnectionsAllowed=false;
}
Program: 3972
Project: 3972
Buggy source:
@Override public synchronized void login(XMPPConnectionConfiguration configuration){
  if (!multipleConnectionsAllowed)   logout();
  XMPPConnectionImpl connection=new XMPPConnectionImpl(configuration,rosterBroadcaster.get(),fileOfferBroadcaster.get(),libraryChangedBroadcaster.get(),connectionBroadcaster.get(),addressFactory,authenticator,presenceSupport,resource);
  connection.initialize();
  if (lastAddressEvent != null)   connection.handleEvent(lastAddressEvent);
  try {
    connection.login();
    connections.add(connection);
  }
 catch (  XMPPException e) {
    LOG.error(e.getMessage(),e);
    errorListener.error(e);
  }
}

Fixed version (ground truth):
@Override public synchronized void login(XMPPConnectionConfiguration configuration){
  if (!multipleConnectionsAllowed)   logout();
  XMPPConnectionImpl connection=new XMPPConnectionImpl(configuration,rosterBroadcaster.get(),fileOfferBroadcaster.get(),libraryChangedBroadcaster.get(),connectionBroadcaster.get(),addressFactory,authenticator,presenceSupport);
  connection.initialize();
  if (lastAddressEvent != null)   connection.handleEvent(lastAddressEvent);
  try {
    connection.login();
    connections.add(connection);
  }
 catch (  XMPPException e) {
    LOG.error(e.getMessage(),e);
    errorListener.error(e);
  }
}
Program: 3975
Project: 3975
Buggy source:
@Override protected void doPaint(Graphics2D g,X object,int width,int height){
  int singleArcHeight=this.arcHeight / 2;
  g.setClip(0,0,width - 2,7);
  g.setPaint(this.bevelTop2);
  g.drawRoundRect(1,2,width - 2,height - 5,this.arcWidth,this.arcHeight);
  g.setPaint(this.bevelTop1);
  g.drawRoundRect(1,1,width - 3,height - 4,this.arcWidth,this.arcHeight);
  g.setClip(0,singleArcHeight,width - 2,height);
  g.setPaint(this.bevelBottom);
  g.drawRoundRect(1,1,width - 4,height - 4,this.arcWidth,this.arcHeight);
  g.setClip(0,singleArcHeight - 1,width - 2,height);
  g.setPaint(PaintUtils.resizeGradient(this.bevelLeft,0,height - singleArcHeight + 1));
  g.drawLine(2,singleArcHeight - 1,2,height - singleArcHeight);
  g.setPaint(PaintUtils.resizeGradient(this.bevelRight,0,height - singleArcHeight + 1));
  g.drawLine(width - 3,singleArcHeight - 1,width - 3,height - singleArcHeight);
  if (this.hasBubble) {
    g.setPaint(BUBBLE_PAINT3);
    g.drawRoundRect(0,0,width - 1,height - 1,this.arcWidth,this.arcHeight);
    g.setPaint(BUBBLE_PAINT2);
    g.drawLine(0,singleArcHeight,0,height / 2);
    g.drawLine(width - 1,singleArcHeight,width - 1,height / 2);
    g.setPaint(BUBBLE_PAINT1);
    g.drawLine(0,height / 2,0,height - singleArcHeight);
    g.drawLine(width - 1,height / 2,width - 1,height - singleArcHeight);
  }
  g.setClip(0,0,width,height);
  g.setPaint(PaintUtils.resizeGradient(this.border,0,height));
  g.drawRoundRect(1,0,width - 3,height - 2,this.arcWidth,this.arcHeight);
}

Fixed version (ground truth):
@Override protected void doPaint(Graphics2D g,X object,int width,int height){
  int singleArcHeight=this.arcHeight / 2;
  g.setClip(0,0,width - 2,7);
  g.setPaint(this.bevelTop2);
  g.drawRoundRect(1,2,width - 2,height - 5,this.arcWidth,this.arcHeight);
  g.setPaint(this.bevelTop1);
  g.drawRoundRect(1,1,width - 3,height - 4,this.arcWidth,this.arcHeight);
  g.setClip(0,singleArcHeight,width - 2,height);
  g.setPaint(this.bevelBottom);
  g.drawRoundRect(1,1,width - 4,height - 4,this.arcWidth,this.arcHeight);
  g.setClip(0,singleArcHeight - 1,width - 2,height);
  g.setPaint(PaintUtils.resizeGradient(this.bevelLeft,0,height - singleArcHeight + 1));
  g.drawLine(2,singleArcHeight - 1,2,height - singleArcHeight);
  g.setPaint(PaintUtils.resizeGradient(this.bevelRight,0,height - singleArcHeight + 1));
  g.drawLine(width - 3,singleArcHeight - 1,width - 3,height - singleArcHeight);
  if (this.hasBubble) {
    g.setClip(0,singleArcHeight,width,height);
    g.setPaint(BUBBLE_PAINT3);
    g.drawRoundRect(0,0,width - 1,height - 1,this.arcWidth,this.arcHeight);
    g.setPaint(BUBBLE_PAINT2);
    g.drawLine(0,singleArcHeight,0,height / 2);
    g.drawLine(width - 1,singleArcHeight,width - 1,height / 2);
    g.setPaint(BUBBLE_PAINT1);
    g.drawLine(0,height / 2,0,height - singleArcHeight);
    g.drawLine(width - 1,height / 2,width - 1,height - singleArcHeight);
  }
  g.setClip(0,0,width,height);
  g.setPaint(PaintUtils.resizeGradient(this.border,0,height));
  g.drawRoundRect(1,0,width - 3,height - 2,this.arcWidth,this.arcHeight);
}
Program: 3978
Project: 3978
Buggy source:
private Action getAddFile(final LibraryManager libraryManager){
  return new AbstractAction(I18n.tr("String_Node_Str")){
    @Override public void actionPerformed(    ActionEvent e){
      List<File> files=FileChooser.getInput(FileMenu.this,I18n.tr("String_Node_Str"),I18n.tr("String_Node_Str"),FileChooser.getLastInputDirectory(),JFileChooser.FILES_ONLY,JFileChooser.APPROVE_OPTION,true,new FileFilter(){
        @Override public boolean accept(        File f){
          return f.isDirectory() || LibraryUtils.isFilePhysicallyManagable(f);
        }
        @Override public String getDescription(){
          return I18n.tr("String_Node_Str");
        }
      }
);
      if (files != null) {
        for (        File file : files) {
          libraryManager.getLibraryManagedList().addFile(file);
        }
      }
    }
  }
;
}

Fixed version (ground truth):
private Action getAddFile(final LibraryManager libraryManager){
  return new AbstractAction(I18n.tr("String_Node_Str")){
    @Override public void actionPerformed(    ActionEvent e){
      List<File> files=FileChooser.getInput(FileMenu.this,I18n.tr("String_Node_Str"),I18n.tr("String_Node_Str"),FileChooser.getLastInputDirectory(),JFileChooser.FILES_ONLY,JFileChooser.APPROVE_OPTION,true,new FileFilter(){
        @Override public boolean accept(        File f){
          return f.isDirectory() || libraryManager.getLibraryData().isFileManageable(f);
        }
        @Override public String getDescription(){
          return I18n.tr("String_Node_Str");
        }
      }
);
      if (files != null) {
        for (        File file : files) {
          libraryManager.getLibraryManagedList().addFile(file);
        }
      }
    }
  }
;
}
Program: 3979
Project: 3979
Buggy source:
@Override public void mouseExited(MouseEvent e){
  getTopLevelAncestor().setCursor(getCursor());
  this.hide=false;
}

Fixed version (ground truth):
@Override public void mouseExited(MouseEvent e){
  setCursor(Cursor.getDefaultCursor());
  this.hide=false;
}
Program: 3980
Project: 3980
Buggy source:
@Override public void mouseEntered(MouseEvent e){
  getTopLevelAncestor().setCursor(mouseOverCursor);
  if (menu == null)   return;
  if (menu.isVisible())   this.hide=true;
}

Fixed version (ground truth):
@Override public void mouseEntered(MouseEvent e){
  setCursor(mouseOverCursor);
  if (menu == null)   return;
  if (menu.isVisible())   this.hide=true;
}
Program: 3981
Project: 3981
Buggy source:
private void initModel(){
  this.setModel(this.getModel());
  this.addMouseListener(new MouseAdapter(){
    private boolean hide=false;
    @Override public void mouseEntered(    MouseEvent e){
      getTopLevelAncestor().setCursor(mouseOverCursor);
      if (menu == null)       return;
      if (menu.isVisible())       this.hide=true;
    }
    @Override public void mouseExited(    MouseEvent e){
      getTopLevelAncestor().setCursor(getCursor());
      this.hide=false;
    }
    @Override public void mousePressed(    MouseEvent e){
      if (menu == null)       return;
      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;
    }
  }
);
}

Fixed version (ground truth):
private void initModel(){
  this.setModel(this.getModel());
  this.addMouseListener(new MouseAdapter(){
    private boolean hide=false;
    @Override public void mouseEntered(    MouseEvent e){
      setCursor(mouseOverCursor);
      if (menu == null)       return;
      if (menu.isVisible())       this.hide=true;
    }
    @Override public void mouseExited(    MouseEvent e){
      setCursor(Cursor.getDefaultCursor());
      this.hide=false;
    }
    @Override public void mousePressed(    MouseEvent e){
      if (menu == null)       return;
      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: 3982
Project: 3982
Buggy source:
/** 
 * Sets the painter to be used when the tab is selected. 
 */
public void setSelectionPainter(Painter<?> selectedPainter){
  for (  FancyTab tab : tabs) {
    if (tab.isHighlighted()) {
      tab.setBackgroundPainter(selectedPainter);
    }
  }
  props.setSelectedPainter(selectedPainter);
}

Fixed version (ground truth):
/** 
 * Sets the painter to be used when the tab is selected. 
 */
public void setSelectionPainter(Painter<?> selectedPainter){
  for (  FancyTab tab : tabs) {
    if (tab.isSelected()) {
      tab.setBackgroundPainter(selectedPainter);
    }
  }
  props.setSelectedPainter(selectedPainter);
}
Program: 3983
Project: 3983
Buggy source:
@Override protected void startup(){
  GuiUtils.assignResources(this);
  initColors();
  String title=getContext().getResourceMap().getString("String_Node_Str");
  JFrame frame=new LimeJFrame(title);
  frame.setName("String_Node_Str");
  getMainView().setFrame(frame);
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  Injector localInjector=createInjector();
  LimeWireSwingUI ui=localInjector.getInstance(LimeWireSwingUI.class);
  ui.showTrayIcon();
  getMainFrame().setJMenuBar(ui.getMenuBar());
  addExitListener(new TrayExitListener(ui.getTrayNotifier()));
  addExitListener(new ShutdownListener(getMainFrame(),localInjector.getInstance(Application.class)));
  show(ui.getLayer());
  restoreView();
  ui.goHome();
  ui.focusOnSearch();
  getMainFrame().setSize(new Dimension(1024,768));
  started=true;
  ui.showSetupWizard();
  for (  ApplicationLifecycleListener listener : lifecycleListeners) {
    listener.startupComplete();
  }
}

Fixed version (ground truth):
@Override protected void startup(){
  GuiUtils.assignResources(this);
  initColors();
  String title=getContext().getResourceMap().getString("String_Node_Str");
  JFrame frame=new LimeJFrame(title);
  frame.setName("String_Node_Str");
  getMainView().setFrame(frame);
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  Injector localInjector=createInjector();
  LimeWireSwingUI ui=localInjector.getInstance(LimeWireSwingUI.class);
  ui.showTrayIcon();
  getMainFrame().setJMenuBar(ui.getMenuBar());
  addExitListener(new TrayExitListener(ui.getTrayNotifier()));
  addExitListener(new ShutdownListener(getMainFrame(),localInjector.getInstance(Application.class)));
  show(ui);
  restoreView();
  ui.goHome();
  ui.focusOnSearch();
  getMainFrame().setSize(new Dimension(1024,768));
  started=true;
  for (  ApplicationLifecycleListener listener : lifecycleListeners) {
    listener.startupComplete();
  }
}
Program: 3984
Project: 3984
Buggy source:
public SimpleFuture(T t){
  this.t=t;
}

Fixed version (ground truth):
public SimpleFuture(Throwable throwable){
  this.t=null;
  this.exception=throwable;
}
Program: 3985
Project: 3985
Buggy source:
/** 
 * Returns all of the files URNs, from youngest to oldest.
 */
public List<URN> getFiles(){
  return getFiles(Integer.MAX_VALUE);
}

Fixed version (ground truth):
/** 
 * Returns all of the files URNs, from youngest to oldest.
 */
public Collection<URN> getFiles(){
  return getFiles(Integer.MAX_VALUE);
}
Program: 3986
Project: 3986
Buggy source:
/** 
 * Responds to a what is new request.
 */
private Set<Response> queryWhatsNew(QueryRequest request){
  boolean includeXML=request.shouldIncludeXMLInResponse();
  List<URN> urnList=creationTimeCache.get().getFiles(request,3);
  if (urnList.size() == 0)   return Collections.emptySet();
  Set<Response> resps=new HashSet<Response>(urnList.size());
  for (int i=0; i < urnList.size(); i++) {
    URN currURN=urnList.get(i);
    FileDesc desc=fileManager.getGnutellaSharedFileList().getFileDesc(currURN);
    if ((desc == null) || (desc instanceof IncompleteFileDesc))     throw new RuntimeException("String_Node_Str");
    Response r=responseFactory.get().createResponse(desc);
    if (includeXML)     addXMLToResponse(r,desc);
    resps.add(r);
  }
  return resps;
}

Fixed version (ground truth):
/** 
 * Responds to a what is new request.
 */
private Set<Response> queryWhatsNew(QueryRequest request){
  boolean includeXML=request.shouldIncludeXMLInResponse();
  Collection<URN> urnList=creationTimeCache.get().getFiles(request,3);
  if (urnList.size() == 0)   return Collections.emptySet();
  Set<Response> resps=new HashSet<Response>(urnList.size());
  for (  URN urn : urnList) {
    FileDesc desc=fileManager.getGnutellaSharedFileList().getFileDesc(urn);
    if ((desc == null) || (desc instanceof IncompleteFileDesc))     throw new RuntimeException("String_Node_Str");
    Response r=responseFactory.get().createResponse(desc);
    if (includeXML)     addXMLToResponse(r,desc);
    resps.add(r);
  }
  return resps;
}