nus-yam/ex-repair huggingface dataset:
Program: 94964
Project: 94964
Buggy source:
public void dispose(){
  toolkit.dispose();
  redColor.dispose();
  blueColor.dispose();
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  redColor.dispose();
  blueColor.dispose();
  super.dispose();
}
Program: 94966
Project: 94966
Buggy source:
private void addListeners(){
  inputText.addKeyListener(new KeyAdapter(){
    public void keyPressed(    KeyEvent e){
switch (e.keyCode) {
case SWT.CR:
case SWT.KEYPAD_CR:
        if (e.stateMask == 0) {
          String text=inputText.getText();
          inputText.setText("String_Node_Str");
          try {
            if (!text.equals("String_Node_Str")) {
              icms.sendChatMessage(remoteID,text);
            }
            append(localID,text);
          }
 catch (          ECFException ex) {
            form.setMessage(NLS.bind(Messages.MessagesView_CouldNotSendMessage,text),IMessageProvider.ERROR);
          }
          e.doit=false;
          sendTyping=false;
        }
      break;
  }
}
}
);
inputText.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e){
  if (!sendTyping && itms != null) {
    sendTyping=true;
    try {
      itms.sendTypingMessage(remoteID,true,null);
    }
 catch (    ECFException ex) {
      return;
    }
  }
}
}
);
}

Fixed version (ground truth):
private void addListeners(){
  inputText.addKeyListener(new KeyAdapter(){
    public void keyPressed(    KeyEvent e){
switch (e.keyCode) {
case SWT.CR:
case SWT.KEYPAD_CR:
        if (e.stateMask == 0) {
          String text=inputText.getText();
          inputText.setText("String_Node_Str");
          try {
            if (!text.equals("String_Node_Str")) {
              icms.sendChatMessage(remoteID,text);
            }
            append(localID,text);
          }
 catch (          ECFException ex) {
            notificationLabel.setText(Messages.MessagesView_CouldNotSendMessage);
          }
          e.doit=false;
          sendTyping=false;
        }
      break;
  }
}
}
);
inputText.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e){
  if (!sendTyping && itms != null) {
    sendTyping=true;
    try {
      itms.sendTypingMessage(remoteID,true,null);
    }
 catch (    ECFException ex) {
      return;
    }
  }
}
}
);
}
Program: 94967
Project: 94967
Buggy source:
public MessagesView(){
  menuManagers=new ArrayList();
  switchActions=new ArrayList();
  tabs=new HashMap();
}

Fixed version (ground truth):
public MessagesView(){
  tabs=new HashMap();
}
Program: 94969
Project: 94969
Buggy source:
public void disconnect(){
  ID groupID=getConnectedID();
  fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (getConnectLock()) {
    if (isConnected()) {
      try {
        multiuserchat.leave();
      }
 catch (      Exception e) {
        traceStack("String_Node_Str",e);
      }
    }
    connectionState=DISCONNECTED;
    remoteServerID=null;
    containerHelper.setRoomID(null);
    this.connection=null;
  }
  fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
}

Fixed version (ground truth):
public void disconnect(){
  ID groupID=getConnectedID();
  fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (getConnectLock()) {
    if (isConnected()) {
      try {
        multiuserchat.leave();
      }
 catch (      Exception e) {
        traceStack("String_Node_Str",e);
      }
    }
    connectionState=DISCONNECTED;
    remoteServerID=null;
    if (containerHelper != null)     containerHelper.setRoomID(null);
    this.connection=null;
  }
  fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
}
Program: 94970
Project: 94970
Buggy source:
public ContainerCreateErrorDialog(Shell parentShell,Throwable exception){
  super(parentShell,Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_TITLE,Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_MESSAGE,new MultiStatus(Activator.PLUGIN_ID,IStatus.ERROR,new IStatus[]{new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,(exception != null) ? exception.getLocalizedMessage() : Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_MESSAGE,exception)},(exception != null) ? exception.getLocalizedMessage() : Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_MESSAGE,exception),IStatus.ERROR);
}

Fixed version (ground truth):
public ContainerCreateErrorDialog(Shell parentShell,Throwable exception){
  super(parentShell,Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_TITLE,Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_MESSAGE,new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,(exception != null) ? exception.getLocalizedMessage() : Messages.ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_MESSAGE,exception),IStatus.ERROR);
}
Program: 94971
Project: 94971
Buggy source:
protected ID handleConnectResponse(ID orginalTarget,Object serverData) throws Exception {
  ContainerMessage aPacket=(ContainerMessage)serverData;
  ID fromID=aPacket.getFromContainerID();
  if (fromID == null)   throw new NullPointerException(Messages.ClientSOContainer_ServerID_Cannot_Be_Null);
  ContainerMessage.ViewChangeMessage viewChangeMessage=(ContainerMessage.ViewChangeMessage)aPacket.getData();
  if (!viewChangeMessage.isAdd()) {
    Object data=viewChangeMessage.getData();
    if (data != null && data instanceof Exception)     throw (Exception)data;
 else     throw new NullPointerException(Messages.ClientSOContainer_Invalid_Server_Response);
  }
  ID[] ids=viewChangeMessage.getChangeIDs();
  if (ids == null)   throw new NullPointerException(Messages.ClientSOContainer_Exception_ID_Array_Null);
  for (int i=0; i < ids.length; i++) {
    ID id=ids[i];
    if (id != null && !id.equals(getID())) {
      addNewRemoteMember(id,null);
      fireContainerEvent(new ContainerConnectedEvent(this.getID(),id));
    }
  }
  return fromID;
}

