nus-yam/ex-repair huggingface dataset:
Program: 103939
Project: 103939
Buggy source:
/** 
 * Updates the global status by picking the most connected protocol provider status.
 */
private void updateGlobalStatus(){
  int status=0;
  Iterator<ProtocolProviderService> pProviders=mainFrame.getProtocolProviders();
  boolean isProtocolHidden;
  while (pProviders.hasNext()) {
    ProtocolProviderService protocolProvider=pProviders.next();
    isProtocolHidden=protocolProvider.getAccountID().getAccountProperty(ProtocolProviderFactory.IS_PROTOCOL_HIDDEN) != null;
    if (isProtocolHidden)     continue;
    OperationSetPresence presence=(OperationSetPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
    if (presence == null) {
      if (protocolProvider.isRegistered() && status < PresenceStatus.AVAILABLE_THRESHOLD) {
        status=PresenceStatus.AVAILABLE_THRESHOLD;
      }
    }
 else {
      if (protocolProvider.isRegistered() && status < presence.getPresenceStatus().getStatus()) {
        status=presence.getPresenceStatus().getStatus();
      }
    }
  }
  JMenuItem item=getItemFromStatus(status);
  SelectedObject selectedObject=new SelectedObject(item.getText(),item.getIcon(),item);
  STATUS_STRING_WIDTH=SwingUtilities.computeStringWidth(this.getFontMetrics(this.getFont()),item.getText());
  setSelected(selectedObject);
  this.revalidate();
  setSystrayIcon(status);
}

Fixed version (ground truth):
/** 
 * Updates the global status by picking the most connected protocol provider status.
 */
private void updateGlobalStatus(){
  int status=0;
  Iterator<ProtocolProviderService> pProviders=mainFrame.getProtocolProviders();
  while (pProviders.hasNext()) {
    ProtocolProviderService protocolProvider=pProviders.next();
    boolean isProtocolHidden=protocolProvider.getAccountID().getAccountProperty(ProtocolProviderFactory.IS_PROTOCOL_HIDDEN) != null;
    if (isProtocolHidden)     continue;
    if (!protocolProvider.isRegistered())     continue;
    OperationSetPresence presence=(OperationSetPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
    int presenceStatus=(presence == null) ? PresenceStatus.AVAILABLE_THRESHOLD : presence.getPresenceStatus().getStatus();
    if (status < presenceStatus)     status=presenceStatus;
  }
  JMenuItem item=getItemFromStatus(status);
  setSelected(new SelectedObject(item.getText(),item.getIcon(),item));
  computeTextWidth();
  this.revalidate();
  setSystrayIcon(status);
}
Program: 103940
Project: 103940
Buggy source:
/** 
 * Overwrites the <tt>paintComponent(Graphics g)</tt> method in order to provide a new look and the mouse moves over this component.
 */
public void paintComponent(Graphics g){
  super.paintComponent(g);
  if (STATUS_STRING_WIDTH != 0) {
    g=g.create();
    try {
      AntialiasingManager.activateAntialiasing(g);
      g.drawImage(arrowImage,STATUS_STRING_WIDTH + 2 * IMAGE_INDENT + 2,(this.getHeight() - arrowImage.getHeight(null)) / 2 + 3,null);
    }
  finally {
      g.dispose();
    }
  }
}

Fixed version (ground truth):
/** 
 * Overwrites the <tt>paintComponent(Graphics g)</tt> method in order to provide a new look and the mouse moves over this component.
 */
public void paintComponent(Graphics g){
  super.paintComponent(g);
  if (textWidth != 0) {
    g=g.create();
    try {
      AntialiasingManager.activateAntialiasing(g);
      g.drawImage(arrowImage,textWidth + 2 * IMAGE_INDENT + 2,(this.getHeight() - arrowImage.getHeight(null)) / 2 + 3,null);
    }
  finally {
      g.dispose();
    }
  }
}
Program: 103941
Project: 103941
Buggy source:
/** 
 * Returns the last contact status saved in the configuration.
 * @param protocolProvider the protocol provider to which the statuscorresponds
 * @return the last contact status saved in the configuration.
 */
public String getLastStatusString(ProtocolProviderService protocolProvider){
  ConfigurationService configService=GuiActivator.getConfigurationService();
  String lastStatus=null;
  String prefix="String_Node_Str";
  List<String> accounts=configService.getPropertyNamesByPrefix(prefix,true);
  for (  String accountRootPropName : accounts) {
    String accountUID=configService.getString(accountRootPropName);
    if (accountUID.equals(protocolProvider.getAccountID().getAccountUniqueID())) {
      lastStatus=configService.getString(accountRootPropName + "String_Node_Str");
      if (lastStatus != null)       break;
    }
  }
  return lastStatus;
}

Fixed version (ground truth):
/** 
 * Returns the last contact status saved in the configuration.
 * @param protocolProvider the protocol provider to which the statuscorresponds
 * @return the last contact status saved in the configuration.
 */
public String getLastStatusString(ProtocolProviderService protocolProvider){
  String lastStatus=null;
  ConfigurationService configService=GuiActivator.getConfigurationService();
  String prefix="String_Node_Str";
  List<String> accounts=configService.getPropertyNamesByPrefix(prefix,true);
  String protocolProviderAccountUID=protocolProvider.getAccountID().getAccountUniqueID();
  for (  String accountRootPropName : accounts) {
    String accountUID=configService.getString(accountRootPropName);
    if (accountUID.equals(protocolProviderAccountUID)) {
      lastStatus=configService.getString(accountRootPropName + "String_Node_Str");
      if (lastStatus != null)       break;
    }
  }
  return lastStatus;
}
Program: 103942
Project: 103942
Buggy source:
/** 
 * Returns TRUE if there are selected status selector boxes, otherwise returns FALSE.
 */
public boolean hasSelectedMenus(){
  Enumeration<StatusSelectorMenu> statusMenus=accountMenus.elements();
  while (statusMenus.hasMoreElements()) {
    StatusSelectorMenu statusSelectorMenu=statusMenus.nextElement();
    if (statusSelectorMenu.isSelected()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns TRUE if there are selected status selector boxes, otherwise returns FALSE.
 */
public boolean hasSelectedMenus(){
  for (  StatusSelectorMenu statusSelectorMenu : accountMenus.values())   if (statusSelectorMenu.isSelected())   return true;
  return false;
}
Program: 103943
Project: 103943
Buggy source:
/** 
 * Returns the last status that was stored in the configuration xml for the given protocol provider.
 * @param protocolProvider the protocol provider
 * @return the last status that was stored in the configuration xml for thegiven protocol provider
 */
public PresenceStatus getLastPresenceStatus(ProtocolProviderService protocolProvider){
  String lastStatus=getLastStatusString(protocolProvider);
  OperationSetPresence presence=(OperationSetPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
  if (presence == null)   return null;
  Iterator<PresenceStatus> i=presence.getSupportedStatusSet();
  if (lastStatus != null) {
    PresenceStatus status;
    while (i.hasNext()) {
      status=i.next();
      if (status.getStatusName().equals(lastStatus)) {
        return status;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the last status that was stored in the configuration xml for the given protocol provider.
 * @param protocolProvider the protocol provider
 * @return the last status that was stored in the configuration xml for thegiven protocol provider
 */
public PresenceStatus getLastPresenceStatus(ProtocolProviderService protocolProvider){
  String lastStatus=getLastStatusString(protocolProvider);
  if (lastStatus != null) {
    OperationSetPresence presence=(OperationSetPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
    if (presence == null)     return null;
    Iterator<PresenceStatus> i=presence.getSupportedStatusSet();
    PresenceStatus status;
    while (i.hasNext()) {
      status=i.next();
      if (status.getStatusName().equals(lastStatus))       return status;
    }
  }
  return null;
}
Program: 103944
Project: 103944
Buggy source:
/** 
 * Creates an instance of <tt>SimpleStatusSelectorBox</tt>.
 * @param mainFrame The main application window.
 */
public GlobalStatusSelectorBox(MainFrame mainFrame){
  this.mainFrame=mainFrame;
  this.setUI(new SIPCommStatusMenuUI());
  this.setOpaque(false);
  this.setText("String_Node_Str");
  this.setIcon(offlineIcon);
  String tooltip="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  this.setToolTipText(tooltip);
  onlineItem.setName(Constants.ONLINE_STATUS);
  offlineItem.setName(Constants.OFFLINE_STATUS);
  awayItem.setName(Constants.AWAY_STATUS);
  ffcItem.setName(Constants.FREE_FOR_CHAT_STATUS);
  onlineItem.addActionListener(this);
  offlineItem.addActionListener(this);
  awayItem.addActionListener(this);
  ffcItem.addActionListener(this);
  titleLabel=new JLabel("String_Node_Str");
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  this.add(onlineItem);
  this.add(ffcItem);
  this.add(awayItem);
  this.add(offlineItem);
  this.addSeparator();
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>SimpleStatusSelectorBox</tt>.
 * @param mainFrame The main application window.
 */
public GlobalStatusSelectorBox(MainFrame mainFrame){
  this.mainFrame=mainFrame;
  JLabel titleLabel=new JLabel("String_Node_Str");
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  onlineItem=createMenuItem("String_Node_Str",ImageLoader.USER_ONLINE_ICON,Constants.ONLINE_STATUS);
  ffcItem=createMenuItem("String_Node_Str",ImageLoader.USER_FFC_ICON,Constants.FREE_FOR_CHAT_STATUS);
  awayItem=createMenuItem("String_Node_Str",ImageLoader.USER_AWAY_ICON,Constants.AWAY_STATUS);
  offlineItem=createMenuItem("String_Node_Str",ImageLoader.USER_OFFLINE_ICON,Constants.OFFLINE_STATUS);
  this.addSeparator();
  this.setIcon(offlineItem.getIcon());
  this.setOpaque(false);
  this.setText("String_Node_Str");
  this.setToolTipText("String_Node_Str");
  this.setUI(new SIPCommStatusMenuUI());
  computeTextWidth();
}
Program: 103945
Project: 103945
Buggy source:
public void addAccount(ProtocolProviderService protocolProvider){
  OperationSetPersistentPresence presenceOpSet=(OperationSetPersistentPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
  boolean isHidden=protocolProvider.getAccountID().getAccountProperty(ProtocolProviderFactory.IS_PROTOCOL_HIDDEN) != null;
  if (isHidden)   return;
  StatusSelectorMenu statusSelectorMenu=null;
  if (presenceOpSet != null) {
    statusSelectorMenu=new PresenceStatusMenu(mainFrame,protocolProvider);
  }
 else {
    statusSelectorMenu=new SimpleStatusMenu(protocolProvider);
  }
  this.add(statusSelectorMenu);
  this.accountMenus.put(protocolProvider,statusSelectorMenu);
}

Fixed version (ground truth):
public void addAccount(ProtocolProviderService protocolProvider){
  boolean isHidden=protocolProvider.getAccountID().getAccountProperty(ProtocolProviderFactory.IS_PROTOCOL_HIDDEN) != null;
  if (isHidden)   return;
  OperationSetPersistentPresence presenceOpSet=(OperationSetPersistentPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
  StatusSelectorMenu statusSelectorMenu=(presenceOpSet != null) ? new PresenceStatusMenu(mainFrame,protocolProvider) : new SimpleStatusMenu(protocolProvider);
  this.add(statusSelectorMenu);
  this.accountMenus.put(protocolProvider,statusSelectorMenu);
}
Program: 103946
Project: 103946
Buggy source:
/** 
 * @param status Currently unused 
 */
public void updateStatus(Object status){
}

Fixed version (ground truth):
/** 
 * Stops the timer that manages the connecting animated icon.
 */
public void updateStatus(){
  String tooltip=this.getToolTipText();
  tooltip=tooltip.substring(0,tooltip.lastIndexOf("String_Node_Str"));
  ImageIcon statusImage=ImageLoader.getAccountStatusImage(protocolProvider);
  JMenuItem menuItem=protocolProvider.isRegistered() ? onlineItem : offlineItem;
  setSelected(new SelectedObject(statusImage,menuItem));
  setToolTipText(tooltip.concat("String_Node_Str" + menuItem.getText()));
}
Program: 103947
Project: 103947
Buggy source:
private SimpleStatusMenu(ProtocolProviderService protocolProvider,String displayName,Image onlineImage){
  super(displayName,new ImageIcon(onlineImage));
  this.protocolProvider=protocolProvider;
  this.setToolTipText("String_Node_Str" + displayName + "String_Node_Str");
  JLabel titleLabel=new JLabel(displayName);
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  onlineItem=createMenuItem("String_Node_Str",getIcon(),Constants.ONLINE_STATUS);
  offlineItem=createMenuItem("String_Node_Str",new ImageIcon(LightGrayFilter.createDisabledImage(onlineImage)),Constants.OFFLINE_STATUS);
}

Fixed version (ground truth):
private SimpleStatusMenu(ProtocolProviderService protocolProvider,String displayName,Image onlineImage){
  super(displayName,new ImageIcon(onlineImage));
  this.protocolProvider=protocolProvider;
  this.setToolTipText("String_Node_Str" + displayName + "String_Node_Str");
  JLabel titleLabel=new JLabel(displayName);
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  onlineItem=createMenuItem("String_Node_Str",getIcon(),Constants.ONLINE_STATUS);
  offlineItem=createMenuItem("String_Node_Str",new ImageIcon(LightGrayFilter.createDisabledImage(onlineImage)),Constants.OFFLINE_STATUS);
  updateStatus();
}
Program: 103948
Project: 103948
Buggy source:
/** 
 * Returns the service name - the server we are logging to if it is null which is not supposed to be - we return for compatibility the string we used in the first release for creating AccountID (Using this string is wrong, but used for compatibility for now)
 * @param accountProperties Map the properties table configuring the account
 * @return String the service name
 */
private static String getServiceName(Map accountProperties){
  String serviceName=(String)accountProperties.get(ProtocolProviderFactory.SERVER_ADDRESS);
  if (serviceName != null)   return serviceName;
 else   return ProtocolNames.IRC;
}

Fixed version (ground truth):
/** 
 * Returns the service name - the server we are logging to if it is null which is not supposed to be - we return for compatibility the string we used in the first release for creating AccountID (Using this string is wrong, but used for compatibility for now)
 * @param accountProperties Map the properties table configuring the account
 * @return String the service name
 */
private static String getServiceName(Map<String,String> accountProperties){
  String serviceName=accountProperties.get(ProtocolProviderFactory.SERVER_ADDRESS);
  return (serviceName == null) ? ProtocolNames.IRC : serviceName;
}
Program: 103949
Project: 103949
Buggy source:
/** 
 * Returns the <tt>ResourceManagementService</tt>.
 * @return the <tt>ResourceManagementService</tt>.
 */
public static ResourceManagementService getResources(){
  if (resourceService == null) {
    ServiceReference serviceReference=bundleContext.getServiceReference(ResourceManagementService.class.getName());
    if (serviceReference == null)     return null;
    resourceService=(ResourceManagementService)bundleContext.getService(serviceReference);
  }
  return resourceService;
}

Fixed version (ground truth):
/** 
 * Returns the <tt>ResourceManagementService</tt>.
 * @return the <tt>ResourceManagementService</tt>.
 */
public static ResourceManagementService getResources(){
  if (resourceService == null)   resourceService=ResourceManagementServiceUtils.getService(bundleContext);
  return resourceService;
}
Program: 103950
Project: 103950
Buggy source:
/** 
 * This method is called whenever someone (possibly us) quits from the server. We will only observe this if the user was in one of the channels to which we are connected.
 * @param sourceNick The nick of the user that quit from the server.
 * @param sourceLogin The login of the user that quit from the server.
 * @param sourceHostname The host name of the user that quit from the server.
 * @param reason The reason given for quitting the server.
 */
protected void onQuit(String sourceNick,String sourceLogin,String sourceHostname,String reason){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + sourceNick + "String_Node_Str"+ sourceLogin+ "String_Node_Str"+ sourceHostname);
  Iterator joinedChatRooms=ircMUCOpSet.getCurrentlyJoinedChatRooms().iterator();
  while (joinedChatRooms.hasNext()) {
    ChatRoomIrcImpl chatRoom=(ChatRoomIrcImpl)joinedChatRooms.next();
    if (chatRoom.getUserNickname().equals(sourceNick))     ircMUCOpSet.fireLocalUserPresenceEvent(chatRoom,LocalUserChatRoomPresenceChangeEvent.LOCAL_USER_DROPPED,reason);
 else {
      ChatRoomMember member=chatRoom.getChatRoomMember(sourceNick);
      if (member == null)       return;
      chatRoom.removeChatRoomMember(sourceNick);
      chatRoom.fireMemberPresenceEvent(member,null,ChatRoomMemberPresenceChangeEvent.MEMBER_QUIT,reason);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method is called whenever someone (possibly us) quits from the server. We will only observe this if the user was in one of the channels to which we are connected.
 * @param sourceNick The nick of the user that quit from the server.
 * @param sourceLogin The login of the user that quit from the server.
 * @param sourceHostname The host name of the user that quit from the server.
 * @param reason The reason given for quitting the server.
 */
protected void onQuit(String sourceNick,String sourceLogin,String sourceHostname,String reason){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + sourceNick + "String_Node_Str"+ sourceLogin+ "String_Node_Str"+ sourceHostname);
  for (  ChatRoom chatRoom : ircMUCOpSet.getCurrentlyJoinedChatRooms()) {
    ChatRoomIrcImpl chatRoomIrcImpl=(ChatRoomIrcImpl)chatRoom;
    if (chatRoom.getUserNickname().equals(sourceNick))     ircMUCOpSet.fireLocalUserPresenceEvent(chatRoom,LocalUserChatRoomPresenceChangeEvent.LOCAL_USER_DROPPED,reason);
 else {
      ChatRoomMember member=chatRoomIrcImpl.getChatRoomMember(sourceNick);
      if (member == null)       return;
      chatRoomIrcImpl.removeChatRoomMember(sourceNick);
      chatRoomIrcImpl.fireMemberPresenceEvent(member,null,ChatRoomMemberPresenceChangeEvent.MEMBER_QUIT,reason);
    }
  }
}
Program: 103951
Project: 103951
Buggy source:
/** 
 * Who is.
 * @param userInfo
 */
private void onWhoIs(UserInfo userInfo){
  logger.trace("String_Node_Str" + userInfo.getNickName() + "String_Node_Str"+ userInfo.getLogin()+ "String_Node_Str"+ userInfo.getHostname());
  String whoisMessage="String_Node_Str" + userInfo.getNickName() + "String_Node_Str"+ "String_Node_Str"+ userInfo.getHostname()+ "String_Node_Str"+ "String_Node_Str"+ userInfo.getLogin()+ "String_Node_Str"+ "String_Node_Str"+ userInfo.getServerInfo()+ "String_Node_Str"+ "String_Node_Str";
  Iterator joinedChatRooms=userInfo.getJoinedChatRooms().iterator();
  while (joinedChatRooms.hasNext()) {
    whoisMessage+="String_Node_Str" + joinedChatRooms.next();
  }
  MessageIrcImpl message=new MessageIrcImpl(whoisMessage,MessageIrcImpl.DEFAULT_MIME_TYPE,MessageIrcImpl.DEFAULT_MIME_ENCODING,null);
  ChatRoomIrcImpl chatRoom=ircMUCOpSet.findSystemRoom();
  if (chatRoom == null || !chatRoom.isJoined())   return;
  ChatRoomMember sourceMember=ircMUCOpSet.findSystemMember();
  chatRoom.fireMessageReceivedEvent(message,sourceMember,System.currentTimeMillis(),ChatRoomMessageReceivedEvent.SYSTEM_MESSAGE_RECEIVED);
}

Fixed version (ground truth):
/** 
 * Who is.
 * @param userInfo
 */
private void onWhoIs(UserInfo userInfo){
  ChatRoomIrcImpl chatRoom=ircMUCOpSet.findSystemRoom();
  if ((chatRoom == null) || !chatRoom.isJoined())   return;
  logger.trace("String_Node_Str" + userInfo.getNickName() + "String_Node_Str"+ userInfo.getLogin()+ "String_Node_Str"+ userInfo.getHostname());
  String whoisMessage="String_Node_Str" + userInfo.getNickName() + "String_Node_Str"+ "String_Node_Str"+ userInfo.getHostname()+ "String_Node_Str"+ "String_Node_Str"+ userInfo.getLogin()+ "String_Node_Str"+ "String_Node_Str"+ userInfo.getServerInfo()+ "String_Node_Str"+ "String_Node_Str";
  for (  String joinedChatRoom : userInfo.getJoinedChatRooms())   whoisMessage+="String_Node_Str" + joinedChatRoom;
  MessageIrcImpl message=new MessageIrcImpl(whoisMessage,MessageIrcImpl.DEFAULT_MIME_TYPE,MessageIrcImpl.DEFAULT_MIME_ENCODING,null);
  chatRoom.fireMessageReceivedEvent(message,ircMUCOpSet.findSystemMember(),System.currentTimeMillis(),ChatRoomMessageReceivedEvent.SYSTEM_MESSAGE_RECEIVED);
}
Program: 103952
Project: 103952
Buggy source:
/** 
 * This method is called whenever someone (possibly us) changes nick on any of the channels that we are on.
 * @param oldNick The old nick.
 * @param login The login of the user.
 * @param hostname The host name of the user.
 * @param newNick The new nick.
 */
protected void onNickChange(String oldNick,String login,String hostname,String newNick){
  logger.trace("String_Node_Str" + oldNick + "String_Node_Str"+ newNick);
  this.notifyChatRoomOperation(0);
  Iterator joinedChatRoomsIter=ircMUCOpSet.getCurrentlyJoinedChatRooms().iterator();
  while (joinedChatRoomsIter.hasNext()) {
    ChatRoomIrcImpl chatRoom=(ChatRoomIrcImpl)joinedChatRoomsIter.next();
    if (chatRoom.getUserNickname().equals(oldNick)) {
      chatRoom.setNickName(newNick);
      return;
    }
    ChatRoomMember member=chatRoom.getChatRoomMember(oldNick);
    if (member == null)     continue;
    ChatRoomMemberPropertyChangeEvent evt=new ChatRoomMemberPropertyChangeEvent(member,chatRoom,ChatRoomMemberPropertyChangeEvent.MEMBER_NICKNAME,oldNick,newNick);
    chatRoom.fireMemberPropertyChangeEvent(evt);
  }
}

Fixed version (ground truth):
/** 
 * This method is called whenever someone (possibly us) changes nick on any of the channels that we are on.
 * @param oldNick The old nick.
 * @param login The login of the user.
 * @param hostname The host name of the user.
 * @param newNick The new nick.
 */
protected void onNickChange(String oldNick,String login,String hostname,String newNick){
  logger.trace("String_Node_Str" + oldNick + "String_Node_Str"+ newNick);
  this.notifyChatRoomOperation(0);
  for (  ChatRoom chatRoom : ircMUCOpSet.getCurrentlyJoinedChatRooms()) {
    ChatRoomIrcImpl chatRoomIrcImpl=(ChatRoomIrcImpl)chatRoom;
    if (chatRoom.getUserNickname().equals(oldNick)) {
      chatRoomIrcImpl.setNickName(newNick);
      return;
    }
    ChatRoomMember member=chatRoomIrcImpl.getChatRoomMember(oldNick);
    if (member == null)     continue;
    ChatRoomMemberPropertyChangeEvent evt=new ChatRoomMemberPropertyChangeEvent(member,chatRoom,ChatRoomMemberPropertyChangeEvent.MEMBER_NICKNAME,oldNick,newNick);
    chatRoomIrcImpl.fireMemberPropertyChangeEvent(evt);
  }
}
Program: 103953
Project: 103953
Buggy source:
/** 
 * Returns the byte representation of the image corresponding to the given identifier.
 * @param imageID the identifier of the image
 * @return the byte representation of the image corresponding to the givenidentifier.
 */
private static byte[] getImageInBytes(String imageID){
  InputStream in=DictActivator.getResources().getImageInputStream(imageID);
  if (in == null)   return null;
  byte[] image=null;
  try {
    image=new byte[in.available()];
    in.read(image);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + imageID,e);
  }
  return image;
}

Fixed version (ground truth):
/** 
 * Returns the byte representation of the image corresponding to the given identifier.
 * @param imageID the identifier of the image
 * @return the byte representation of the image corresponding to the givenidentifier.
 */
private static byte[] getImageInBytes(String imageID){
  return ProtocolIconIrcImpl.getImageInBytes(imageID);
}
Program: 103954
Project: 103954
Buggy source:
/** 
 * Returns the byte representation of the image corresponding to the given identifier.
 * @param imageID the identifier of the image
 * @return the byte representation of the image corresponding to the givenidentifier.
 */
public static byte[] getImageInBytes(String imageID){
  InputStream in=IrcActivator.getResources().getImageInputStream(imageID);
  if (in == null)   return null;
  byte[] image=null;
  try {
    image=new byte[in.available()];
    in.read(image);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + imageID,e);
  }
  return image;
}

Fixed version (ground truth):
/** 
 * Returns the byte representation of the image corresponding to the given identifier.
 * @param imageID the identifier of the image
 * @return the byte representation of the image corresponding to the givenidentifier.
 */
static byte[] getImageInBytes(String imageID){
  InputStream in=IrcActivator.getResources().getImageInputStream(imageID);
  byte[] image=null;
  if (in != null) {
    try {
      image=new byte[in.available()];
      in.read(image);
    }
 catch (    IOException e) {
      logger.error("String_Node_Str" + imageID,e);
    }
  }
  return image;
}
Program: 103955
Project: 103955
Buggy source:
public OtrContactMenu(Contact contact){
  this.contact=contact;
  this.setText(contact.getDisplayName());
  getPopupMenu().addPopupMenuListener(this);
  OtrActivator.scOtrEngine.addListener(this);
  OtrActivator.scOtrKeyManager.addListener(this);
  setSessionStatus(OtrActivator.scOtrEngine.getSessionStatus(contact));
  setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(contact));
}

Fixed version (ground truth):
public OtrContactMenu(Contact contact,boolean inMacOSXScreenMenuBar){
  this.contact=contact;
  this.inMacOSXScreenMenuBar=inMacOSXScreenMenuBar;
  this.setText(contact.getDisplayName());
  if (!this.inMacOSXScreenMenuBar)   getPopupMenu().addPopupMenuListener(this);
  OtrActivator.scOtrEngine.addListener(this);
  OtrActivator.scOtrKeyManager.addListener(this);
  setSessionStatus(OtrActivator.scOtrEngine.getSessionStatus(contact));
  setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(contact));
}
Program: 103956
Project: 103956
Buggy source:
private void setSessionStatus(SessionStatus sessionStatus){
  if (sessionStatus != this.sessionStatus) {
    this.sessionStatus=sessionStatus;
    updateIcon();
    if (isPopupMenuVisible())     rebuildMenu();
  }
}

Fixed version (ground truth):
private void setSessionStatus(SessionStatus sessionStatus){
  if (sessionStatus != this.sessionStatus) {
    this.sessionStatus=sessionStatus;
    updateIcon();
    if (isPopupMenuVisible() || inMacOSXScreenMenuBar)     rebuildMenu();
  }
}
Program: 103957
Project: 103957
Buggy source:
private void setOtrPolicy(OtrPolicy otrPolicy){
  if (!otrPolicy.equals(this.otrPolicy)) {
    this.otrPolicy=otrPolicy;
    if (isPopupMenuVisible())     rebuildMenu();
  }
}

Fixed version (ground truth):
private void setOtrPolicy(OtrPolicy otrPolicy){
  if (!otrPolicy.equals(this.otrPolicy)) {
    this.otrPolicy=otrPolicy;
    if (isPopupMenuVisible() || inMacOSXScreenMenuBar)     rebuildMenu();
  }
}
Program: 103958
Project: 103958
Buggy source:
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
  createOtrContactMenus(currentContact);
  if (whatsThis == null) {
    menu.addSeparator();
    whatsThis=new JMenuItem();
    whatsThis.setIcon(OtrActivator.resourceService.getImage("String_Node_Str"));
    whatsThis.setText(OtrActivator.resourceService.getI18NString("String_Node_Str"));
    whatsThis.addActionListener(this);
    menu.add(whatsThis);
  }
}

Fixed version (ground truth):
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
  createOtrContactMenus(currentContact);
  if (whatsThis == null) {
    JMenu menu=getMenu();
    menu.addSeparator();
    whatsThis=new JMenuItem();
    whatsThis.setIcon(OtrActivator.resourceService.getImage("String_Node_Str"));
    whatsThis.setText(OtrActivator.resourceService.getI18NString("String_Node_Str"));
    whatsThis.addActionListener(this);
    menu.add(whatsThis);
  }
}
Program: 103959
Project: 103959
Buggy source:
/** 
 * Gets the <code>JMenu</code> which is the component of this plugin. If it still doesn't exist, it's created.
 * @return the <code>JMenu</code> which is the component of this plugin
 */
private JMenu getMenu(){
  if (menu == null) {
    menu=new JMenu();
    menu.setText(getName());
    if (Container.CONTAINER_CONTACT_RIGHT_BUTTON_MENU.equals(getContainer())) {
      Icon icon=OtrActivator.resourceService.getImage("String_Node_Str");
      if (icon != null)       menu.setIcon(icon);
    }
    menu.getPopupMenu().addPopupMenuListener(this);
  }
  return menu;
}

Fixed version (ground truth):
/** 
 * Gets the <tt>JMenu</tt> which is the component of this plug-in. If it still doesn't exist, it's created.
 * @return the <tt>JMenu</tt> which is the component of this plug-in
 */
private JMenu getMenu(){
  if (menu == null) {
    menu=new JMenu();
    menu.setText(getName());
    if (Container.CONTAINER_CONTACT_RIGHT_BUTTON_MENU.equals(getContainer())) {
      Icon icon=OtrActivator.resourceService.getImage("String_Node_Str");
      if (icon != null)       menu.setIcon(icon);
    }
    if (!inMacOSXScreenMenuBar)     menu.getPopupMenu().addPopupMenuListener(this);
  }
  return menu;
}
Program: 103960
Project: 103960
Buggy source:
private void createOtrContactMenus(MetaContact metaContact){
  for (int itemIndex=0, itemCount=menu.getItemCount(); itemIndex < itemCount; ) {
    JMenuItem menuItem=menu.getItem(itemIndex);
    if (menuItem instanceof OtrContactMenu) {
      menu.remove(itemIndex);
      itemCount--;
      ((OtrContactMenu)menuItem).dispose();
    }
 else     itemIndex++;
  }
  if (metaContact != null) {
    Iterator<Contact> contacts=metaContact.getContacts();
    int itemIndex=0;
    while (contacts.hasNext()) {
      menu.insert(new OtrContactMenu(contacts.next()),itemIndex);
      itemIndex++;
    }
  }
}

Fixed version (ground truth):
private void createOtrContactMenus(MetaContact metaContact){
  JMenu menu=getMenu();
  for (int itemIndex=0, itemCount=menu.getItemCount(); itemIndex < itemCount; ) {
    JMenuItem menuItem=menu.getItem(itemIndex);
    if (menuItem instanceof OtrContactMenu) {
      menu.remove(itemIndex);
      itemCount--;
      ((OtrContactMenu)menuItem).dispose();
    }
 else     itemIndex++;
  }
  if (metaContact != null) {
    Iterator<Contact> contacts=metaContact.getContacts();
    int itemIndex=0;
    while (contacts.hasNext()) {
      menu.insert(new OtrContactMenu(contacts.next(),inMacOSXScreenMenuBar),itemIndex);
      itemIndex++;
    }
  }
}
Program: 103961
Project: 103961
Buggy source:
public void setCurrentContact(MetaContact metaContact){
  if (this.currentContact != metaContact) {
    this.currentContact=metaContact;
    if ((menu != null) && menu.isPopupMenuVisible())     createOtrContactMenus(currentContact);
  }
}

Fixed version (ground truth):
public void setCurrentContact(MetaContact metaContact){
  if (this.currentContact != metaContact) {
    this.currentContact=metaContact;
    if (inMacOSXScreenMenuBar)     popupMenuWillBecomeVisible(null);
 else     if ((menu != null) && menu.isPopupMenuVisible())     createOtrContactMenus(currentContact);
  }
}
Program: 103962
Project: 103962
Buggy source:
public OtrMetaContactMenu(Container container){
  super(container);
}

Fixed version (ground truth):
public OtrMetaContactMenu(Container container){
  super(container);
  inMacOSXScreenMenuBar=Container.CONTAINER_CHAT_MENU_BAR.equals(container) && OtrActivator.uiService.useMacOSXScreenMenuBar();
}
Program: 103964
Project: 103964
Buggy source:
/** 
 * Defines actions when send button is pressed.
 * @param evt The <tt>ActionEvent</tt> object.
 */
public void actionPerformed(ActionEvent evt){
  if (!chatPanel.isWriteAreaEmpty()) {
    new Thread(){
      public void run(){
        chatPanel.sendMessage();
      }
    }
.start();
  }
}

Fixed version (ground truth):
/** 
 * Defines actions when send button is pressed.
 * @param evt The <tt>ActionEvent</tt> object.
 */
public void actionPerformed(ActionEvent evt){
  if (!chatPanel.isWriteAreaEmpty()) {
    new Thread(){
      public void run(){
        chatPanel.sendMessage();
      }
    }
.start();
  }
  chatPanel.requestFocusInWriteArea();
}
Program: 103965
Project: 103965
Buggy source:
/** 
 * Creates the file to download.
 * @return the file to download.
 */
private File createFile(IncomingFileTransferRequest fileTransferRequest){
  File downloadFile=null;
  File downloadDir=null;
  String incomingFileName=fileTransferRequest.getFileName();
  try {
    downloadDir=GuiActivator.getFileAccessService().getDefaultDownloadDirectory();
    if (!downloadDir.exists()) {
      if (!downloadDir.mkdirs()) {
        logger.error("String_Node_Str" + downloadDir.getAbsolutePath());
      }
      logger.debug("String_Node_Str" + downloadDir.getAbsolutePath());
    }
  }
 catch (  IOException e) {
    logger.debug("String_Node_Str",e);
  }
  downloadFile=new File(downloadDir,incomingFileName);
  int index=0;
  while (downloadFile.exists()) {
    String newFileName=incomingFileName.substring(0,incomingFileName.lastIndexOf("String_Node_Str")) + "String_Node_Str" + ++index+ incomingFileName.substring(incomingFileName.lastIndexOf("String_Node_Str"));
    downloadFile=new File(downloadDir,newFileName);
  }
  fileLabel.setText(downloadFile.getName());
  return downloadFile;
}

Fixed version (ground truth):
/** 
 * Creates the file to download.
 * @return the file to download.
 */
private File createFile(IncomingFileTransferRequest fileTransferRequest){
  File downloadFile=null;
  File downloadDir=null;
  String incomingFileName=fileTransferRequest.getFileName();
  try {
    downloadDir=GuiActivator.getFileAccessService().getDefaultDownloadDirectory();
    if (!downloadDir.exists()) {
      if (!downloadDir.mkdirs()) {
        logger.error("String_Node_Str" + downloadDir.getAbsolutePath());
      }
      logger.debug("String_Node_Str" + downloadDir.getAbsolutePath());
    }
  }
 catch (  IOException e) {
    logger.debug("String_Node_Str",e);
  }
  downloadFile=new File(downloadDir,incomingFileName);
  int index=0;
  while (downloadFile.exists()) {
    String newFileName=incomingFileName.substring(0,incomingFileName.lastIndexOf("String_Node_Str")) + "String_Node_Str" + ++index+ incomingFileName.substring(incomingFileName.lastIndexOf("String_Node_Str"));
    downloadFile=new File(downloadDir,newFileName);
  }
  if (!downloadFile.getName().equals(fileTransferRequest.getFileName())) {
    String fileName=getFileLabel(downloadFile.getName(),fileTransferRequest.getFileSize());
    fileLabel.setText(fileName);
  }
  return downloadFile;
}
Program: 103966
Project: 103966
Buggy source:
/** 
 * Initializes the dialog.
 */
private void init(){
  this.setTitle(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.getRootPane().setDefaultButton(addButton);
  this.addButton.setName("String_Node_Str");
  this.cancelButton.setName("String_Node_Str");
  this.addButton.addActionListener(this);
  this.cancelButton.addActionListener(this);
  this.addButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("String_Node_Str"));
  this.cancelButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("String_Node_Str"));
  this.buttonsPanel.add(addButton);
  this.buttonsPanel.add(cancelButton);
  this.mainPanel.setBorder(BorderFactory.createEmptyBorder(5,10,0,10));
  this.mainPanel.add(groupPanel,BorderLayout.CENTER);
  this.mainPanel.add(buttonsPanel,BorderLayout.SOUTH);
  this.getContentPane().add(mainPanel);
}

Fixed version (ground truth):
/** 
 * Initializes the dialog.
 */
private void init(){
  this.setTitle(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.getRootPane().setDefaultButton(addButton);
  this.addButton.setName("String_Node_Str");
  this.cancelButton.setName("String_Node_Str");
  this.addButton.addActionListener(this);
  this.cancelButton.addActionListener(this);
  this.addButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("String_Node_Str"));
  this.cancelButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("String_Node_Str"));
  this.buttonsPanel.add(addButton);
  this.buttonsPanel.add(cancelButton);
  this.mainPanel.setBorder(BorderFactory.createEmptyBorder(5,10,0,10));
  this.mainPanel.add(groupPanel,BorderLayout.CENTER);
  this.mainPanel.add(buttonsPanel,BorderLayout.SOUTH);
  this.getContentPane().add(mainPanel);
  this.addWindowFocusListener(this);
}
Program: 103967
Project: 103967
Buggy source:
/** 
 * Creates an instance of <tt>MainFrame</tt>.
 */
public MainFrame(){
  if (!ConfigurationManager.isWindowDecorated()) {
    this.setUndecorated(true);
  }
  this.mainCallPanel=new MainCallPanel(this);
  this.contactListPanel=new ContactListPane(this);
  this.accountStatusPanel=new AccountStatusPanel(this);
  menu=new MainMenu(this);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosed(    WindowEvent event){
      MainFrame.this.windowClosed(event);
    }
    public void windowClosing(    WindowEvent event){
      MainFrame.this.windowClosing(event);
    }
  }
);
  addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      if ((glassPane != null) && glassPane.isVisible())       glassPane.revalidate();
    }
  }
);
  this.initTitleFont();
  ResourceManagementService resources=GuiActivator.getResources();
  String applicationName=resources.getSettingsString("String_Node_Str");
  this.setTitle(applicationName);
  this.mainPanel.setBackground(new Color(GuiActivator.getResources().getColor("String_Node_Str")));
  this.init();
  this.initPluginComponents();
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>MainFrame</tt>.
 */
public MainFrame(){
  if (!ConfigurationManager.isWindowDecorated()) {
    this.setUndecorated(true);
  }
  this.mainCallPanel=new MainCallPanel(this);
  this.contactListPanel=new ContactListPane(this);
  this.accountStatusPanel=new AccountStatusPanel(this);
  menu=new MainMenu(this);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosed(    WindowEvent event){
      MainFrame.this.windowClosed(event);
    }
  }
);
  addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      if ((glassPane != null) && glassPane.isVisible())       glassPane.revalidate();
    }
  }
);
  this.initTitleFont();
  ResourceManagementService resources=GuiActivator.getResources();
  String applicationName=resources.getSettingsString("String_Node_Str");
  this.setTitle(applicationName);
  this.mainPanel.setBackground(new Color(GuiActivator.getResources().getColor("String_Node_Str")));
  this.init();
  this.initPluginComponents();
}
Program: 103968
Project: 103968
Buggy source:
/** 
 * @param event Currently not used
 */
