nus-yam/ex-repair huggingface dataset:
Program: 104158
Project: 104158
Buggy source:
/** 
 * Handle incoming message by creating an appropriate Sip Communicator <tt>Message</tt> and firing a <tt>MessageReceivedEvent</tt> to interested listeners.
 * @param ev The original <tt>SessionEvent</tt> which noticed usof an incoming message.
 */
private void handleNewMessage(SessionEvent ev){
  logger.debug("String_Node_Str" + ev);
  String formattedMessage=ev.getMessage();
  logger.debug("String_Node_Str" + formattedMessage);
  if (formattedMessage.startsWith("String_Node_Str")) {
    formattedMessage=processLinks(messageDecoder.decodeToHTML(formattedMessage));
  }
 else {
    formattedMessage=processLinks(formattedMessage);
  }
  formattedMessage=formattedMessage.replaceAll("String_Node_Str","String_Node_Str");
  formattedMessage=formattedMessage.replaceAll("String_Node_Str","String_Node_Str");
  logger.debug("String_Node_Str" + formattedMessage);
  Message newMessage=createMessage(formattedMessage,HTML_MIME_TYPE,DEFAULT_MIME_ENCODING,null);
  Contact sourceContact=opSetPersPresence.findContactByID(ev.getFrom());
  if (sourceContact == null) {
    logger.debug("String_Node_Str" + ev.getFrom());
    sourceContact=opSetPersPresence.createVolatileContact(ev.getFrom());
  }
  MessageReceivedEvent msgReceivedEvt=new MessageReceivedEvent(newMessage,sourceContact,new Date());
  fireMessageEvent(msgReceivedEvt);
}

Fixed version (ground truth):
/** 
 * Handle incoming message by creating an appropriate Sip Communicator <tt>Message</tt> and firing a <tt>MessageReceivedEvent</tt> to interested listeners.
 * @param ev The original <tt>SessionEvent</tt> which noticed usof an incoming message.
 */
private void handleNewMessage(SessionEvent ev){
  logger.debug("String_Node_Str" + ev);
  String formattedMessage=ev.getMessage();
  logger.debug("String_Node_Str" + formattedMessage);
  formattedMessage=processLinks(messageDecoder.decodeToHTML(formattedMessage));
  formattedMessage=formattedMessage.replaceAll("String_Node_Str","String_Node_Str");
  formattedMessage=formattedMessage.replaceAll("String_Node_Str","String_Node_Str");
  logger.debug("String_Node_Str" + formattedMessage);
  Message newMessage=createMessage(formattedMessage,HTML_MIME_TYPE,DEFAULT_MIME_ENCODING,null);
  Contact sourceContact=opSetPersPresence.findContactByID(ev.getFrom());
  if (sourceContact == null) {
    logger.debug("String_Node_Str" + ev.getFrom());
    sourceContact=opSetPersPresence.createVolatileContact(ev.getFrom());
  }
  MessageReceivedEvent msgReceivedEvt=new MessageReceivedEvent(newMessage,sourceContact,new Date());
  fireMessageEvent(msgReceivedEvt);
}
Program: 104160
Project: 104160
Buggy source:
/** 
 * Handler for incoming authorization requests.
 * @param handler an instance of an AuthorizationHandler forauthorization requests coming from other users requesting permission add us to their contact list.
 */
public void setAuthorizationHandler(AuthorizationHandler handler){
  ssContactList.setAuthorizationHandler(handler);
}

Fixed version (ground truth):
/** 
 * Handler for incoming authorization requests.
 * @param handler an instance of an AuthorizationHandler forauthorization requests coming from other users requesting permission add us to their contact list.
 */
public void setAuthorizationHandler(AuthorizationHandler handler){
  ssContactList.setAuthorizationHandler(handler);
  if (earlyEventListener != null) {
    earlyEventListener.processEarlyAuthorizations();
    earlyEventListener=null;
  }
}
Program: 104162
Project: 104162
Buggy source:
/** 
 * Creates a <tt>ChatPanel</tt> which is added to the given chat window.
 * @param chatWindow The parent window of this chat panel.
 */
public ChatPanel(ChatWindow chatWindow){
  super(new BorderLayout());
  this.chatWindow=chatWindow;
  this.conversationPanel=new ChatConversationPanel(this);
  this.sendPanel=new ChatSendPanel(this);
  this.writeMessagePanel=new ChatWritePanel(this);
  this.messagePane.setBorder(null);
  this.messagePane.setOpaque(false);
  this.messagePane.setResizeWeight(1.0D);
  this.writeMessagePanel.setPreferredSize(new Dimension(500,100));
  this.writeMessagePanel.setMinimumSize(new Dimension(500,100));
  this.conversationPanel.setPreferredSize(new Dimension(400,200));
  this.messagePane.setBottomComponent(writeMessagePanel);
  this.add(messagePane,BorderLayout.CENTER);
  this.add(sendPanel,BorderLayout.SOUTH);
  this.addComponentListener(new TabSelectionComponentListener());
}

Fixed version (ground truth):
/** 
 * Creates a <tt>ChatPanel</tt> which is added to the given chat window.
 * @param chatWindow The parent window of this chat panel.
 */
public ChatPanel(ChatWindow chatWindow){
  super(new BorderLayout());
  this.chatWindow=chatWindow;
  this.conversationPanel=new ChatConversationPanel(this);
  this.conversationPanel.setPreferredSize(new Dimension(400,200));
  this.sendPanel=new ChatSendPanel(this);
  this.writeMessagePanel=new ChatWritePanel(this);
  Dimension writeMessagePanelSize=new Dimension(500,100);
  this.writeMessagePanel.setMinimumSize(writeMessagePanelSize);
  this.writeMessagePanel.setPreferredSize(writeMessagePanelSize);
  this.messagePane.setBorder(null);
  this.messagePane.setOpaque(false);
  this.messagePane.setResizeWeight(1.0D);
  this.messagePane.setBottomComponent(writeMessagePanel);
  this.add(messagePane,BorderLayout.CENTER);
  this.add(sendPanel,BorderLayout.SOUTH);
  this.addComponentListener(new TabSelectionComponentListener());
}
Program: 104163
Project: 104163
Buggy source:
public void actionPerformed(ActionEvent e){
  SIPCommMenu contactSelector=transportSelectorBox.getMenu();
  contactSelector.doClick();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  transportSelectorBox.getMenu().doClick();
}
Program: 104165
Project: 104165
Buggy source:
/** 
 * Returns the <tt>ChatContact</tt> corresponding to the given <tt>MetaContact</tt>.
 * @param metaContact the <tt>MetaContact</tt> to search for
 * @return the <tt>ChatContact</tt> corresponding to the given<tt>MetaContact</tt>.
 */