Fixed version (ground truth):
protected ID handleConnectResponse(ID orginalTarget,Object serverData) throws Exception {
  ContainerMessage aPacket=(ContainerMessage)serverData;
  ID fromID=aPacket.getFromContainerID();
  Assert.isNotNull(fromID,Messages.ClientSOContainer_ServerID_Cannot_Be_Null);
  ContainerMessage.ViewChangeMessage viewChangeMessage=(ContainerMessage.ViewChangeMessage)aPacket.getData();
  if (!viewChangeMessage.isAdd()) {
    Object data=viewChangeMessage.getData();
    if (data != null && data instanceof Exception)     throw (Exception)data;
 else     throw new NullPointerException(Messages.ClientSOContainer_Invalid_Server_Response);
  }
  ID[] ids=viewChangeMessage.getChangeIDs();
  Assert.isNotNull(ids,Messages.ClientSOContainer_Exception_ID_Array_Null);
  for (int i=0; i < ids.length; i++) {
    ID id=ids[i];
    if (id != null && !id.equals(getID()))     addNewRemoteMember(id,null);
  }
  return fromID;
}
Program: 94973
Project: 94973
Buggy source:
public DebugOptions getDebugOptions(){
  if (debugOptionsTracker == null) {
    debugOptionsTracker=new ServiceTracker(context,DebugOptions.class.getName(),null);
    debugOptionsTracker.open();
  }
  return (DebugOptions)debugOptionsTracker.getService();
}

Fixed version (ground truth):
public DebugOptions getDebugOptions(){
  if (context == null)   return null;
  if (debugOptionsTracker == null) {
    debugOptionsTracker=new ServiceTracker(context,DebugOptions.class.getName(),null);
    debugOptionsTracker.open();
  }
  return (DebugOptions)debugOptionsTracker.getService();
}
Program: 94974
Project: 94974
Buggy source:
public void handleRosterUpdate(final IRoster roster,final IRosterItem changedValue){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      MultiRosterAccount.this.multiRosterView.refreshTreeViewer(changedValue,true);
    }
  }
);
}

Fixed version (ground truth):
public void handleRosterUpdate(final IRoster roster,final IRosterItem changedValue){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      MultiRosterAccount.this.multiRosterView.refreshTreeViewer(changedValue,true);
    }
  }
);
}
Program: 94975
Project: 94975
Buggy source:
private void removeItemFromRosterGroup(org.eclipse.ecf.presence.roster.RosterGroup group,XMPPID itemIDToRemove){
  for (Iterator i=group.getEntries().iterator(); i.hasNext(); ) {
    org.eclipse.ecf.presence.roster.RosterEntry entry=(org.eclipse.ecf.presence.roster.RosterEntry)i.next();
    if (entry.getUser().getID().equals(itemIDToRemove)) {
      group.remove(entry);
      rosterManager.notifyRosterUpdate(group);
    }
  }
}