protected void windowClosing(WindowEvent event){
  if (!GuiActivator.getUIService().getExitOnMainWindowClose()) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        if (ConfigurationManager.isQuitWarningShown()) {
          MessageDialog dialog=new MessageDialog(null,GuiActivator.getResources().getI18NString("String_Node_Str"),GuiActivator.getResources().getI18NString("String_Node_Str"),false);
          if (dialog.showDialog() == MessageDialog.OK_DONT_ASK_CODE)           ConfigurationManager.setQuitWarningShown(false);
        }
      }
    }
);
    ConfigurationManager.setApplicationVisible(false);
  }
}

Fixed version (ground truth):
protected void windowClosing(WindowEvent event){
  super.windowClosing(event);
  if (!GuiActivator.getUIService().getExitOnMainWindowClose()) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        if (ConfigurationManager.isQuitWarningShown()) {
          MessageDialog dialog=new MessageDialog(null,GuiActivator.getResources().getI18NString("String_Node_Str"),GuiActivator.getResources().getI18NString("String_Node_Str"),false);
          if (dialog.showDialog() == MessageDialog.OK_DONT_ASK_CODE)           ConfigurationManager.setQuitWarningShown(false);
        }
      }
    }
);
    ConfigurationManager.setApplicationVisible(false);
  }
}
Program: 103970
Project: 103970
Buggy source:
public void popupMenuCanceled(PopupMenuEvent e){
  hiddenWindow.setVisible(false);
  popupVisible=false;
}