private ChatContact findChatContactByMetaContact(MetaContact metaContact){
  Iterator chatContactsIter=chatParticipants.iterator();
  while (chatContactsIter.hasNext()) {
    ChatContact chatContact=(ChatContact)chatContactsIter.next();
    Object chatSourceContact=chatContact.getDescriptor();
    MetaContact parentMetaContact=GuiActivator.getMetaContactListService().findMetaContactByContact((Contact)chatSourceContact);
    if (parentMetaContact != null && parentMetaContact.equals(metaContact))     return chatContact;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the <tt>ChatContact</tt> corresponding to the given <tt>MetaContact</tt>.
 * @param metaContact the <tt>MetaContact</tt> to search for
 * @return the <tt>ChatContact</tt> corresponding to the given<tt>MetaContact</tt>.
 */
private ChatContact findChatContactByMetaContact(MetaContact metaContact){
  for (  ChatContact chatContact : chatParticipants) {
    Object chatSourceContact=chatContact.getDescriptor();
    MetaContact parentMetaContact=GuiActivator.getMetaContactListService().findMetaContactByContact((Contact)chatSourceContact);
    if (parentMetaContact != null && parentMetaContact.equals(metaContact))     return chatContact;
  }
  return null;
}
Program: 104166
Project: 104166
Buggy source:
/** 
 * Implements <tt>MetaContactListListener.protoContactMoved</tt> method. When a proto contact is moved, updates the "send via" selector box.
 */
public void protoContactMoved(ProtoContactEvent evt){
  MetaContactChatTransport chatTransport=null;
  if (evt.getOldParent().equals(metaContact)) {
    Iterator chatTransportsIter=chatTransports.iterator();
    while (chatTransportsIter.hasNext()) {
      chatTransport=(MetaContactChatTransport)chatTransportsIter.next();
      if (chatTransport.getContact().equals(evt.getProtoContact())) {
        sessionRenderer.removeChatTransport(chatTransport);
        break;
      }
    }
  }
 else   if (evt.getNewParent().equals(metaContact)) {
    chatTransport=new MetaContactChatTransport(this,evt.getProtoContact());
    sessionRenderer.addChatTransport(chatTransport);
  }
}

Fixed version (ground truth):
/** 
 * Implements <tt>MetaContactListListener.protoContactMoved</tt> method. When a proto contact is moved, updates the "send via" selector box.
 */
public void protoContactMoved(ProtoContactEvent evt){
  MetaContactChatTransport chatTransport=null;
  if (evt.getOldParent().equals(metaContact)) {
    protoContactRemoved(evt);
  }
 else   if (evt.getNewParent().equals(metaContact)) {
    chatTransport=new MetaContactChatTransport(this,evt.getProtoContact());
    sessionRenderer.addChatTransport(chatTransport);
  }
}
Program: 104167
Project: 104167
Buggy source:
/** 
 * Returns the ChatTransport corresponding to the given descriptor.
 * @param descriptor The descriptor of the chat transport we're looking for.
 * @return The ChatTransport corresponding to the given descriptor.
 */
public ChatTransport findChatTransportForDescriptor(Object descriptor){
  Iterator<ChatTransport> chatTransportsIter=chatTransports.iterator();
  while (chatTransportsIter.hasNext()) {
    ChatTransport chatTransport=chatTransportsIter.next();
    if (chatTransport.getDescriptor().equals(descriptor))     return chatTransport;
  }
  return null;
}

Fixed version (ground truth):
public static ChatTransport findChatTransportForDescriptor(Iterable<ChatTransport> chatTransports,Object descriptor){
  for (  ChatTransport chatTransport : chatTransports) {
    if (chatTransport.getDescriptor().equals(descriptor))     return chatTransport;
  }
  return null;
}
Program: 104168
Project: 104168
Buggy source:
/** 
 * Returns an iterator to the list of all participants contained in this  chat session.
 * @return an iterator to the list of all participants contained in this chat session.
 */
public Iterator getParticipants(){
  return chatParticipants.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an iterator to the list of all participants contained in this  chat session.
 * @return an iterator to the list of all participants contained in this chat session.
 */
public Iterator<ChatContact> getParticipants(){
  return chatParticipants.iterator();
}
Program: 104169
Project: 104169
Buggy source:
/** 
 * Returns all available chat transports for this chat session. Each chat transport is corresponding to a protocol provider.
 * @return all available chat transports for this chat session.
 */
public Iterator getChatTransports(){
  return chatTransports.iterator();
}

Fixed version (ground truth):
/** 
 * Returns all available chat transports for this chat session. Each chat transport is corresponding to a protocol provider.
 * @return all available chat transports for this chat session.
 */
public Iterator<ChatTransport> getChatTransports(){
  return chatTransports.iterator();
}
Program: 104170
Project: 104170
Buggy source:
/** 
 * Disposes this chat session.
 */
public void dispose(){
  if (metaContactListService != null)   metaContactListService.removeMetaContactListListener(this);
  Iterator<ChatTransport> chatTransportsIter=chatTransports.iterator();
  while (chatTransportsIter.hasNext()) {
    ChatTransport chatTransport=chatTransportsIter.next();
    chatTransport.dispose();
  }
}

Fixed version (ground truth):
/** 
 * Disposes this chat session.
 */
public void dispose(){
  if (metaContactListService != null)   metaContactListService.removeMetaContactListListener(this);
  for (  ChatTransport chatTransport : chatTransports)   chatTransport.dispose();
}
Program: 104171
Project: 104171
Buggy source:
/** 
 * Implements <tt>MetaContactListListener.protoContactRemoved</tt> method. When a proto contact is removed, updates the "send via" selector box.
 */
public void protoContactRemoved(ProtoContactEvent evt){
  if (evt.getOldParent().equals(metaContact)) {
    Iterator chatTransportsIter=chatTransports.iterator();
    MetaContactChatTransport chatTransport=null;
    while (chatTransportsIter.hasNext()) {
      chatTransport=(MetaContactChatTransport)chatTransportsIter.next();
      if (chatTransport.getContact().equals(evt.getProtoContact())) {
        sessionRenderer.removeChatTransport(chatTransport);
        break;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Implements <tt>MetaContactListListener.protoContactRemoved</tt> method. When a proto contact is removed, updates the "send via" selector box.
 */
public void protoContactRemoved(ProtoContactEvent evt){
  if (evt.getOldParent().equals(metaContact)) {
    Contact protoContact=evt.getProtoContact();
    for (    ChatTransport chatTransport : chatTransports) {
      if (((MetaContactChatTransport)chatTransport).getContact().equals(protoContact)) {
        sessionRenderer.removeChatTransport(chatTransport);
        break;
      }
    }
  }
}
Program: 104174
Project: 104174
Buggy source:
/** 
 * Tries to obtain a mapped/public address for the specified port (possibly by executing a STUN query).
 * @param port the port whose mapping we are interested in.
 * @return a public address corresponding to the specified port or nullif all attempts to retrieve such an address have failed.
 * @throws IOException if an error occurs while stun4j is using sockets.
 * @throws BindException if the port is already in use.
 */
public InetSocketAddress getPublicAddressFor(int port) throws IOException, BindException {
  return getPublicAddressFor(this.stunServerAddress.getSocketAddress().getAddress(),port);
}

Fixed version (ground truth):
/** 
 * Tries to obtain a mapped/public address for the specified port (possibly by executing a STUN query).
 * @param dst the destination that we'd like to use this address with.
 * @param port the port whose mapping we are interested in.
 * @return a public address corresponding to the specified port or nullif all attempts to retrieve such an address have failed.
 * @throws IOException if an error occurs while stun4j is using sockets.
 * @throws BindException if the port is already in use.
 */
public InetSocketAddress getPublicAddressFor(InetAddress dst,int port) throws IOException, BindException {
  if (!useStun || (dst instanceof Inet6Address)) {
    logger.debug("String_Node_Str" + dst + "String_Node_Str"+ useStun+ "String_Node_Str"+ (dst instanceof Inet6Address)+ "String_Node_Str");
    DatagramSocket bindTestSocket=new DatagramSocket(port);
    bindTestSocket.close();
    return new InetSocketAddress(getLocalHost(dst),port);
  }
  StunAddress mappedAddress=queryStunServer(port);
  InetSocketAddress result=null;
  if (mappedAddress != null)   result=mappedAddress.getSocketAddress();
 else {
    InetAddress localHost=getLocalHost(dst);
    result=new InetSocketAddress(localHost,port);
  }
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + port + "String_Node_Str"+ result);
  return result;
}
Program: 104175
Project: 104175
Buggy source:
/** 
 * Tries to obtain a mapped/public address for the specified port (possibly by executing a STUN query).
 * @param port the port whose mapping we are interested in.
 * @return a public address corresponding to the specified port or nullif all attempts to retrieve such an address have failed.
 * @throws IOException if an error occurs while stun4j is using sockets.
 * @throws BindException if the port is already in use.
 */
public InetSocketAddress getPublicAddressFor(int port) throws IOException, BindException ;

Fixed version (ground truth):
/** 
 * Tries to obtain a mapped/public address for the specified port. If the STUN lib fails, tries to retrieve localhost, if that fails too, returns null.
 * @param intendedDestination the destination that we'd like to use thisaddress with.
 * @param port the port whose mapping we are interested in.
 * @return a public address corresponding to the specified port or null ifall attempts to retrieve such an address have failed.
 * @throws IOException if an error occurs while the underlying resolve libis using sockets.
 * @throws BindException if the port is already in use.
 */
public InetSocketAddress getPublicAddressFor(InetAddress intendedDestination,int port) throws IOException, BindException ;
Program: 104176
Project: 104176
Buggy source:
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  this.index=index;
  this.photoLabel.setIcon(null);
  ContactList contactList=(ContactList)list;
  ChatContact chatContact=(ChatContact)value;
  this.setPreferredSize(new Dimension(20,30));
  String displayName=chatContact.getName();
  if (displayName == null || displayName.length() < 1) {
    displayName=GuiActivator.getResources().getI18NString("String_Node_Str");
  }
  this.nameLabel.setFont(this.getFont().deriveFont(Font.PLAIN));
  this.nameLabel.setText(displayName);
  if (contactForegroundColor != null)   this.nameLabel.setForeground(contactForegroundColor);
  this.setBorder(BorderFactory.createEmptyBorder(1,5,1,1));
  ImageIcon avatar=chatContact.getAvatar();
  if (avatar != null)   this.photoLabel.setIcon(avatar);
  this.setBounds(0,0,list.getWidth() - 2,30);
  this.nameLabel.setBounds(0,0,list.getWidth() - 28,17);
  this.photoLabel.setBounds(list.getWidth() - 28,0,25,30);
  this.isLeaf=true;
  this.isSelected=isSelected;
  return this;
}

Fixed version (ground truth):
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  this.index=index;
  this.photoLabel.setIcon(null);
  DefaultContactList contactList=(DefaultContactList)list;
  ChatContact chatContact=(ChatContact)value;
  this.setPreferredSize(new Dimension(20,30));
  String displayName=chatContact.getName();
  if (displayName == null || displayName.length() < 1) {
    displayName=GuiActivator.getResources().getI18NString("String_Node_Str");
  }
  this.nameLabel.setFont(this.getFont().deriveFont(Font.PLAIN));
  this.nameLabel.setText(displayName);
  if (contactForegroundColor != null)   this.nameLabel.setForeground(contactForegroundColor);
  this.setBorder(BorderFactory.createEmptyBorder(1,5,1,1));
  ImageIcon avatar=chatContact.getAvatar();
  if (avatar != null)   this.photoLabel.setIcon(avatar);
  this.setBounds(0,0,list.getWidth() - 2,30);
  this.nameLabel.setBounds(0,0,list.getWidth() - 28,17);
  this.photoLabel.setBounds(list.getWidth() - 28,0,25,30);
  this.isLeaf=true;
  this.isSelected=isSelected;
  return this;
}
Program: 104178
Project: 104178
Buggy source:
/** 
 * Creates an instance of <tt>ChatContactListPanel</tt>.
 */
public ChatRoomMemberListPanel(ChatPanel chat){
  super(new BorderLayout());
  this.memberList=new ContactList(GuiActivator.getUIService().getMainFrame());
  this.memberList.setModel(memberListModel);
  this.memberList.setCellRenderer(new ChatContactCellRenderer());
  this.memberList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
  this.memberList.setMouseMotionListener(null);
  this.memberList.setMouseListener(null);
  JScrollPane contactsScrollPane=new JScrollPane();
  contactsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  contactsScrollPane.getViewport().add(memberList);
  contactsScrollPane.getViewport().setOpaque(false);
  contactsScrollPane.setOpaque(false);
  this.add(contactsScrollPane);
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>ChatContactListPanel</tt>.
 */
public ChatRoomMemberListPanel(ChatPanel chat){
  super(new BorderLayout());
  this.memberList=new DefaultContactList();
  this.memberList.setModel(memberListModel);
  this.memberList.setCellRenderer(new ChatContactCellRenderer());
  JScrollPane contactsScrollPane=new JScrollPane();
  contactsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  contactsScrollPane.getViewport().add(memberList);
  contactsScrollPane.getViewport().setOpaque(false);
  contactsScrollPane.setOpaque(false);
  this.add(contactsScrollPane);
}
Program: 104179
Project: 104179
Buggy source:
BanParticipantThread(ChatRoom chatRoom,String reason){
  this.chatRoom=chatRoom;
}

Fixed version (ground truth):
BanParticipantThread(ChatRoom chatRoom,String reason){
  this.chatRoom=chatRoom;
  this.reason=reason;
}
Program: 104180
Project: 104180
Buggy source:
public void run(){
  try {
    chatRoom.banParticipant((ChatRoomMember)chatContact.getDescriptor(),reason);
  }
 catch (  OperationFailedException e) {
    logger.error("String_Node_Str",e);
    String errorTitle=GuiActivator.getResources().getI18NString("String_Node_Str");
    if (e.getErrorCode() == OperationFailedException.NOT_ENOUGH_PRIVILEGES) {
      new ErrorDialog(chatPanel.getChatWindow(),errorTitle,GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{chatContact.getName()}),e).showDialog();
    }
 else     if (e.getErrorCode() == OperationFailedException.FORBIDDEN) {
      new ErrorDialog(chatPanel.getChatWindow(),errorTitle,GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{chatContact.getName()}),e).showDialog();
    }
 else {
      new ErrorDialog(chatPanel.getChatWindow(),errorTitle,GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{chatContact.getName()}),e).showDialog();
    }
  }
}

Fixed version (ground truth):
public void run(){
  try {
    chatRoom.banParticipant((ChatRoomMember)chatContact.getDescriptor(),reason);
  }
 catch (  OperationFailedException e) {
    logger.error("String_Node_Str",e);
    String errorTitle=GuiActivator.getResources().getI18NString("String_Node_Str");
    String errorMessageKey;
switch (e.getErrorCode()) {
case OperationFailedException.NOT_ENOUGH_PRIVILEGES:
      errorMessageKey="String_Node_Str";
    break;
case OperationFailedException.FORBIDDEN:
  errorMessageKey="String_Node_Str";
break;
default :
errorMessageKey="String_Node_Str";
break;
}
new ErrorDialog(chatPanel.getChatWindow(),errorTitle,GuiActivator.getResources().getI18NString(errorMessageKey,new String[]{chatContact.getName()}),e).showDialog();
}
}
Program: 104184
Project: 104184
Buggy source:
/** 
 * Enables or disables the "Next" wizard button according to whether the User ID field is empty.
 */
private void setNextButtonAccordingToUserID(){
  if (nickField.getText() == null || nickField.getText().equals("String_Node_Str") || serverField.getText() == null || serverField.getText().equals("String_Node_Str") || (!passwordNotRequired.isSelected() && passField.equals("String_Node_Str"))) {
    wizard.getWizardContainer().setNextFinishButtonEnabled(false);
  }
 else {
    wizard.getWizardContainer().setNextFinishButtonEnabled(true);
  }
}

Fixed version (ground truth):
/** 
 * Enables or disables the "Next" wizard button according to whether the User ID field is empty.
 */
private void setNextButtonAccordingToUserID(){
  if (nickField.getText() == null || nickField.getText().equals("String_Node_Str") || serverField.getText() == null || serverField.getText().equals("String_Node_Str") || (!passwordNotRequired.isSelected() && passField.getText().equals("String_Node_Str"))) {
    wizard.getWizardContainer().setNextFinishButtonEnabled(false);
  }
 else {
    wizard.getWizardContainer().setNextFinishButtonEnabled(true);
  }
}
Program: 104185
Project: 104185
Buggy source:
/** 
 * Replacing the characters that we must escape used for the created filename.
 * @param ids Ids - folder names as we are using FileSystem for storing files.
 */
private void escapeCharacters(String[] ids){
  for (int i=0; i < ids.length; i++) {
    String currId=ids[i];
    for (int j=0; j < ESCAPE_SEQUENCES.length; j++) {
      currId=currId.replaceAll(ESCAPE_SEQUENCES[j][0],ESCAPE_SEQUENCES[j][1]);
    }
    ids[i]=currId;
  }
}

Fixed version (ground truth):
/** 
 * Replacing the characters that we must escape used for the created filename.
 * @param ids Ids - folder names as we are usingFileSystem for storing files.
 */
private void escapeCharacters(String[] ids){
  for (int i=0; i < ids.length; i++) {
    String currId=ids[i];
    for (int j=0; j < ESCAPE_SEQUENCES.length; j++) {
      currId=currId.replaceAll(ESCAPE_SEQUENCES[j][0],ESCAPE_SEQUENCES[j][1]);
    }
    ids[i]=currId;
  }
}
Program: 104186
Project: 104186
Buggy source:
/** 
 * Returns the history by specified local and remote contact if one of them is null the default is used
 * @param localContact Contact
 * @param remoteContact Contact
 * @return History
 * @throws IOException
 */
private History getHistory(Contact localContact,Contact remoteContact) throws IOException {
  History retVal=null;
  String localId=localContact == null ? "String_Node_Str" : localContact.getAddress();
  String remoteId=remoteContact == null ? "String_Node_Str" : remoteContact.getAddress();
  HistoryID historyId=HistoryID.createFromRawID(new String[]{"String_Node_Str",localId,remoteId});
  if (this.historyService.isHistoryExisting(historyId)) {
    retVal=this.historyService.getHistory(historyId);
  }
 else {
    retVal=this.historyService.createHistory(historyId,recordStructure);
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Returns the history by specified local and remote contact if one of them is null the default is used
 * @param localContact Contact
 * @param remoteContact Contact
 * @return History
 * @throws IOException
 */
private History getHistory(Contact localContact,Contact remoteContact) throws IOException {
  History retVal=null;
  String localId=localContact == null ? "String_Node_Str" : localContact.getAddress();
  String remoteId=remoteContact == null ? "String_Node_Str" : remoteContact.getAddress();
  String account=remoteContact.getProtocolProvider().getAccountID().getAccountUniqueID();
  HistoryID historyId=HistoryID.createFromRawID(new String[]{"String_Node_Str",localId,account,remoteId});
  if (!this.historyService.isHistoryCreated(historyId)) {
    HistoryID historyId_old=HistoryID.createFromRawID(new String[]{"String_Node_Str",localId,remoteId});
    if (this.historyService.isHistoryCreated(historyId_old)) {
      try {
        this.historyService.moveHistory(historyId_old,historyId);
      }
 catch (      IOException iOException) {
        historyId=historyId_old;
      }
    }
  }
  if (this.historyService.isHistoryExisting(historyId)) {
    retVal=this.historyService.getHistory(historyId);
  }
 else {
    retVal=this.historyService.createHistory(historyId,recordStructure);
  }
  return retVal;
}
Program: 104187
Project: 104187
Buggy source:
/** 
 * Returns the IDs of all existing histories.
 * @return An iterator to a list of IDs.
 */
Iterator<HistoryID> getExistingIDs();

Fixed version (ground truth):
/** 
 * Returns the IDs of all existing histories.
 * @return An iterator to a list of IDs.
 */
public Iterator<HistoryID> getExistingIDs();
Program: 104188
Project: 104188
Buggy source:
/** 
 * Returns the history associated with this ID.
 * @param id The ID of the history.
 * @return Returns the history with this ID.
 * @throws IllegalArgumentException Thrown if there is no such history.
 */
History getHistory(HistoryID id) throws IllegalArgumentException ;

Fixed version (ground truth):
/** 
 * Returns the history associated with this ID.
 * @param id The ID of the history.
 * @return Returns the history with this ID.
 * @throws IllegalArgumentException Thrown if there is no such history.
 */
public History getHistory(HistoryID id) throws IllegalArgumentException ;
Program: 104189
Project: 104189
Buggy source:
/** 
 * Tests if a history with the given ID exists.
 * @param id The ID to test.
 * @return True if a history with this ID exists. False otherwise.
 */
boolean isHistoryExisting(HistoryID id);

Fixed version (ground truth):
/** 
 * Tests if a history with the given ID exists and is loaded.
 * @param id The ID to test.
 * @return True if a history with this ID exists. False otherwise.
 */
public boolean isHistoryExisting(HistoryID id);
Program: 104190
Project: 104190
Buggy source:
/** 
 * Creates a new history for this ID.
 * @param id The ID of the history to be created.
 * @param recordStructure The structure of the data.
 * @return Returns the history with this ID.
 * @throws IllegalArgumentException Thrown if such history already exists.
 * @throws IOException Thrown if the history could not be created due to a IO error.
 */
History createHistory(HistoryID id,HistoryRecordStructure recordStructure) throws IllegalArgumentException, IOException ;

Fixed version (ground truth):
/** 
 * Creates a new history for this ID.
 * @param id The ID of the history to be created.
 * @param recordStructure The structure of the data.
 * @return Returns the history with this ID.
 * @throws IllegalArgumentException Thrown if such history already exists.
 * @throws IOException Thrown if the history could not be created due to a IO error.
 */
public History createHistory(HistoryID id,HistoryRecordStructure recordStructure) throws IllegalArgumentException, IOException ;
Program: 104192
Project: 104192
Buggy source:
/** 
 * Creates a rounded corner scaled image.
 * @param imageBytes The bytes of the image to be scaled.
 * @param width The maximum width of the scaled image.
 * @param height The maximum height of the scaled image.
 * @return The rounded corner scaled image.
 */
public static ImageIcon getScaledRoundedImage(byte[] imageBytes,int width,int height){
  if (imageBytes == null || !(imageBytes.length > 0))   return null;
  ImageIcon imageIcon=null;
  try {
    InputStream in=new ByteArrayInputStream(imageBytes);
    BufferedImage image=ImageIO.read(in);
    imageIcon=getScaledRoundedIcon(image,width,height);
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str",e);
  }
  return imageIcon;
}

Fixed version (ground truth):
/** 
 * Creates a rounded corner scaled image.
 * @param imageBytes The bytes of the image to be scaled.
 * @param width The maximum width of the scaled image.
 * @param height The maximum height of the scaled image.
 * @return The rounded corner scaled image.
 */
public static ImageIcon getScaledRoundedImage(byte[] imageBytes,int width,int height){
  if (imageBytes == null || !(imageBytes.length > 0))   return null;
  ImageIcon imageIcon=null;
  try {
    InputStream in=new ByteArrayInputStream(imageBytes);
    BufferedImage image=ImageIO.read(in);
    if (image != null)     imageIcon=getScaledRoundedIcon(image,width,height);
 else     logger.trace("String_Node_Str");
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str",e);
  }
  return imageIcon;
}
Program: 104194
Project: 104194
Buggy source:
public void actionPerformed(ActionEvent event){
  Object selection=comboBox.getSelectedItem();
  CaptureDeviceInfo device=null;
  if (selection instanceof DeviceConfigurationComboBoxModel.CaptureDevice) {
    device=((DeviceConfigurationComboBoxModel.CaptureDevice)selection).info;
  }
  createPreview(device,preview);
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent event){
  Object selection=comboBox.getSelectedItem();
  CaptureDeviceInfo device=null;
  if (selection instanceof DeviceConfigurationComboBoxModel.CaptureDevice)   device=((DeviceConfigurationComboBoxModel.CaptureDevice)selection).info;
  if ((device != null) && device.equals(videoDeviceInPreview))   return;
  Exception exception;
  try {
    createPreview(device,preview);
    exception=null;
  }
 catch (  IOException ex) {
    exception=ex;
  }
catch (  MediaException ex) {
    exception=ex;
  }
  if (exception != null) {
    logger.error("String_Node_Str" + device,exception);
    device=null;
  }
  videoDeviceInPreview=device;
}
Program: 104195
Project: 104195
Buggy source:
private void disposePlayer(Player player){
  player.stop();
  player.deallocate();
  player.close();
}

Fixed version (ground truth):
private void disposePlayer(Player player){
  player.stop();
  player.deallocate();
  player.close();
  if ((videoPlayerInPreview != null) && videoPlayerInPreview.equals(player))   videoPlayerInPreview=null;
}
Program: 104196
Project: 104196
Buggy source:
public void dispose(){
  if (windowListener != null) {
    if (window != null) {
      window.removeWindowListener(windowListener);
      window=null;
    }
    windowListener=null;
  }
  preview.removeHierarchyListener(this);
  disposePlayer(player);
}

Fixed version (ground truth):
public void dispose(){
  if (windowListener != null) {
    if (window != null) {
      window.removeWindowListener(windowListener);
      window=null;
    }
    windowListener=null;
  }
  preview.removeHierarchyListener(this);
  disposePlayer(player);
  videoDeviceInPreview=null;
}
Program: 104197
Project: 104197
Buggy source:
private Component createPreview(int type,final JComboBox comboBox){
  final Container preview;
  if (type == DeviceConfigurationComboBoxModel.VIDEO) {
    JLabel noPreview=new JLabel(MediaActivator.getResources().getI18NString("String_Node_Str"));
    noPreview.setHorizontalAlignment(SwingConstants.CENTER);
    noPreview.setVerticalAlignment(SwingConstants.CENTER);
    preview=createVideoContainer(noPreview);
    ActionListener comboBoxListener=new ActionListener(){
      public void actionPerformed(      ActionEvent event){
        Object selection=comboBox.getSelectedItem();
        CaptureDeviceInfo device=null;
        if (selection instanceof DeviceConfigurationComboBoxModel.CaptureDevice) {
          device=((DeviceConfigurationComboBoxModel.CaptureDevice)selection).info;
        }
        createPreview(device,preview);
      }
    }
;
    comboBox.addActionListener(comboBoxListener);
    comboBoxListener.actionPerformed(null);
  }
 else   preview=new TransparentPanel();
  return preview;
}

Fixed version (ground truth):
private Component createPreview(int type,final JComboBox comboBox){
  final Container preview;
  if (type == DeviceConfigurationComboBoxModel.VIDEO) {
    JLabel noPreview=new JLabel(MediaActivator.getResources().getI18NString("String_Node_Str"));
    noPreview.setHorizontalAlignment(SwingConstants.CENTER);
    noPreview.setVerticalAlignment(SwingConstants.CENTER);
    preview=createVideoContainer(noPreview);
    final ActionListener comboBoxListener=new ActionListener(){
      public void actionPerformed(      ActionEvent event){
        Object selection=comboBox.getSelectedItem();
        CaptureDeviceInfo device=null;
        if (selection instanceof DeviceConfigurationComboBoxModel.CaptureDevice)         device=((DeviceConfigurationComboBoxModel.CaptureDevice)selection).info;
        if ((device != null) && device.equals(videoDeviceInPreview))         return;
        Exception exception;
        try {
          createPreview(device,preview);
          exception=null;
        }
 catch (        IOException ex) {
          exception=ex;
        }
catch (        MediaException ex) {
          exception=ex;
        }
        if (exception != null) {
          logger.error("String_Node_Str" + device,exception);
          device=null;
        }
        videoDeviceInPreview=device;
      }
    }
;
    comboBox.addActionListener(comboBoxListener);
    comboBox.addHierarchyListener(new HierarchyListener(){
      public void hierarchyChanged(      HierarchyEvent event){
        if (((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) && comboBox.isDisplayable())         comboBoxListener.actionPerformed(null);
      }
    }
);
  }
 else   preview=new TransparentPanel();
  return preview;
}
Program: 104198
Project: 104198
Buggy source:
/** 
 * Removes <tt>listener</tt> from the list of listeneres current registered for chat room modification events.
 * @param listener the <tt>ChatRoomChangeListener</tt> to remove.
 */
public void removePropertyChangeListener(PropertyChangeListener listener){
synchronized (propertyChangeListeners) {
    propertyChangeListeners.remove(listener);
  }
}

Fixed version (ground truth):
public void removePropertyChangeListener(PropertyChangeListener listener){
synchronized (propertyChangeListeners) {
    propertyChangeListeners.remove(listener);
  }
}
Program: 104199
Project: 104199
Buggy source:
/** 
 * Adds <tt>listener</tt> to the list of listeners registered to receive events upon modification of chat room properties such as its subject for example.
 * @param listener the <tt>ChatRoomChangeListener</tt> that is to beregistered for <tt>ChatRoomChangeEvent</tt>-s.
 */
public void addPropertyChangeListener(PropertyChangeListener listener){
synchronized (propertyChangeListeners) {
    if (!propertyChangeListeners.contains(listener))     propertyChangeListeners.add(listener);
  }
}

Fixed version (ground truth):
public void addPropertyChangeListener(PropertyChangeListener listener){
synchronized (propertyChangeListeners) {
    if (!propertyChangeListeners.contains(listener))     propertyChangeListeners.add(listener);
  }
}
Program: 104200
Project: 104200
Buggy source:
@Override protected void close(boolean isEscaped){
}

Fixed version (ground truth):
/** 
 * Reinitialize the newAccountDialog, when the window is closed.
 */
protected void close(boolean isEscaped){
  newAccountDialog=null;
}
Program: 104201
Project: 104201
Buggy source:
public void actionPerformed(ActionEvent arg0){
  NewAccountDialog newAccountDialog=new NewAccountDialog();
  newAccountDialog.pack();
  newAccountDialog.setVisible(true);
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent arg0){
  NewAccountDialog.showNewAccountDialog();
}
Program: 104202
Project: 104202
Buggy source:
/** 
 * Creates and initializes the <tt>SelectAccountPanel</tt>.
 * @param newContact An object that collects all user choices through thewizard.
 * @param protocolProvidersList The list of available<tt>ProtocolProviderServices</tt>, from which the user could select.
 */
public SelectAccountPanel(NewContact newContact,Iterator<ProtocolProviderService> protocolProvidersList){
  super(new BorderLayout());
  this.newContact=newContact;
  this.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  this.setPreferredSize(new Dimension(500,200));
  this.iconLabel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  this.infoLabel.setEditable(false);
  this.infoTitleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD,18));
  this.labelsPanel.add(infoTitleLabel);
  this.labelsPanel.add(infoLabel);
  this.rightPanel.add(labelsPanel,BorderLayout.NORTH);
  this.rightPanel.add(tablePane,BorderLayout.CENTER);
  this.rightPanel.add(buttonPanel,BorderLayout.SOUTH);
  this.buttonPanel.add(addAccountButton);
  this.addAccountButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      NewAccountDialog newAccountDialog=new NewAccountDialog();
      newAccountDialog.pack();
      newAccountDialog.setVisible(true);
    }
  }
);
  this.add(iconLabel,BorderLayout.WEST);
  this.rightPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  this.add(rightPanel,BorderLayout.CENTER);
  this.tableInit(protocolProvidersList);
  GuiActivator.bundleContext.addServiceListener(this);
}