Fixed version (ground truth):
private boolean removeItemFromRosterGroup(org.eclipse.ecf.presence.roster.RosterGroup group,XMPPID itemIDToRemove){
  for (Iterator i=group.getEntries().iterator(); i.hasNext(); ) {
    org.eclipse.ecf.presence.roster.RosterEntry entry=(org.eclipse.ecf.presence.roster.RosterEntry)i.next();
    if (entry.getUser().getID().equals(itemIDToRemove)) {
      i.remove();
      return true;
    }
  }
  return false;
}
Program: 94976
Project: 94976
Buggy source:
private void removeItemFromRoster(Collection rosterItems,XMPPID itemIDToRemove){
synchronized (rosterItems) {
    for (Iterator i=rosterItems.iterator(); i.hasNext(); ) {
      IRosterItem item=(IRosterItem)i.next();
      if (item instanceof org.eclipse.ecf.presence.roster.RosterGroup) {
        org.eclipse.ecf.presence.roster.RosterGroup group=(org.eclipse.ecf.presence.roster.RosterGroup)item;
        removeItemFromRosterGroup(group,itemIDToRemove);
        if (group.getEntries().size() == 0)         roster.removeItem(item);
        rosterManager.notifyRosterUpdate(roster);
      }
 else       if (item instanceof org.eclipse.ecf.presence.roster.RosterEntry) {
        if (((org.eclipse.ecf.presence.roster.RosterEntry)item).getUser().getID().equals(itemIDToRemove)) {
          roster.removeItem(item);
          rosterManager.notifyRosterUpdate(roster);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void removeItemFromRoster(Collection rosterItems,XMPPID itemIDToRemove){
  boolean removed=false;
  for (Iterator i=rosterItems.iterator(); i.hasNext(); ) {
    IRosterItem item=(IRosterItem)i.next();
    if (item instanceof org.eclipse.ecf.presence.roster.RosterGroup) {
      org.eclipse.ecf.presence.roster.RosterGroup group=(org.eclipse.ecf.presence.roster.RosterGroup)item;
      removed=removeItemFromRosterGroup(group,itemIDToRemove);
      if (group.getEntries().size() == 0)       i.remove();
    }
 else     if (item instanceof org.eclipse.ecf.presence.roster.RosterEntry) {
      if (((org.eclipse.ecf.presence.roster.RosterEntry)item).getUser().getID().equals(itemIDToRemove)) {
        i.remove();
        removed=true;
      }
    }
  }
  if (removed)   rosterManager.notifyRosterUpdate(roster);
}
Program: 94977
Project: 94977
Buggy source:
public void sendRosterRemove(ID userID) throws ECFException {
  try {
    if (!(userID instanceof XMPPID))     throw new ECFException("String_Node_Str");
    XMPPID xmppID=(XMPPID)userID;
    getConnectionOrThrowIfNull().sendRosterRemove(xmppID.getUsernameAtHost());
  }
 catch (  IOException e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void sendRosterRemove(ID userID) throws ECFException {
  try {
    if (!(userID instanceof XMPPID))     throw new ECFException("String_Node_Str");
    XMPPID xmppID=(XMPPID)userID;
    getConnectionOrThrowIfNull().sendRosterRemove(xmppID.getUsernameAtHost());
  }
 catch (  Exception e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}
Program: 94978
Project: 94978
Buggy source:
public void sendRosterAdd(String user,String name,String[] groups) throws ECFException {
  try {
    getConnectionOrThrowIfNull().sendRosterAdd(user,name,groups);
  }
 catch (  IOException e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void sendRosterAdd(String user,String name,String[] groups) throws ECFException {
  try {
    getConnectionOrThrowIfNull().sendRosterAdd(user,name,groups);
  }
 catch (  Exception e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}
Program: 94979
Project: 94979
Buggy source:
public void sendRosterRemove(String user) throws IOException {
  Roster r=getRoster();
  RosterEntry re=r.getEntry(user);
  try {
    r.removeEntry(re);
  }
 catch (  XMPPException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void sendRosterRemove(String user) throws XMPPException, IOException {
  Roster r=getRoster();
  RosterEntry re=r.getEntry(user);
  r.removeEntry(re);
}
Program: 94980
Project: 94980
Buggy source:
public void sendRosterAdd(String user,String name,String[] groups) throws IOException {
  Roster r=getRoster();
  try {
    r.createEntry(user,name,groups);
  }
 catch (  XMPPException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void sendRosterAdd(String user,String name,String[] groups) throws IOException, XMPPException {
  Roster r=getRoster();
  r.createEntry(user,name,groups);
}
Program: 94981
Project: 94981
Buggy source:
private void fillContextMenu(IMenuManager manager){
  IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
  Object element=iss.getFirstElement();
  if (element instanceof IRosterEntry) {
    IRosterEntry entry=(IRosterEntry)element;
    manager.add(imAction);
    imAction.setText(Messages.MultiRosterView_SendIM);
    imAction.setEnabled(entry.getPresence().getType() == IPresence.Type.AVAILABLE);
    manager.add(removeAction);
  }
  manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}

Fixed version (ground truth):
private void fillContextMenu(IMenuManager manager){
  IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
  Object element=iss.getFirstElement();
  if (element instanceof IRosterEntry) {
    IRosterEntry entry=(IRosterEntry)element;
    manager.add(imAction);
    imAction.setText(Messages.MultiRosterView_SendIM);
    imAction.setEnabled(entry.getPresence().getType() == IPresence.Type.AVAILABLE);
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(removeAction);
  }
 else   if (element instanceof IRoster) {
    manager.add(openAccountChatRoomAction);
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  }
 else {
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  }
}
Program: 94984
Project: 94984
Buggy source:
public void sessionConnected(ChatSession session){
  try {
    Contact contact=session.getParticipants()[0];
    final ID toID=namespace.createInstance(new Object[]{contact.getEmail(),contact.getDisplayName()});
    chatSessions.put(toID,session);
    session.addChatSessionListener(new ChatSessionListener(toID));
  }
 catch (  IDCreateException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void sessionConnected(ChatSession session){
  try {
    Contact contact=session.getParticipants()[0];
    final ID toID=namespace.createInstance(new Object[]{contact.getEmail()});
    chatSessions.put(toID,session);
    session.addChatSessionListener(new ChatSessionListener(toID));
  }
 catch (  IDCreateException e) {
    e.printStackTrace();
  }
}
Program: 94987
Project: 94987
Buggy source:
synchronized void openTab(IChatMessageSender icms,ID userID,ID threadID){
  tabFolder.setSelection(getTab(icms,userID,threadID).getCTab());
}

Fixed version (ground truth):
synchronized void openTab(IChatMessageSender icms,ID userID,ID threadID){
  ChatTab tab=getTab(icms,userID,threadID);
  for (int i=0; i < switchActions.size(); i++) {
    IAction action=((ActionContributionItem)switchActions.get(i)).getAction();
    action.setChecked(false);
  }
  tab.switchItem.getAction().setChecked(true);
  tabFolder.setSelection(tab.getCTab());
}
Program: 94988
Project: 94988
Buggy source:
public void fireMessageListeners(ID sender,String msg){
  for (Iterator i=msgListeners.iterator(); i.hasNext(); ) {
    IIMMessageListener l=(IIMMessageListener)i.next();
    l.handleMessageEvent(new ChatRoomMessageEvent(sender,new ChatRoomMessage(sender,msg)));
  }
}

Fixed version (ground truth):
public void fireMessageListeners(ID sender,String msg){
  for (Iterator i=msgListeners.iterator(); i.hasNext(); ) {
    IIMMessageListener l=(IIMMessageListener)i.next();
    l.handleMessageEvent(new ChatRoomMessageEvent(sender,new ChatRoomMessage(sender,targetID,msg)));
  }
}
Program: 94989
Project: 94989
Buggy source:
public void disconnect(){
  ID groupID=getConnectedID();
  fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (getConnectLock()) {
    if (isConnected()) {
      try {
        multiuserchat.leave();
      }
 catch (      Exception e) {
        traceStack("String_Node_Str",e);
      }
    }
    connectionState=DISCONNECTED;
    remoteServerID=null;
    this.connection=null;
  }
  fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
}

Fixed version (ground truth):
public void disconnect(){
  ID groupID=getConnectedID();
  fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (getConnectLock()) {
    if (isConnected()) {
      try {
        multiuserchat.leave();
      }
 catch (      Exception e) {
        traceStack("String_Node_Str",e);
      }
    }
    connectionState=DISCONNECTED;
    remoteServerID=null;
    containerHelper.setRoomID(null);
    this.connection=null;
  }
  fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
}
Program: 94990
Project: 94990
Buggy source:
protected void fireMessageListeners(ID from,String body){
  for (Iterator i=messageListeners.iterator(); i.hasNext(); ) {
    IIMMessageListener l=(IIMMessageListener)i.next();
    l.handleMessageEvent(new ChatRoomMessageEvent(from,new ChatRoomMessage(from,body)));
  }
}

Fixed version (ground truth):
protected void fireMessageListeners(ID from,String body){
  for (Iterator i=messageListeners.iterator(); i.hasNext(); ) {
    IIMMessageListener l=(IIMMessageListener)i.next();
    l.handleMessageEvent(new ChatRoomMessageEvent(from,new ChatRoomMessage(from,roomID,body)));
  }
}
Program: 94991
Project: 94991
Buggy source:
public XMPPOutgoingFileTransfer(FileTransferManager manager,XMPPID remoteTarget,IFileTransferInfo fileTransferInfo,IFileTransferListener listener){
  this.manager=manager;
  this.remoteTarget=remoteTarget;
  this.transferInfo=fileTransferInfo;
  this.listener=listener;
  this.sessionID=createSessionID();
  outgoingFileTransfer=manager.createOutgoingFileTransfer(remoteTarget.getName() + XMPPID.PATH_DELIMITER + remoteTarget.getResourceName());
}

Fixed version (ground truth):
public XMPPOutgoingFileTransfer(FileTransferManager manager,XMPPID remoteTarget,IFileTransferInfo fileTransferInfo,IFileTransferListener listener){
  this.manager=manager;
  this.remoteTarget=remoteTarget;
  this.transferInfo=fileTransferInfo;
  this.listener=listener;
  this.sessionID=createSessionID();
  String fullyQualifiedName=remoteTarget.getFQName();
  outgoingFileTransfer=manager.createOutgoingFileTransfer(fullyQualifiedName);
}
Program: 94992
Project: 94992
Buggy source:
public XMPPID(Namespace namespace,String unamehost) throws URISyntaxException {
  super(namespace);
  unamehost=fixEscape(unamehost);
  if (unamehost == null)   throw new URISyntaxException(unamehost,"String_Node_Str");
  int atIndex=unamehost.lastIndexOf(USER_HOST_DELIMITER);
  if (atIndex == -1)   throw new URISyntaxException(unamehost,"String_Node_Str");
  username=unamehost.substring(0,atIndex);
  hostname=unamehost.substring(atIndex + 1);
  atIndex=hostname.lastIndexOf(PORT_DELIMITER);
  if (atIndex != -1) {
    try {
      port=Integer.parseInt(hostname.substring(atIndex + 1));
    }
 catch (    NumberFormatException e) {
      throw new URISyntaxException(unamehost,"String_Node_Str");
    }
    hostname=hostname.substring(0,atIndex);
  }
  atIndex=hostname.lastIndexOf(PATH_DELIMITER);
  if (atIndex != -1) {
    resourcename=PATH_DELIMITER + hostname.substring(atIndex + 1);
    hostname=hostname.substring(0,atIndex);
  }
  uri=new URI(namespace.getScheme(),username,hostname,port,resourcename,null,null);
}

Fixed version (ground truth):
public XMPPID(Namespace namespace,String unamehost) throws URISyntaxException {
  super(namespace);
  unamehost=fixEscape(unamehost);
  if (unamehost == null)   throw new URISyntaxException(unamehost,"String_Node_Str");
  int atIndex=unamehost.lastIndexOf(USER_HOST_DELIMITER);
  if (atIndex == -1)   throw new URISyntaxException(unamehost,"String_Node_Str");
  username=unamehost.substring(0,atIndex);
  hostname=unamehost.substring(atIndex + 1);
  atIndex=hostname.lastIndexOf(PORT_DELIMITER);
  if (atIndex != -1) {
    try {
      port=Integer.parseInt(hostname.substring(atIndex + 1));
    }
 catch (    NumberFormatException e) {
      throw new URISyntaxException(unamehost,"String_Node_Str");
    }
    hostname=hostname.substring(0,atIndex);
  }
  atIndex=hostname.lastIndexOf(PATH_DELIMITER);
  if (atIndex != -1) {
    resourcename=PATH_DELIMITER + hostname.substring(atIndex + 1);
    hostname=hostname.substring(0,atIndex);
  }
 else {
    resourcename=PATH_DELIMITER + ECFConnection.CLIENT_TYPE;
  }
  uri=new URI(namespace.getScheme(),username,hostname,port,resourcename,null,null);
}
Program: 94994
Project: 94994
Buggy source:
public void dispose(){
synchronized (accounts) {
    for (Iterator i=accounts.keySet().iterator(); i.hasNext(); ) {
      ID serviceID=(ID)i.next();
      RosterUserAccount account=getAccount(serviceID);
      if (account != null) {
        ILocalInputHandler handler=account.getInputHandler();
        if (handler != null) {
          handler.disconnect();
        }
      }
    }
    accounts.clear();
  }
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  List handlers=new ArrayList();
synchronized (accounts) {
    for (Iterator i=accounts.keySet().iterator(); i.hasNext(); ) {
      RosterUserAccount account=getAccount((ID)i.next());
      handlers.add(account.getInputHandler());
    }
  }
  for (Iterator i=handlers.iterator(); i.hasNext(); ) {
    ILocalInputHandler handler=(ILocalInputHandler)i.next();
    handler.disconnect();
  }
  super.dispose();
}
Program: 94996
Project: 94996
Buggy source:
protected void writeToStream(final InputStream in,final OutputStream out) throws XMPPException {
  final byte[] b=new byte[BUFFER_SIZE];
  int count=0;
  amountWritten=0;
  do {
    try {
      out.write(b,0,count);
    }
 catch (    IOException e) {
      throw new XMPPException("String_Node_Str",e);
    }
    amountWritten+=count;
    if (count > 0) {
      fireTransferListenerEvent(new IOutgoingFileTransferSendDataEvent(){
        private static final long serialVersionUID=2327297070577249812L;
        public IOutgoingFileTransfer getSource(){
          return XMPPOutgoingFileTransfer.this;
        }
        public String toString(){
          StringBuffer buf=new StringBuffer("String_Node_Str");
          buf.append("String_Node_Str").append(getSource());
          buf.append("String_Node_Str").append(getSource().getBytesSent());
          buf.append("String_Node_Str").append(getSource().getPercentComplete()).append("String_Node_Str");
          return buf.toString();
        }
      }
);
    }
    try {
      count=in.read(b);
    }
 catch (    IOException e) {
      throw new XMPPException("String_Node_Str",e);
    }
  }
 while (count != -1 && !getStatus().equals(Status.CANCLED));
  if (!getStatus().equals(Status.CANCLED) && amountWritten != fileSize) {
    setStatus(Status.ERROR);
  }
}

Fixed version (ground truth):
protected void writeToStream(final InputStream in,final OutputStream out) throws XMPPException {
  final byte[] b=new byte[BUFFER_SIZE];
  int count=0;
  amountWritten=0;
  do {
    try {
      out.write(b,0,count);
    }
 catch (    IOException e) {
      throw new XMPPException("String_Node_Str",e);
    }
    amountWritten+=count;
    if (count > 0) {
      fireTransferListenerEvent(new IOutgoingFileTransferSendDataEvent(){
        private static final long serialVersionUID=2327297070577249812L;
        public IOutgoingFileTransfer getSource(){
          return XMPPOutgoingFileTransfer.this;
        }
        public String toString(){
          StringBuffer buf=new StringBuffer("String_Node_Str");
          buf.append("String_Node_Str").append(getSource().getBytesSent());
          buf.append("String_Node_Str").append(getSource().getPercentComplete()).append("String_Node_Str");
          return buf.toString();
        }
      }
);
    }
    try {
      count=in.read(b);
    }
 catch (    IOException e) {
      throw new XMPPException("String_Node_Str",e);
    }
  }
 while (count != -1 && !getStatus().equals(Status.CANCLED));
  if (!getStatus().equals(Status.CANCLED) && amountWritten != fileSize) {
    setStatus(Status.ERROR);
  }
}
Program: 94997
Project: 94997
Buggy source:
public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str").append(getSource());
  buf.append("String_Node_Str").append(getSource().getBytesSent());
  buf.append("String_Node_Str").append(getSource().getPercentComplete()).append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str").append(getSource().getBytesSent());
  buf.append("String_Node_Str").append(getSource().getPercentComplete()).append("String_Node_Str");
  return buf.toString();
}
Program: 94999
Project: 94999
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  final GridLayout gridLayout=new GridLayout();
  gridLayout.horizontalSpacing=0;
  container.setLayout(gridLayout);
  final Composite composite=new Composite(container,SWT.NONE);
  final GridLayout gridLayout_2=new GridLayout();
  gridLayout_2.numColumns=2;
  composite.setLayout(gridLayout_2);
  final Label label_4=new Label(composite,SWT.NONE);
  label_4.setText("String_Node_Str");
  final Label label_3=new Label(composite,SWT.NONE);
  label_3.setText("String_Node_Str");
  usertext=new Text(composite,SWT.BORDER);
  usertext.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  if (user != null) {
    usertext.setText(user);
    usertext.setEnabled(false);
  }
  usertext.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (user != null || (usertext.getText().length() > 3 && usertext.getText().indexOf("String_Node_Str") != -1)) {
        okButton.setEnabled(true);
      }
 else {
        okButton.setEnabled(false);
      }
    }
  }
);
  final Label label_2=new Label(composite,SWT.NONE);
  label_2.setText("String_Node_Str");
  nicknametext=new Text(composite,SWT.BORDER);
  final GridData gridData_1=new GridData(GridData.FILL_HORIZONTAL);
  gridData_1.widthHint=192;
  nicknametext.setLayoutData(gridData_1);
  if (user != null) {
    nicknametext.setFocus();
  }
  return container;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  final GridLayout gridLayout=new GridLayout();
  gridLayout.horizontalSpacing=0;
  container.setLayout(gridLayout);
  final Composite composite=new Composite(container,SWT.NONE);
  final GridLayout gridLayout_2=new GridLayout();
  gridLayout_2.numColumns=2;
  composite.setLayout(gridLayout_2);
  final Label label_3=new Label(composite,SWT.NONE);
  label_3.setText("String_Node_Str");
  usertext=new Text(composite,SWT.BORDER);
  usertext.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  if (user != null) {
    usertext.setText(user);
    usertext.setEnabled(false);
  }
  usertext.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (user != null || (usertext.getText().length() > 3 && usertext.getText().indexOf("String_Node_Str") != -1)) {
        okButton.setEnabled(true);
      }
 else {
        okButton.setEnabled(false);
      }
    }
  }
);
  new Label(composite,SWT.NONE);
  final Label label_4=new Label(composite,SWT.NONE);
  label_4.setText("String_Node_Str");
  final Label label_2=new Label(composite,SWT.NONE);
  label_2.setText("String_Node_Str");
  nicknametext=new Text(composite,SWT.BORDER);
  final GridData gridData_1=new GridData(GridData.FILL_HORIZONTAL);
  gridData_1.widthHint=192;
  nicknametext.setLayoutData(gridData_1);
  if (user != null) {
    nicknametext.setFocus();
  }
  return container;
}
Program: 95000
Project: 95000
Buggy source:
protected void fireChatMessage(ID fromID,ID threadID,Type type,String subject,String body,Map properties){
  fireMessageEvent(new ChatMessageEvent(fromID,new ChatMessage(threadID,createMessageType(type),subject,body,properties)));
}

Fixed version (ground truth):
protected void fireChatMessage(ID fromID,ID threadID,Type type,String subject,String body,Map properties){
  fireMessageEvent(new ChatMessageEvent(fromID,new ChatMessage(fromID,threadID,createMessageType(type),subject,body,properties)));
}
Program: 95002
Project: 95002
Buggy source:
protected IStatus run(IProgressMonitor monitor){
  byte[] buf=new byte[buff_length];
  int totalWork=((fileLength == -1) ? 100 : (int)fileLength);
  monitor.beginTask(getRemoteFileURL().toString() + Messages.AbstractRetrieveFileTransfer_Progress_Data,totalWork);
  try {
    while (!isDone()) {
      if (monitor.isCanceled())       throw new UserCancelledException(Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled);
      int bytes=remoteFileContents.read(buf);
      if (bytes != -1) {
        bytesReceived+=bytes;
        localFileContents.write(buf,0,bytes);
        fireTransferReceiveDataEvent();
        monitor.worked(bytes);
      }
 else       done=true;
    }
  }
 catch (  Exception e) {
    exception=e;
    done=true;
  }
 finally {
    hardClose();
    monitor.done();
    fireTransferReceiveDoneEvent();
  }
  return getFinalStatus(exception);
}

Fixed version (ground truth):
protected IStatus run(IProgressMonitor monitor){
  byte[] buf=new byte[buff_length];
  int totalWork=((fileLength == -1) ? 100 : (int)fileLength);
  monitor.beginTask(getRemoteFileURL().toString() + Messages.AbstractRetrieveFileTransfer_Progress_Data,totalWork);
  try {
    while (!isDone()) {
      if (monitor.isCanceled())       throw new UserCancelledException(Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled);
      int bytes=remoteFileContents.read(buf);
      if (bytes != -1) {
        bytesReceived+=bytes;
        localFileContents.write(buf,0,bytes);
        fireTransferReceiveDataEvent();
        monitor.worked(bytes);
      }
 else {
        done=true;
        if (closeOutputStream) {
          localFileContents.close();
        }
      }
    }
  }
 catch (  Exception e) {
    exception=e;
    done=true;
  }
 finally {
    hardClose();
    monitor.done();
    fireTransferReceiveDoneEvent();
  }
  return getFinalStatus(exception);
}
Program: 95003
Project: 95003
Buggy source:
protected void hardClose(){
  try {
    if (remoteFileContents != null) {
      remoteFileContents.close();
    }
  }
 catch (  IOException e) {
  }
  try {
    if (closeOutputStream && localFileContents != null)     localFileContents.close();
  }
 catch (  IOException e) {
  }
  job=null;
  remoteFileContents=null;
  localFileContents=null;
}

Fixed version (ground truth):
protected void hardClose(){
  try {
    if (remoteFileContents != null) {
      remoteFileContents.close();
    }
  }
 catch (  IOException e) {
  }
  try {
    if (localFileContents != null && closeOutputStream) {
      localFileContents.close();
    }
  }
 catch (  IOException e) {
  }
  job=null;
  remoteFileContents=null;
  localFileContents=null;
}
Program: 95005
Project: 95005
Buggy source:
public IIncomingFileTransfer receive(OutputStream streamToStore) throws IOException {
  setOutputStream(new BufferedOutputStream(streamToStore));
  setCloseOutputStream(false);
  job=new FileTransferJob(getRemoteFileURL().toString());
  job.schedule();
  return UrlConnectionRetrieveFileTransfer.this;
}

Fixed version (ground truth):
public IIncomingFileTransfer receive(OutputStream streamToStore) throws IOException {
  setOutputStream(streamToStore);
  setCloseOutputStream(false);
  job=new FileTransferJob(getRemoteFileURL().toString());
  job.schedule();
  return UrlConnectionRetrieveFileTransfer.this;
}
Program: 95006
Project: 95006
Buggy source:
public void handleTransferEvent(IFileTransferEvent event){
  if (event instanceof IIncomingFileTransferReceiveStartEvent) {
    IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
    targetFile=new File(TESTTARGETPATH,rse.getFileID().getFilename());
    printFileInfo("String_Node_Str",event,targetFile);
    try {
      bufferedStream=new BufferedOutputStream(new FileOutputStream(targetFile));
      rse.receive(bufferedStream);
    }
 catch (    IOException e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
    }
  }
 else   if (event instanceof IIncomingFileTransferReceiveDataEvent) {
    printFileInfo("String_Node_Str",event,targetFile);
  }
 else   if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
    printFileInfo("String_Node_Str",event,targetFile);
    assertTrue(srcFile.length() == targetFile.length());
  }
 else {
    printFileInfo("String_Node_Str",event,targetFile);
  }
}

Fixed version (ground truth):
public void handleTransferEvent(IFileTransferEvent event){
  if (event instanceof IIncomingFileTransferReceiveStartEvent) {
    IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
    targetFile=new File(TESTTARGETPATH,rse.getFileID().getFilename());
    printFileInfo("String_Node_Str",event,targetFile);
    try {
      bufferedStream=new BufferedOutputStream(new FileOutputStream(targetFile));
      rse.receive(bufferedStream);
    }
 catch (    IOException e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
    }
  }
 else   if (event instanceof IIncomingFileTransferReceiveDataEvent) {
    printFileInfo("String_Node_Str",event,targetFile);
  }
 else   if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
    try {
      bufferedStream.flush();
      printFileInfo("String_Node_Str",event,targetFile);
      assertTrue(srcFile.length() == targetFile.length());
    }
 catch (    IOException e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
    }
  }
 else {
    printFileInfo("String_Node_Str",event,targetFile);
  }
}
Program: 95007
Project: 95007
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  clients=createClients();
  Enumeration files=Activator.getDefault().getBundle().getEntryPaths(TESTSRCPATH);
  for (; files.hasMoreElements(); ) {
    URL url=Activator.getDefault().getBundle().getEntry((String)files.nextElement());
    srcFiles.add(url.toExternalForm());
  }
  File targetDir=new File(TESTTARGETPATH);
  targetDir.mkdirs();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  clients=createClients();
  Enumeration files=Activator.getDefault().getBundle().getEntryPaths(TESTSRCPATH);
  for (; files.hasMoreElements(); ) {
    URL url=Activator.getDefault().getBundle().getEntry((String)files.nextElement());
    String file=url.getFile();
    if (file != null && !file.equals("String_Node_Str") && !file.endsWith("String_Node_Str")) {
      srcFiles.add(url.toExternalForm());
    }
  }
  File targetDir=new File(TESTTARGETPATH);
  targetDir.mkdirs();
}
Program: 95010
Project: 95010
Buggy source:
public void onDisconnected(){
  trace("String_Node_Str");
synchronized (connectLock) {
    if (connectWaiting) {
      if (connectException == null)       connectException=new Exception(Messages.IRCRootContainer_Exception_Unexplained_Disconnect);
      connectWaiting=false;
      connectLock.notify();
    }
  }
  showMessage(null,NLS.bind(Messages.IRCRootContainer_Disconnected,targetID.getName()));
  handleDisconnected();
}

Fixed version (ground truth):
public void onDisconnected(){
  trace("String_Node_Str");
synchronized (connectLock) {
    if (connectWaiting) {
      if (connectException == null)       connectException=new Exception(Messages.IRCRootContainer_Exception_Unexplained_Disconnect);
      connectWaiting=false;
      connectLock.notify();
    }
  }
  if (targetID != null) {
    showMessage(null,NLS.bind(Messages.IRCRootContainer_Disconnected,targetID.getName()));
    handleDisconnected();
  }
}
Program: 95011
Project: 95011
Buggy source:
protected void firePresenceListeners(boolean joined,String[] users){
  for (Iterator i=participantListeners.iterator(); i.hasNext(); ) {
    IChatRoomParticipantListener l=(IChatRoomParticipantListener)i.next();
    for (int j=0; j < users.length; j++) {
      ID fromID=createIDFromString(users[j]);
      boolean localUserIsChannelOperator=isLocalUserChannelOperator(users[j]);
      if (localUserIsChannelOperator)       setChannelOperator(true);
      l.handlePresence(fromID,createPresence(joined));
      if (joined)       l.handleArrivedInChat(fromID);
 else       l.handleDepartedFromChat(fromID);
    }
  }
}

Fixed version (ground truth):
protected void firePresenceListeners(boolean joined,String[] users){
  for (int i=0; i < users.length; i++) {
    if (joined)     addChannelParticipant(createIDFromString(users[i]));
 else     removeChannelParticipant(createIDFromString(users[i]));
  }
  for (Iterator i=participantListeners.iterator(); i.hasNext(); ) {
    IChatRoomParticipantListener l=(IChatRoomParticipantListener)i.next();
    for (int j=0; j < users.length; j++) {
      ID fromID=createIDFromString(users[j]);
      boolean localUserIsChannelOperator=isLocalUserChannelOperator(users[j]);
      if (localUserIsChannelOperator)       setChannelOperator(true);
      if (joined)       l.handleArrivedInChat(fromID);
      l.handlePresence(fromID,createPresence(joined));
      if (!joined)       l.handleDepartedFromChat(fromID);
    }
  }
}
Program: 95012
Project: 95012
Buggy source:
protected void handleUserQuit(String name){
  firePresenceListeners(false,new String[]{name});
}

Fixed version (ground truth):
protected void handleUserQuit(String name){
  if (containsChannelParticipant(createIDFromString(name)))   firePresenceListeners(false,new String[]{name});
}
Program: 95013
Project: 95013
Buggy source:
public String getStatus(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getStatus(){
  return null;
}
Program: 95014
Project: 95014
Buggy source:
protected void setChannelOperator(boolean channelOperator){
  this.channelOperator=channelOperator;
}

Fixed version (ground truth):
protected void setChannelOperator(String channelOperator){
  this.channelOperator=channelOperator;
}
Program: 95015
Project: 95015
Buggy source:
protected void firePresenceListeners(boolean joined,String[] users){
  for (int i=0; i < users.length; i++) {
    if (joined)     addChannelParticipant(createIDFromString(users[i]));
 else     removeChannelParticipant(createIDFromString(users[i]));
  }
  for (Iterator i=participantListeners.iterator(); i.hasNext(); ) {
    IChatRoomParticipantListener l=(IChatRoomParticipantListener)i.next();
    for (int j=0; j < users.length; j++) {
      ID fromID=createIDFromString(users[j]);
      boolean localUserIsChannelOperator=isLocalUserChannelOperator(users[j]);
      if (localUserIsChannelOperator)       setChannelOperator(true);
      if (joined)       l.handleArrivedInChat(fromID);
      l.handlePresence(fromID,createPresence(joined));
      if (!joined)       l.handleDepartedFromChat(fromID);
    }
  }
}

Fixed version (ground truth):
protected void firePresenceListeners(boolean joined,String[] users){
  for (int j=0; j < users.length; j++) {
    if (joined) {
      if (isChannelOperator(users[j]))       setChannelOperator(users[j]);
      ID participantID=createIDFromString(users[j]);
      if (addChannelParticipant(participantID)) {
        for (Iterator i=participantListeners.iterator(); i.hasNext(); ) {
          IChatRoomParticipantListener l=(IChatRoomParticipantListener)i.next();
          l.handleArrivedInChat(participantID);
          l.handlePresence(participantID,createPresence(true));
        }
      }
    }
 else {
      ID removeID=removeChannelParticipant(createIDFromString(users[j]));
      if (removeID != null) {
        for (Iterator i=participantListeners.iterator(); i.hasNext(); ) {
          IChatRoomParticipantListener l=(IChatRoomParticipantListener)i.next();
          l.handlePresence(removeID,createPresence(false));
          l.handleDepartedFromChat(removeID);
        }
      }
    }
  }
}
Program: 95016
Project: 95016
Buggy source:
protected boolean containsChannelParticipant(ID participantID){
  return channelParticipants.contains(participantID);
}

Fixed version (ground truth):
protected ID containsChannelParticipant(ID participantID){
  if (channelParticipants.contains(participantID))   return participantID;
  ID operatorID=createIDFromString(OPERATOR_PREFIX + participantID.getName());
  if (channelParticipants.contains(operatorID))   return operatorID;
  return null;
}
Program: 95017
Project: 95017
Buggy source:
protected void handleUserQuit(String name){
  if (containsChannelParticipant(createIDFromString(name)))   firePresenceListeners(false,new String[]{name});
}

Fixed version (ground truth):
protected void handleUserQuit(String name){
  if (containsChannelParticipant(createIDFromString(name)) != null)   firePresenceListeners(false,new String[]{name});
}
Program: 95018
Project: 95018
Buggy source:
public Map getProperties(){
  return null;
}

Fixed version (ground truth):
public Map getProperties(){
  return properties;
}
Program: 95019
Project: 95019
Buggy source:
protected boolean isChannelOperator(){
  return channelOperator;
}

Fixed version (ground truth):
protected boolean isChannelOperator(String user){
  if (user != null && user.startsWith(OPERATOR_PREFIX))   return true;
  return false;
}
Program: 95020
Project: 95020
Buggy source:
protected boolean isLocalUserChannelOperator(String user){
  if (!user.startsWith(OPERATOR_PREFIX))   return false;
  String localUserName=(ircUser == null) ? null : (OPERATOR_PREFIX + ircUser.getNick());
  if (localUserName == null)   return false;
  if (user.equals(localUserName))   return true;
  return false;
}

Fixed version (ground truth):
protected boolean isLocalUserChannelOperator(String channelOperator){
  if (!isChannelOperator(channelOperator))   return false;
  String localUserName=(ircUser == null) ? null : (OPERATOR_PREFIX + ircUser.getNick());
  if (localUserName == null)   return false;
  if (channelOperator.equals(localUserName))   return true;
  return false;
}
Program: 95021
Project: 95021
Buggy source:
private IPresence createPresence(final boolean available){
  return new IPresence(){
    private static final long serialVersionUID=1L;
    public Mode getMode(){
      return (available ? IPresence.Mode.AVAILABLE : IPresence.Mode.AWAY);
    }
    public Map getProperties(){
      return null;
    }
    public String getStatus(){
      return "String_Node_Str";
    }
    public Type getType(){
      return (available ? IPresence.Type.AVAILABLE : IPresence.Type.UNAVAILABLE);
    }
    public Object getAdapter(    Class adapter){
      return null;
    }
    public byte[] getPictureData(){
      return new byte[0];
    }
  }
;
}

Fixed version (ground truth):
private IPresence createPresence(final boolean available){
  return new IPresence(){
    private static final long serialVersionUID=1L;
    Map properties=new HashMap();
    public Mode getMode(){
      return (available ? IPresence.Mode.AVAILABLE : IPresence.Mode.AWAY);
    }
    public Map getProperties(){
      return properties;
    }
    public String getStatus(){
      return null;
    }
    public Type getType(){
      return (available ? IPresence.Type.AVAILABLE : IPresence.Type.UNAVAILABLE);
    }
    public Object getAdapter(    Class adapter){
      return null;
    }
    public byte[] getPictureData(){
      return new byte[0];
    }
  }
;
}
Program: 95022
Project: 95022
Buggy source:
protected boolean removeChannelParticipant(ID participantID){
  return channelParticipants.remove(participantID);
}

Fixed version (ground truth):
protected ID removeChannelParticipant(ID participantID){
  if (channelParticipants.remove(participantID))   return participantID;
  ID operatorID=createIDFromString(OPERATOR_PREFIX + participantID.getName());
  if (channelParticipants.remove(operatorID))   return operatorID;
  return null;
}
Program: 95023
Project: 95023
Buggy source:
protected void addChannelParticipant(ID participantID){
  channelParticipants.add(participantID);
}

Fixed version (ground truth):
protected boolean addChannelParticipant(ID participantID){
  if (containsChannelParticipant(participantID) == null) {
    channelParticipants.add(participantID);
    return true;
  }
 else   return false;
}
Program: 95024
Project: 95024
Buggy source:
public void handleDepartedFromChat(ID participant){
  chatroomview.handleLeave(participant);
}

Fixed version (ground truth):
public void handleDepartedFromChat(ID participant){
}
Program: 95026
Project: 95026
Buggy source:
public void handleArrivedInChat(ID participant){
  chatroomview.handleJoin(participant);
}

Fixed version (ground truth):
public void handleArrivedInChat(ID participant){
}
Program: 95027
Project: 95027
Buggy source:
public void handlePresence(final ID fromID,final IPresence presence){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (disposed)       return;
      boolean isAdd=presence.getType().equals(IPresence.Type.AVAILABLE);
      Participant p=new Participant(fromID);
      if (isAdd) {
        if (localUser == null && !otherUsers.contains(fromID)) {
          localUser=p;
        }
        addParticipant(p);
      }
 else {
        removeParticipant(p);
      }
    }
  }
);
}

Fixed version (ground truth):
public void handlePresence(final ID fromID,final IPresence presence){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (disposed)       return;
      boolean isAdd=presence.getType().equals(IPresence.Type.AVAILABLE);
      Participant p=new Participant(fromID);
      if (isAdd) {
        if (localUser == null) {
          localUser=p;
        }
        addParticipant(p);
      }
 else {
        removeParticipant(p);
      }
    }
  }
);
}
Program: 95028
Project: 95028
Buggy source:
protected void removeParticipant(IUser p){
  if (p != null) {
    ID id=p.getID();
    if (id != null) {
      if (otherUsers.contains(id))       appendText(outputText,new ChatLine("String_Node_Str" + getDateTime() + "String_Node_Str"+ trimUserID(id)+ "String_Node_Str",null));
      memberViewer.remove(p);
    }
  }
}

Fixed version (ground truth):
protected void removeParticipant(IUser p){
  if (p != null) {
    ID id=p.getID();
    if (id != null) {
      appendText(outputText,new ChatLine("String_Node_Str" + getDateTime() + "String_Node_Str"+ trimUserID(id)+ "String_Node_Str",null));
      memberViewer.remove(p);
    }
  }
}
Program: 95029
Project: 95029
Buggy source:
public void handleRosterEntryUpdate(final IRosterEntry entry){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      rosterView.handleRosterEntryAdd(PresenceContainerUI.this.groupID,entry);
    }
  }
);
}