Fixed version (ground truth):
public void popupMenuCanceled(PopupMenuEvent e){
  if (hiddenWindow != null) {
    hiddenWindow.dispose();
    hiddenWindow=null;
  }
}
Program: 103971
Project: 103971
Buggy source:
public void mouseReleased(MouseEvent e){
  if (e.getButton() == MouseEvent.BUTTON3 && !popupVisible) {
    int x=e.getX(), y=e.getY();
    hiddenWindow.setLocation(x,y);
    hiddenWindow.setVisible(true);
    this.popup.show(hiddenWindow,0,0);
    hiddenWindow.toFront();
    popupVisible=true;
  }
 else {
    popup.setVisible(false);
    popupVisible=false;
  }
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent e){
  showPopupMenu(e);
}
Program: 103972
Project: 103972
Buggy source:
public void popupMenuWillBecomeInvisible(PopupMenuEvent e){
  hiddenWindow.setVisible(false);
  popupVisible=false;
}

Fixed version (ground truth):
public void popupMenuWillBecomeInvisible(PopupMenuEvent e){
  if (hiddenWindow != null) {
    hiddenWindow.dispose();
    hiddenWindow=null;
  }
}
Program: 103973
Project: 103973
Buggy source:
public AWTMouseAdapter(JPopupMenu p){
  hiddenWindow=new JWindow();
  hiddenWindow.setAlwaysOnTop(true);
  this.popup=p;
  this.popup.addPopupMenuListener(new PopupMenuListener(){
    public void popupMenuWillBecomeVisible(    PopupMenuEvent e){
    }
    public void popupMenuWillBecomeInvisible(    PopupMenuEvent e){
      hiddenWindow.setVisible(false);
      popupVisible=false;
    }
    public void popupMenuCanceled(    PopupMenuEvent e){
      hiddenWindow.setVisible(false);
      popupVisible=false;
    }
  }
);
}