Fixed version (ground truth):
/** 
 * Creates and initializes the <tt>SelectAccountPanel</tt>.
 * @param newContact An object that collects all user choices through thewizard.
 * @param protocolProvidersList The list of available<tt>ProtocolProviderServices</tt>, from which the user could select.
 */
public SelectAccountPanel(NewContact newContact,Iterator<ProtocolProviderService> protocolProvidersList){
  super(new BorderLayout());
  this.newContact=newContact;
  this.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  this.setPreferredSize(new Dimension(500,200));
  this.iconLabel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  this.infoLabel.setEditable(false);
  this.infoTitleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD,18));
  this.labelsPanel.add(infoTitleLabel);
  this.labelsPanel.add(infoLabel);
  this.rightPanel.add(labelsPanel,BorderLayout.NORTH);
  this.rightPanel.add(tablePane,BorderLayout.CENTER);
  this.rightPanel.add(buttonPanel,BorderLayout.SOUTH);
  this.buttonPanel.add(addAccountButton);
  this.addAccountButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      NewAccountDialog.showNewAccountDialog();
    }
  }
);
  this.add(iconLabel,BorderLayout.WEST);
  this.rightPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  this.add(rightPanel,BorderLayout.CENTER);
  this.tableInit(protocolProvidersList);
  GuiActivator.bundleContext.addServiceListener(this);
}
Program: 104203
Project: 104203
Buggy source:
/** 
 * Handles the <tt>ActionEvent</tt> when one of the menu items is selected.
 */