Fixed version (ground truth):
public void handleRosterEntryUpdate(final IRosterEntry entry){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      rosterView.handleRosterEntryUpdate(PresenceContainerUI.this.groupID,entry);
    }
  }
);
}
Program: 95032
Project: 95032
Buggy source:
public String getMucString(){
  String host=uri.getHost();
  String group=fixPath(uri.getPath());
  String res=group + "String_Node_Str" + host;
  return res;
}

Fixed version (ground truth):
public String getMucString(){
  return this.roomname + "String_Node_Str" + this.domain+ "String_Node_Str"+ this.host;
}
Program: 95033
Project: 95033
Buggy source:
protected boolean namespaceEquals(BaseID o){
  if (!(o instanceof XMPPRoomID)) {
    return false;
  }
  XMPPRoomID other=(XMPPRoomID)o;
  return uri.equals(other.uri);
}

Fixed version (ground truth):
protected boolean namespaceEquals(BaseID o){
  if (!(o instanceof XMPPRoomID)) {
    return false;
  }
  XMPPRoomID other=(XMPPRoomID)o;
  return fieldEquals(other);
}
Program: 95034
Project: 95034
Buggy source:
protected String namespaceGetName(){
  String path=uri.getPath();
  return fixPath(path);
}

Fixed version (ground truth):
protected String namespaceGetName(){
  return this.roomname;
}