Fixed version (ground truth):
public AWTMouseAdapter(JPopupMenu p){
  this.popup=p;
  this.popup.addPopupMenuListener(new PopupMenuListener(){
    public void popupMenuWillBecomeVisible(    PopupMenuEvent e){
    }
    public void popupMenuWillBecomeInvisible(    PopupMenuEvent e){
      if (hiddenWindow != null) {
        hiddenWindow.dispose();
        hiddenWindow=null;
      }
    }
    public void popupMenuCanceled(    PopupMenuEvent e){
      if (hiddenWindow != null) {
        hiddenWindow.dispose();
        hiddenWindow=null;
      }
    }
  }
);
}
Program: 103974
Project: 103974
Buggy source:
/** 
 * Requests the focus in the write message area.
 */
public void requestFocusInWriteArea(){
  getChatWritePanel().getEditorPane().requestFocus();
}

Fixed version (ground truth):
/** 
 * Requests the focus in the write message area.
 */
public void requestFocusInWriteArea(){
  getChatWritePanel().getEditorPane().requestFocusInWindow();
}
Program: 103975
Project: 103975
Buggy source:
/** 
 * Compares the two dates. The comparison is based only on the day, month and year values. Returns 0 if the two dates are equals, a value < 0 if the first date is before the second one and > 0 if the first date is after the second one.
 * @param date1 the first date to compare
 * @param date2 the second date to compare with 
 * @return Returns 0 if the two dates are equals, a value < 0 ifthe first date is before the second one and > 0 if the first date is after the second one
 */