public void actionPerformed(ActionEvent e){
  JMenuItem menuItem=(JMenuItem)e.getSource();
  String itemName=menuItem.getName();
  if (itemName.equals("String_Node_Str")) {
    NewAccountDialog dialog=new NewAccountDialog();
    dialog.setVisible(true);
  }
 else   if (itemName.equals("String_Node_Str")) {
    AddContactWizard wizard=new AddContactWizard(parentWindow);
    wizard.showDialog(false);
  }
 else   if (itemName.equals("String_Node_Str")) {
    CreateGroupDialog dialog=new CreateGroupDialog(parentWindow);
    dialog.setVisible(true);
  }
 else   if (itemName.equals("String_Node_Str")) {
    closeActionPerformed();
  }
 else   if (itemName.equals("String_Node_Str")) {
    ChatRoomListDialog chatRoomsDialog=new ChatRoomListDialog(parentWindow);
    chatRoomsDialog.setPreferredSize(new Dimension(500,400));
    chatRoomsDialog.setVisible(true);
  }
}

Fixed version (ground truth):
/** 
 * Handles the <tt>ActionEvent</tt> when one of the menu items is selected.
 */
public void actionPerformed(ActionEvent e){
  JMenuItem menuItem=(JMenuItem)e.getSource();
  String itemName=menuItem.getName();
  if (itemName.equals("String_Node_Str")) {
    NewAccountDialog.showNewAccountDialog();
  }
 else   if (itemName.equals("String_Node_Str")) {
    AddContactWizard wizard=new AddContactWizard(parentWindow);
    wizard.showDialog(false);
  }
 else   if (itemName.equals("String_Node_Str")) {
    CreateGroupDialog dialog=new CreateGroupDialog(parentWindow);
    dialog.setVisible(true);
  }
 else   if (itemName.equals("String_Node_Str")) {
    closeActionPerformed();
  }
 else   if (itemName.equals("String_Node_Str")) {
    ChatRoomListDialog chatRoomsDialog=new ChatRoomListDialog(parentWindow);
    chatRoomsDialog.setPreferredSize(new Dimension(500,400));
    chatRoomsDialog.setVisible(true);
  }
}
Program: 104204
Project: 104204
Buggy source:
public int compare(String encoding0,String encoding1){
  if (encodingConfiguration.getPriority(encoding0) > encodingConfiguration.getPriority(encoding1))   return -1;
  return encoding0.compareTo(encoding1);
}