public static int compareDatesOnly(long date1,long date2){
  c1.setTimeInMillis(date1);
  c2.setTimeInMillis(date2);
  int day1=c1.get(Calendar.DAY_OF_MONTH);
  int month1=c1.get(Calendar.MONTH);
  int year1=c1.get(Calendar.YEAR);
  int day2=c2.get(Calendar.DAY_OF_MONTH);
  int month2=c2.get(Calendar.MONTH);
  int year2=c2.get(Calendar.YEAR);
  if ((day1 == day2) && (month1 == month2) && (year1 == year2)) {
    return 0;
  }
 else   if ((day1 < day2) && (month1 <= month2) && (year1 <= year2)) {
    return -1;
  }
 else {
    return 1;
  }
}

Fixed version (ground truth):
/** 
 * Compares the two dates. The comparison is based only on the day, month and year values. Returns 0 if the two dates are equals, a value < 0 if the first date is before the second one and > 0 if the first date is after the second one.
 * @param date1 the first date to compare
 * @param date2 the second date to compare with 
 * @return Returns 0 if the two dates are equals, a value < 0 ifthe first date is before the second one and > 0 if the first date is after the second one
 */
public static int compareDatesOnly(long date1,long date2){
  c1.setTimeInMillis(date1);
  c2.setTimeInMillis(date2);
  int day1=c1.get(Calendar.DAY_OF_MONTH);
  int month1=c1.get(Calendar.MONTH);
  int year1=c1.get(Calendar.YEAR);
  int day2=c2.get(Calendar.DAY_OF_MONTH);
  int month2=c2.get(Calendar.MONTH);
  int year2=c2.get(Calendar.YEAR);
  if (year1 < year2) {
    return -1;
  }
 else   if (year1 == year2) {
    if (month1 < month2)     return -1;
 else     if (month1 == month2) {
      if (day1 < day2)       return -1;
 else       if (day1 == day2)       return 0;
 else       return 1;
    }
 else     return 1;
  }
 else {
    return 1;
  }
}
Program: 103976
Project: 103976
Buggy source:
public JButton getNextButton(){
  return this.nextButton;
}