Fixed version (ground truth):
public int compare(String encoding0,String encoding1){
  return encodingConfiguration.getPriority(encoding1) - encodingConfiguration.getPriority(encoding0);
}
Program: 104205
Project: 104205
Buggy source:
private String[] getEncodings(){
  if (encodings != null)   return encodings;
  String[] availableEncodings;
switch (type) {
case AUDIO:
    availableEncodings=encodingConfiguration.getAvailableAudioEncodings();
  break;
case VIDEO:
availableEncodings=encodingConfiguration.getAvailableVideoEncodings();
break;
default :
throw new IllegalStateException("String_Node_Str");
}
final int encodingCount=availableEncodings.length;
if (encodingCount < 1) encodings=NO_ENCODINGS;
 else {
encodings=new String[encodingCount];
System.arraycopy(availableEncodings,0,encodings,0,encodingCount);
Arrays.sort(encodings,0,encodingCount,new Comparator<String>(){
public int compare(String encoding0,String encoding1){
if (encodingConfiguration.getPriority(encoding0) > encodingConfiguration.getPriority(encoding1)) return -1;
return encoding0.compareTo(encoding1);
}
}
);
}
return encodings;
}

Fixed version (ground truth):
private String[] getEncodings(){
  if (encodings != null)   return encodings;
  String[] availableEncodings;
switch (type) {
case AUDIO:
    availableEncodings=encodingConfiguration.getAvailableAudioEncodings();
  break;
case VIDEO:
availableEncodings=encodingConfiguration.getAvailableVideoEncodings();
break;
default :
throw new IllegalStateException("String_Node_Str");
}
final int encodingCount=availableEncodings.length;
if (encodingCount < 1) encodings=NO_ENCODINGS;
 else {
encodings=new String[encodingCount];
System.arraycopy(availableEncodings,0,encodings,0,encodingCount);
Arrays.sort(encodings,0,encodingCount,new Comparator<String>(){
public int compare(String encoding0,String encoding1){
return encodingConfiguration.getPriority(encoding1) - encodingConfiguration.getPriority(encoding0);
}
}
);
}
return encodings;
}
Program: 104206
Project: 104206
Buggy source:
/** 
 * Informs all <tt>ChatFocusListener</tt>s that a <tt>ChatFocusEvent</tt> has been triggered.
 * @param eventID the type of the <tt>ChatFocusEvent</tt>
 */
private void fireChatFocusEvent(int eventID){
  ChatFocusEvent evt=new ChatFocusEvent(this,eventID);
  logger.trace("String_Node_Str" + evt);
  Iterable<ChatFocusListener> listeners;
synchronized (focusListeners) {
    listeners=new ArrayList<ChatFocusListener>(focusListeners);
  }
  for (  ChatFocusListener listener : listeners) {
switch (evt.getEventID()) {
case ChatFocusEvent.FOCUS_GAINED:
      listener.chatFocusGained(evt);
    break;
case ChatFocusEvent.FOCUS_LOST:
  listener.chatFocusLost(evt);
break;
default :
logger.error("String_Node_Str" + evt.getEventID());
}
}
}

Fixed version (ground truth):
/** 
 * Informs all <tt>ChatFocusListener</tt>s that a <tt>ChatFocusEvent</tt> has been triggered.
 * @param eventID the type of the <tt>ChatFocusEvent</tt>
 */
public void fireChatFocusEvent(int eventID){
  ChatFocusEvent evt=new ChatFocusEvent(this,eventID);
  logger.trace("String_Node_Str" + evt);
  Iterable<ChatFocusListener> listeners;
synchronized (focusListeners) {
    listeners=new ArrayList<ChatFocusListener>(focusListeners);
  }
  for (  ChatFocusListener listener : listeners) {
switch (evt.getEventID()) {
case ChatFocusEvent.FOCUS_GAINED:
      listener.chatFocusGained(evt);
    break;
case ChatFocusEvent.FOCUS_LOST:
  listener.chatFocusLost(evt);
break;
default :
logger.error("String_Node_Str" + evt.getEventID());
}
}
}
Program: 104207
Project: 104207
Buggy source:
public void dispose(){
  keyboardFocusManager.removePropertyChangeListener(propertyName,this);
}