Fixed version (ground truth):
/** 
 * Returns the next wizard button.
 * @return the next wizard button
 */
public JButton getNextButton(){
  return this.nextButton;
}
Program: 103977
Project: 103977
Buggy source:
public JButton getBackButton(){
  return this.backButton;
}

Fixed version (ground truth):
/** 
 * Returns the back wizard button.
 * @return the back wizard button
 */
public JButton getBackButton(){
  return this.backButton;
}
Program: 103978
Project: 103978
Buggy source:
/** 
 * Implements the <tt>WizardContainer.setFinishButtonText()</tt> method.
 */
public void setFinishButtonText(String text){
  FINISH_TEXT=text;
}

Fixed version (ground truth):
/** 
 * Sets the text label of the "Finish" wizard button.
 * @param text the new label of the button
 */
public void setFinishButtonText(String text){
  this.setFinishButtonDefaultText(text);
}
Program: 103979
Project: 103979
Buggy source:
public void refresh(){
  this.pack();
  this.repaint();
}

Fixed version (ground truth):
/** 
 * Refreshes this wizard dialog.
 */
public void refresh(){
  this.pack();
  this.repaint();
}
Program: 103980
Project: 103980
Buggy source:
/** 
 * Resets the buttons to support the original panel rules, including whether the next or back buttons are enabled or disabled, or if the panel is finishable. If the panel in question has another panel behind it, enables the back button. Otherwise, disables it. If the panel in question has one or more panels in front of it, enables the next button. Otherwise, disables it.
 */