Fixed version (ground truth):
/** 
 * Runs clean-up for associated resources which need explicit disposal (e.g. listeners keeping this instance alive because they were added to the model which operationally outlives this instance).
 */
public void dispose(){
  writeMessagePanel.dispose();
  chatSession.dispose();
}
Program: 104209
Project: 104209
Buggy source:
/** 
 * Disposes the chat window.
 */
private void disposeChatWindow(ChatWindow chatWindow){
  for (  ChatPanel chatPanel : chatPanels)   chatPanel.dispose();
synchronized (chatPanels) {
    chatPanels.clear();
  }
  if (chatWindow.getChatCount() > 0)   chatWindow.removeAllChats();
  GuiActivator.getUIService().unregisterExportedWindow(chatWindow);
  chatWindow.dispose();
  ContactList clist=GuiActivator.getUIService().getMainFrame().getContactListPanel().getContactList();
  clist.removeAllActiveContacts();
  clist.refreshAll();
}

Fixed version (ground truth):
/** 
 * Disposes the chat window.
 */
private void disposeChatWindow(ChatWindow chatWindow){
  for (  ChatPanel chatPanel : chatPanels)   chatPanel.dispose();
synchronized (chatPanels) {
    chatPanels.clear();
  }
  if (chatWindow.getChatCount() > 0)   chatWindow.removeAllChats();
  GuiActivator.getUIService().unregisterExportedWindow(chatWindow);
  chatWindow.dispose();
  ContactList clist=GuiActivator.getUIService().getMainFrame().getContactListPanel().getContactList();
  clist.removeAllActiveContacts();
}
Program: 104210
Project: 104210
Buggy source:
/** 
 * Removes all contacts from the list of active contacts.
 */
public void removeAllActiveContacts(){
synchronized (activeContacts) {
    if (activeContacts.size() > 0) {
      this.activeContacts.removeAllElements();
      GuiActivator.getSystrayService().setSystrayIcon(SystrayService.SC_IMG_TYPE);
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes all contacts from the list of active contacts.
 */
public void removeAllActiveContacts(){
synchronized (activeContacts) {
    if (activeContacts.size() > 0) {
      this.activeContacts.removeAllElements();
      GuiActivator.getSystrayService().setSystrayIcon(SystrayService.SC_IMG_TYPE);
    }
  }
  this.refreshAll();
}