void resetButtonsToPanelRules(){
  WizardModel model=wizard.getModel();
  WizardPage page=model.getCurrentWizardPage();
  model.setCancelButtonText(Wizard.CANCEL_TEXT);
  Object backPageIdentifier=page.getBackPageIdentifier();
  model.setBackButtonEnabled((backPageIdentifier != null) && !WizardPage.DEFAULT_PAGE_IDENTIFIER.equals(backPageIdentifier));
  model.setBackButtonText(Wizard.BACK_TEXT);
  model.setNextFinishButtonEnabled(page.getNextPageIdentifier() != null);
  if (page.getNextPageIdentifier().equals(WizardPage.FINISH_PAGE_IDENTIFIER)) {
    model.setNextFinishButtonText(Wizard.FINISH_TEXT);
  }
 else {
    model.setNextFinishButtonText(Wizard.NEXT_TEXT);
  }
}

Fixed version (ground truth):
/** 
 * Resets the buttons to support the original panel rules, including whether the next or back buttons are enabled or disabled, or if the panel is finish-able. If the panel in question has another panel behind it, enables the back button. Otherwise, disables it. If the panel in question has one or more panels in front of it, enables the next button. Otherwise, disables it.
 */
void resetButtonsToPanelRules(){
  WizardModel model=wizard.getModel();
  WizardPage page=model.getCurrentWizardPage();
  model.setCancelButtonText(wizard.getCancelButtonDefaultText());
  Object backPageIdentifier=page.getBackPageIdentifier();
  model.setBackButtonEnabled((backPageIdentifier != null) && !WizardPage.DEFAULT_PAGE_IDENTIFIER.equals(backPageIdentifier));
  model.setBackButtonText(wizard.getBackButtonDefaultText());
  model.setNextFinishButtonEnabled(page.getNextPageIdentifier() != null);
  if (page.getNextPageIdentifier().equals(WizardPage.FINISH_PAGE_IDENTIFIER)) {
    model.setNextFinishButtonText(wizard.getFinishButtonDefaultText());
  }
 else {
    model.setNextFinishButtonText(wizard.getNextButtonDefaultText());
  }
}