nus-yam/ex-repair huggingface dataset:
Program: 94901
Project: 94901
Buggy source:
protected Object createService(){
  return new IConcatService(){
    public String concat(    String string1,    String string2){
      String result=string1.concat(string2);
      System.out.println("String_Node_Str" + string1 + "String_Node_Str"+ string2+ "String_Node_Str"+ result);
      return string1.concat(string2);
    }
  }
;
}

Fixed version (ground truth):
protected Object createService(){
  return new IConcatService(){
    public String concat(    String string1,    String string2){
      final String result=string1.concat(string2);
      System.out.println("String_Node_Str" + string1 + "String_Node_Str"+ string2+ "String_Node_Str"+ result);
      return string1.concat(string2);
    }
  }
;
}
Program: 94902
Project: 94902
Buggy source:
public void testGetServiceReference() throws Exception {
  IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  registerService(adapters[0],IConcatService.class.getName(),createService(),3000);
  IRemoteServiceReference[] refs=getRemoteServiceReferences(adapters[1],IConcatService.class.getName());
  assertNotNull(refs);
  assertTrue(refs.length == 1);
}

Fixed version (ground truth):
public void testGetServiceReference() throws Exception {
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  registerService(adapters[0],IConcatService.class.getName(),createService(),3000);
  final IRemoteServiceReference[] refs=getRemoteServiceReferences(adapters[1],IConcatService.class.getName());
  assertNotNull(refs);
  assertTrue(refs.length > 0);
}
Program: 94903
Project: 94903
Buggy source:
public void testGetService() throws Exception {
  IRemoteService service=registerAndGetRemoteService();
  assertNotNull(service);
}

Fixed version (ground truth):
public void testGetService() throws Exception {
  final IRemoteService service=registerAndGetRemoteService();
  assertNotNull(service);
}
Program: 94904
Project: 94904
Buggy source:
public void testUnregisterService() throws Exception {
  IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  IRemoteServiceRegistration reg=registerService(adapters[0],IConcatService.class.getName(),createService(),1500);
  assertNotNull(reg);
  assertNotNull(reg.getContainerID());
  reg.unregister();
}

Fixed version (ground truth):
public void testUnregisterService() throws Exception {
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  final IRemoteServiceRegistration reg=registerService(adapters[0],IConcatService.class.getName(),createService(),1500);
  assertNotNull(reg);
  assertNotNull(reg.getContainerID());
  reg.unregister();
}
Program: 94905
Project: 94905
Buggy source:
public void testCallSynch() throws Exception {
  IRemoteService service=registerAndGetRemoteService();
  System.out.println("String_Node_Str");
  Object result=service.callSynch(createRemoteConcat("String_Node_Str","String_Node_Str"));
  System.out.println("String_Node_Str" + result);
  assertNotNull(result);
  assertTrue(result.equals("String_Node_Str".concat("String_Node_Str")));
}

Fixed version (ground truth):
public void testCallSynch() throws Exception {
  final IRemoteService service=registerAndGetRemoteService();
  System.out.println("String_Node_Str");
  final Object result=service.callSynch(createRemoteConcat("String_Node_Str","String_Node_Str"));
  System.out.println("String_Node_Str" + result);
  assertNotNull(result);
  assertTrue(result.equals("String_Node_Str".concat("String_Node_Str")));
}
Program: 94906
Project: 94906
Buggy source:
public void testBadCallSynch() throws Exception {
  IRemoteService service=registerAndGetRemoteService();
  try {
    service.callSynch(createRemoteCall("String_Node_Str",new Object[]{"String_Node_Str","String_Node_Str"}));
    fail();
  }
 catch (  ECFException e) {
  }
  try {
    service.callSynch(createRemoteCall("String_Node_Str",new Object[]{"String_Node_Str"}));
    fail();
  }
 catch (  ECFException e) {
  }
}

Fixed version (ground truth):
public void testBadCallSynch() throws Exception {
  final IRemoteService service=registerAndGetRemoteService();
  try {
    service.callSynch(createRemoteCall("String_Node_Str",new Object[]{"String_Node_Str","String_Node_Str"}));
    fail();
  }
 catch (  final ECFException e) {
  }
  try {
    service.callSynch(createRemoteCall("String_Node_Str",new Object[]{"String_Node_Str"}));
    fail();
  }
 catch (  final ECFException e) {
  }
}
Program: 94907
Project: 94907
Buggy source:
public void testRemoteServiceAdapters() throws Exception {
  IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  assertNotNull(adapters);
  for (int i=0; i < adapters.length; i++)   assertNotNull(adapters[i]);
}

Fixed version (ground truth):
public void testRemoteServiceAdapters() throws Exception {
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  assertNotNull(adapters);
  for (int i=0; i < adapters.length; i++)   assertNotNull(adapters[i]);
}
Program: 94908
Project: 94908
Buggy source:
public ID getConnectedID(){
synchronized (getConnectLock()) {
    return remoteServerID;
  }
}

Fixed version (ground truth):
public ID getConnectedID(){
  return remoteServerID;
}
Program: 94909
Project: 94909
Buggy source:
public boolean processEvent(Event arg0){
  if (arg0 instanceof IContainerConnectedEvent) {
    handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
  }
 else   if (arg0 instanceof IContainerDisconnectedEvent) {
    handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
  }
  return false;
}

Fixed version (ground truth):
public boolean processEvent(Event arg0){
  if (arg0 instanceof IContainerConnectedEvent) {
    handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
  }
 else   if (arg0 instanceof IContainerDisconnectedEvent) {
    handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
  }
 else   if (arg0 instanceof ISharedObjectActivatedEvent) {
    if (getConfig().getContext().getConnectedID() != null) {
      sendRegistryUpdateRequest();
    }
  }
  return false;
}
Program: 94910
Project: 94910
Buggy source:
public void initialize() throws SharedObjectInitException {
  super.initialize();
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  super.addEventProcessor(new IEventProcessor(){
    public boolean processEvent(    Event arg0){
      if (arg0 instanceof IContainerConnectedEvent) {
        handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
      }
 else       if (arg0 instanceof IContainerDisconnectedEvent) {
        handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
      }
      return false;
    }
  }
);
  localRegistry=new RemoteServiceRegistryImpl(getLocalContainerID());
  if (getConfig().getContext().getConnectedID() != null) {
    sendRegistryUpdateRequest();
  }
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}

Fixed version (ground truth):
public void initialize() throws SharedObjectInitException {
  super.initialize();
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  super.addEventProcessor(new IEventProcessor(){
    public boolean processEvent(    Event arg0){
      if (arg0 instanceof IContainerConnectedEvent) {
        handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
      }
 else       if (arg0 instanceof IContainerDisconnectedEvent) {
        handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
      }
 else       if (arg0 instanceof ISharedObjectActivatedEvent) {
        if (getConfig().getContext().getConnectedID() != null) {
          sendRegistryUpdateRequest();
        }
      }
      return false;
    }
  }
);
  localRegistry=new RemoteServiceRegistryImpl(getLocalContainerID());
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}
Program: 94912
Project: 94912
Buggy source:
protected IChatRoomViewCloseListener createChatRoomViewCloseListener(){
  return new IChatRoomViewCloseListener(){
    public void chatRoomViewClosing(){
      container.dispose();
    }
  }
;
}

Fixed version (ground truth):
protected IChatRoomViewCloseListener createChatRoomViewCloseListener(){
  return new IChatRoomViewCloseListener(){
    public void chatRoomViewClosing(){
      container.disconnect();
    }
  }
;
}
Program: 94913
Project: 94913
Buggy source:
public void chatRoomViewClosing(){
  container.dispose();
}

Fixed version (ground truth):
public void chatRoomViewClosing(){
  container.disconnect();
}
Program: 94914
Project: 94914
Buggy source:
public void disconnect(){
  if (rootCloseListener != null) {
    rootCloseListener.chatRoomViewClosing();
  }
  for (Iterator i=chatRooms.values().iterator(); i.hasNext(); ) {
    ChatRoom chatRoom=(ChatRoom)i.next();
    IChatRoomContainer container=chatRoom.chatRoomContainer;
    if (container != null)     container.dispose();
  }
  rootMessageSender=null;
  rootCloseListener=null;
  chatRooms.clear();
}

Fixed version (ground truth):
public void disconnect(){
  if (rootCloseListener != null) {
    rootCloseListener.chatRoomViewClosing();
  }
  for (Iterator i=chatRooms.values().iterator(); i.hasNext(); ) {
    ChatRoom chatRoom=(ChatRoom)i.next();
    IChatRoomContainer container=chatRoom.chatRoomContainer;
    if (container != null)     container.disconnect();
  }
  rootMessageSender=null;
  rootCloseListener=null;
  chatRooms.clear();
}
Program: 94915
Project: 94915
Buggy source:
public void stop(BundleContext context) throws Exception {
  plugin=null;
  if (tracker != null) {
    tracker.close();
    tracker=null;
  }
}

Fixed version (ground truth):
public void stop(BundleContext context) throws Exception {
  if (tracker != null) {
    tracker.close();
    tracker=null;
  }
  if (discoveryRegistration != null) {
    discoveryRegistration.unregister();
    discoveryRegistration=null;
  }
  plugin=null;
}
Program: 94916
Project: 94916
Buggy source:
public void start(BundleContext context) throws Exception {
  plugin=this;
  tracker=new ServiceTracker(context,IDiscoveryService.class.getName(),null);
  tracker.open();
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  plugin=this;
  IContainer container=ContainerFactory.getDefault().createContainer("String_Node_Str");
  container.connect(null,null);
  discoveryRegistration=context.registerService(IDiscoveryService.class.getName(),container,null);
  tracker=new ServiceTracker(context,IDiscoveryService.class.getName(),null);
  tracker.open();
}
Program: 94917
Project: 94917
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DiscoveryTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DiscoveryTest.class);
  suite.addTestSuite(DiscoveryServiceTest.class);
  return suite;
}
Program: 94918
Project: 94918
Buggy source:
protected String[] getRoomsForTarget(){
  String initialRooms=null;
  try {
    URI targetURI=new URI(targetID.getName());
    initialRooms=targetURI.getPath();
  }
 catch (  URISyntaxException e) {
  }
  if (initialRooms == null || initialRooms.equals("String_Node_Str") || initialRooms.equals("String_Node_Str"))   return new String[0];
  while (initialRooms.charAt(0) == '/')   initialRooms=initialRooms.substring(1);
  if (initialRooms.startsWith(CHANNEL_PREFIX))   return new String[]{initialRooms};
 else   return super.getRoomsForTarget();
}

Fixed version (ground truth):
protected String[] getRoomsForTarget(){
  String initialChannels=targetID.getName();
  int protocolSeparator=initialChannels.indexOf("String_Node_Str");
  if (protocolSeparator != -1)   initialChannels=initialChannels.substring(protocolSeparator + 3);
  int index=initialChannels.lastIndexOf("String_Node_Str");
  if (index != -1) {
    initialChannels=initialChannels.substring(index + 1);
    while (initialChannels.startsWith("String_Node_Str"))     initialChannels=initialChannels.substring(1);
  }
 else   initialChannels=null;
  if (initialChannels == null || initialChannels.equals("String_Node_Str") || initialChannels.equals("String_Node_Str"))   return new String[0];
  StringTokenizer toks=new StringTokenizer(initialChannels,ROOM_DELIMITER);
  String[] results=new String[toks.countTokens()];
  for (int i=0; i < results.length; i++) {
    results[i]=toks.nextToken();
    if (results[i].startsWith("String_Node_Str")) {
      results[i]="String_Node_Str" + results[i].substring(3);
    }
 else     if (!results[i].startsWith("String_Node_Str"))     results[i]="String_Node_Str" + results[i];
  }
  return results;
}
Program: 94919
Project: 94919
Buggy source:
String getConnectID(){
  String clean=connectText.getText().replaceAll("String_Node_Str","String_Node_Str");
  connectText.setText(clean);
  return clean;
}

Fixed version (ground truth):
String getConnectID(){
  return connectText.getText();
}
Program: 94920
Project: 94920
Buggy source:
protected IStatus getFinalStatus(Throwable exception){
  return (exception == null) ? new Status(IStatus.OK,Activator.getDefault().getBundle().getSymbolicName(),0,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Completed_OK,null) : new Status(IStatus.ERROR,Activator.getDefault().getBundle().getSymbolicName(),FILETRANSFER_ERRORCODE,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Exception,exception);
}

Fixed version (ground truth):
protected IStatus getFinalStatus(Throwable exception){
  return (exception == null) ? new Status(IStatus.OK,Activator.getDefault().getBundle().getSymbolicName(),0,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Completed_OK,null) : new Status(IStatus.CANCEL,Activator.PLUGIN_ID,FILETRANSFER_ERRORCODE,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Exception,exception);
}
Program: 94921
Project: 94921
Buggy source:
protected IStatus getFinalStatus(Throwable exception){
  return (exception == null) ? new Status(IStatus.OK,Activator.getDefault().getBundle().getSymbolicName(),0,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Completed_OK,null) : new Status(IStatus.CANCEL,Activator.PLUGIN_ID,FILETRANSFER_ERRORCODE,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Exception,exception);
}

Fixed version (ground truth):
protected IStatus getFinalStatus(Throwable exception){
  if (exception == null)   return new Status(IStatus.OK,Activator.getDefault().getBundle().getSymbolicName(),0,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Completed_OK,null);
 else   if (exception instanceof UserCancelledException)   return new Status(IStatus.CANCEL,Activator.PLUGIN_ID,FILETRANSFER_ERRORCODE,Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled,exception);
 else   return new Status(IStatus.ERROR,Activator.PLUGIN_ID,FILETRANSFER_ERRORCODE,Messages.AbstractRetrieveFileTransfer_Status_Transfer_Exception,exception);
}
Program: 94922
Project: 94922
Buggy source:
/** 
 * Returns whether the user has connected with the notification server successfully or not. If the connecting process failed,   {@link #reset()}should be called so that a connection attempt can be made to the server that the user has been redirected to.
 * @param username the user's MSN email address login
 * @param password the user's password
 * @return <tt>true</tt> if the login completed successfully,<tt>false</tt> otherwise
 * @throws IOException If an I/O error occurs while attempting to authenticate with the servers
 */
boolean login(String username,String password) throws IOException {
  response=connect(username);
  if (response.getCommand().equals("String_Node_Str")) {
    String ticket=request.getTicket(username,password,response.getParam(3));
    password=null;
    write("String_Node_Str","String_Node_Str" + ticket);
    ticket=null;
    String input=super.read();
    if (!input.startsWith("String_Node_Str")) {
      throw new ConnectException("String_Node_Str" + "String_Node_Str");
    }
    retrieveBuddyList();
    this.username=username;
    return true;
  }
 else   if (!response.getCommand().equals("String_Node_Str")) {
    throw new ConnectException("String_Node_Str");
  }
 else {
    alternateServer=response.getParam(2);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Returns whether the user has connected with the notification server successfully or not. If the connecting process failed,   {@link #reset()}should be called so that a connection attempt can be made to the server that the user has been redirected to.
 * @param username the user's MSN email address login
 * @param password the user's password
 * @return <tt>true</tt> if the login completed successfully,<tt>false</tt> otherwise
 * @throws IOException If an I/O error occurs while attempting to authenticate with the servers
 */
boolean login(String username,String password) throws IOException {
  response=connect(username);
  if (response.getCommand().equals("String_Node_Str")) {
    String ticket=request.getTicket(username,password,response.getParam(3));
    password=null;
    if (ticket == null) {
      throw new ConnectException("String_Node_Str");
    }
 else {
      write("String_Node_Str","String_Node_Str" + ticket);
      ticket=null;
      String input=super.read();
      if (!input.startsWith("String_Node_Str")) {
        throw new ConnectException("String_Node_Str" + "String_Node_Str");
      }
      retrieveBuddyList();
      this.username=username;
      return true;
    }
  }
 else   if (!response.getCommand().equals("String_Node_Str")) {
    throw new ConnectException("String_Node_Str");
  }
 else {
    alternateServer=response.getParam(2);
    return false;
  }
}
Program: 94924
Project: 94924
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) {
            setContentDescription(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;
    }
  }
}
}
);
}

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) {
            setContentDescription(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;
    }
  }
}
}
);
ScrollBar vscrollBar=chatText.getVerticalBar();
if (vscrollBar != null) {
vscrollBar.addSelectionListener(scrollSelectionListener);
chatText.addDisposeListener(new DisposeListener(){
  public void widgetDisposed(  DisposeEvent e){
    ScrollBar bar=chatText.getVerticalBar();
    if (bar != null)     bar.removeSelectionListener(scrollSelectionListener);
  }
}
);
}
}
Program: 94927
Project: 94927
Buggy source:
public void widgetSelected(SelectionEvent e){
  itemSelected=(CTabItem)e.item;
  if (itemSelected == chatRoomTab.tabItem)   makeTabItemNormal();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (shouldScrollToEnd(getOutputText())) {
    makeTabItemNormal();
  }
}
Program: 94928
Project: 94928
Buggy source:
ChatRoom(IChatRoomContainer container,ChatRoomTab tabItem){
  Assert.isNotNull(container);
  Assert.isNotNull(tabItem);
  this.chatRoomContainer=container;
  this.chatRoomMessageSender=container.getChatRoomMessageSender();
  this.chatRoomTab=tabItem;
  chatRoomParticipantViewer=this.chatRoomTab.getListViewer();
  options=new ArrayList();
  this.chatRoomTab.setKeyListener(this);
  rootTabFolder.setUnselectedCloseVisible(true);
  rootTabFolder.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      itemSelected=(CTabItem)e.item;
      if (itemSelected == chatRoomTab.tabItem)       makeTabItemNormal();
    }
  }
);
}

Fixed version (ground truth):
ChatRoom(IChatRoomContainer container,ChatRoomTab tabItem){
  Assert.isNotNull(container);
  Assert.isNotNull(tabItem);
  this.chatRoomContainer=container;
  this.chatRoomMessageSender=container.getChatRoomMessageSender();
  this.chatRoomTab=tabItem;
  chatRoomParticipantViewer=this.chatRoomTab.getListViewer();
  options=new ArrayList();
  this.chatRoomTab.setKeyListener(this);
  rootTabFolder.setUnselectedCloseVisible(true);
  rootTabFolder.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      itemSelected=(CTabItem)e.item;
      if (itemSelected == chatRoomTab.tabItem)       makeTabItemNormal();
    }
  }
);
  StyledText st=getOutputText();
  if (st != null) {
    ScrollBar vsb=st.getVerticalBar();
    if (vsb != null) {
      vsb.addSelectionListener(scrollSelectionListener);
      vsb.addDisposeListener(new DisposeListener(){
        public void widgetDisposed(        DisposeEvent e){
          StyledText st=getOutputText();
          if (st != null) {
            ScrollBar vsb=st.getVerticalBar();
            if (vsb != null)             vsb.removeSelectionListener(scrollSelectionListener);
          }
        }
      }
);
    }
  }
}
Program: 94929
Project: 94929
Buggy source:
public synchronized Object connect(ID remote,Object data,int timeout) throws ECFException {
  if (connection != null)   throw new ECFException("String_Node_Str");
  if (timeout > 0)   SmackConfiguration.setPacketReplyTimeout(timeout);
  Roster.setDefaultSubscriptionMode(Roster.SUBSCRIPTION_MANUAL);
  XMPPID jabberURI=getXMPPID(remote);
  String username=jabberURI.getUsername();
  serverName=jabberURI.getHostname();
  serverPort=jabberURI.getPort();
  try {
    if (google) {
      connection=new GoogleTalkConnection();
    }
 else     if (serverPort == -1) {
      if (secure) {
        connection=new SSLXMPPConnection(serverName);
      }
 else {
        connection=new XMPPConnection(serverName);
      }
    }
 else {
      if (secure) {
        connection=new SSLXMPPConnection(serverName,serverPort);
      }
 else {
        connection=new XMPPConnection(serverName,serverPort);
      }
    }
    connection.addPacketListener(packetListener,null);
    connection.addConnectionListener(connectionListener);
    connection.login(username,(String)data,CLIENT_TYPE);
    isConnected=true;
  }
 catch (  XMPPException e) {
    if (connection != null) {
      connection.close();
    }
    if (e.getMessage().equals("String_Node_Str"))     throw new ContainerAuthenticationException("String_Node_Str",e);
    throw new ContainerConnectException(e.getLocalizedMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
public synchronized Object connect(ID remote,Object data,int timeout) throws ECFException {
  if (connection != null)   throw new ECFException("String_Node_Str");
  if (timeout > 0)   SmackConfiguration.setPacketReplyTimeout(timeout);
  Roster.setDefaultSubscriptionMode(Roster.SUBSCRIPTION_MANUAL);
  XMPPID jabberURI=getXMPPID(remote);
  String username=jabberURI.getUsername();
  serverName=jabberURI.getHostname();
  serverPort=jabberURI.getPort();
  try {
    if (google) {
      if (secure) {
        connection=new SSLXMPPConnection(GOOGLE_TALK_HOST,XMPPS_DEFAULT_PORT,jabberURI.getHostname());
      }
 else {
        connection=new XMPPConnection(GOOGLE_TALK_HOST,XMPP_DEFAULT_PORT,jabberURI.getHostname());
      }
    }
 else     if (serverPort == -1) {
      if (secure) {
        connection=new SSLXMPPConnection(serverName);
      }
 else {
        connection=new XMPPConnection(serverName);
      }
    }
 else {
      if (secure) {
        connection=new SSLXMPPConnection(serverName,serverPort);
      }
 else {
        connection=new XMPPConnection(serverName,serverPort);
      }
    }
    connection.addPacketListener(packetListener,null);
    connection.addConnectionListener(connectionListener);
    connection.login(username,(String)data,CLIENT_TYPE);
    isConnected=true;
  }
 catch (  XMPPException e) {
    if (connection != null) {
      connection.close();
    }
    if (e.getMessage().equals("String_Node_Str"))     throw new ContainerAuthenticationException("String_Node_Str",e);
    throw new ContainerConnectException(e.getLocalizedMessage(),e);
  }
  return null;
}
Program: 94930
Project: 94930
Buggy source:
protected ISynchAsynchConnection createConnection(ID remoteSpace,Object data) throws ConnectionCreateException {
  boolean google=isGoogle(remoteSpace);
  boolean secure=!google;
  return new ECFConnection(google,getConnectNamespace(),receiver,secure);
}

Fixed version (ground truth):
protected ISynchAsynchConnection createConnection(ID remoteSpace,Object data) throws ConnectionCreateException {
  boolean google=isGoogle(remoteSpace);
  return new ECFConnection(google,getConnectNamespace(),receiver,true);
}
Program: 94931
Project: 94931
Buggy source:
protected String getPasswordKeyFromUserName(String username){
  if (username == null || username.equals("String_Node_Str"))   return null;
 else {
    return username.substring(0,username.indexOf("String_Node_Str"));
  }
}

Fixed version (ground truth):
protected String getPasswordKeyFromUserName(String username){
  if (username == null || username.equals("String_Node_Str"))   return null;
 else {
    int slashIndex=username.indexOf("String_Node_Str");
    if (slashIndex == -1)     return username;
 else     return username.substring(0,username.indexOf("String_Node_Str"));
  }
}
Program: 94932
Project: 94932
Buggy source:
private void defineLayout(IPageLayout layout){
  String editorArea=layout.getEditorArea();
  layout.createFolder("String_Node_Str",IPageLayout.LEFT,0.26f,editorArea);
  IFolderLayout bottomLeft=layout.createFolder("String_Node_Str",IPageLayout.BOTTOM,0.50f,"String_Node_Str");
  bottomLeft.addView(IPageLayout.ID_OUTLINE);
  IFolderLayout bottomRight=layout.createFolder("String_Node_Str",IPageLayout.BOTTOM,0.66f,editorArea);
  bottomRight.addView(IPageLayout.ID_PROBLEM_VIEW);
  bottomRight.addView(IPageLayout.ID_TASK_LIST);
}

Fixed version (ground truth):
private void defineLayout(IPageLayout layout){
  String editorArea=layout.getEditorArea();
  IFolderLayout topLeft=layout.createFolder("String_Node_Str",IPageLayout.LEFT,0.26f,editorArea);
  topLeft.addView(IPageLayout.ID_RES_NAV);
  IFolderLayout bottomLeft=layout.createFolder("String_Node_Str",IPageLayout.BOTTOM,0.50f,"String_Node_Str");
  bottomLeft.addView(IPageLayout.ID_OUTLINE);
  IFolderLayout bottomRight=layout.createFolder("String_Node_Str",IPageLayout.BOTTOM,0.66f,editorArea);
  bottomRight.addView(IPageLayout.ID_PROBLEM_VIEW);
  bottomRight.addView(IPageLayout.ID_TASK_LIST);
}
Program: 94934
Project: 94934
Buggy source:
public Object getProperty(String name){
  return svcProperties.getPropertyBytes(name);
}

Fixed version (ground truth):
public Object getProperty(String name){
  return svcProperties.getProperty(name);
}
Program: 94935
Project: 94935
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_3=new Label(composite,SWT.NONE);
  label_3.setText(Messages.ChangePasswordDialog_NEW_PASSWORD_LABEL);
  p1=new Text(composite,SWT.BORDER);
  p1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  p1.setEchoChar('*');
  final Label label_2=new Label(composite,SWT.NONE);
  label_2.setText(Messages.ChangePasswordDialog_REENTER_PASSWORD_LABEL);
  p2=new Text(composite,SWT.BORDER);
  final GridData gridData_1=new GridData(GridData.FILL_HORIZONTAL);
  gridData_1.widthHint=192;
  p2.setLayoutData(gridData_1);
  p2.setEchoChar('*');
  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);
  Label l=new Label(composite,SWT.NONE);
  l.setText(accountName);
  new Label(composite,SWT.NONE);
  final Label label_3=new Label(composite,SWT.NONE);
  label_3.setText(Messages.ChangePasswordDialog_NEW_PASSWORD_LABEL);
  password1=new Text(composite,SWT.BORDER);
  password1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  password1.setEchoChar('*');
  final Label label_2=new Label(composite,SWT.NONE);
  label_2.setText(Messages.ChangePasswordDialog_REENTER_PASSWORD_LABEL);
  password2=new Text(composite,SWT.BORDER);
  final GridData gridData_1=new GridData(GridData.FILL_HORIZONTAL);
  gridData_1.widthHint=192;
  password2.setLayoutData(gridData_1);
  password2.setEchoChar('*');
  return container;
}
Program: 94936
Project: 94936
Buggy source:
public ChangePasswordDialog(Shell parentShell){
  super(parentShell);
}

Fixed version (ground truth):
public ChangePasswordDialog(Shell parentShell,String accountName){
  super(parentShell);
  this.accountName=accountName;
}
Program: 94937
Project: 94937
Buggy source:
public void buttonPressed(int button){
  result=button;
  if (button == Window.OK) {
    pass1=p1.getText();
    pass2=p2.getText();
    if (!pass1.equals(pass2)) {
      MessageDialog.openError(getShell(),Messages.ChangePasswordDialog_PASSWORDS_NO_MATCH_TITLE,Messages.ChangePasswordDialog_PASSWORDS_NO_MATCH_MESSAGE);
      p1.setText("String_Node_Str");
      p2.setText("String_Node_Str");
      p1.setFocus();
      return;
    }
  }
  close();
}

Fixed version (ground truth):
public void buttonPressed(int button){
  result=button;
  if (button == Window.OK) {
    pass1=password1.getText();
    pass2=password2.getText();
    if (!pass1.equals(pass2)) {
      MessageDialog.openError(getShell(),Messages.ChangePasswordDialog_PASSWORDS_NO_MATCH_TITLE,Messages.ChangePasswordDialog_PASSWORDS_NO_MATCH_MESSAGE);
      password1.setText("String_Node_Str");
      password2.setText("String_Node_Str");
      password1.setFocus();
      return;
    }
  }
  close();
}
Program: 94938
Project: 94938
Buggy source:
protected void createButtonsForButtonBar(Composite parent){
  createButton(parent,AUTHORIZE_AND_ADD,Messages.ReceiveAuthorizeRequestDialog_BUTTON_AUTHORIZE_AND_ADD,false);
  createButton(parent,AUTHORIZE_ID,Messages.ReceiveAuthorizeRequestDialog_BUTTON_AUTHORIZE_ONLY,false);
  createButton(parent,REFUSE_ID,Messages.ReceiveAuthorizeRequestDialog_BUTTON_REFUSE,true);
}

Fixed version (ground truth):
protected void createButtonsForButtonBar(Composite parent){
  createButton(parent,AUTHORIZE_ID,Messages.ReceiveAuthorizeRequestDialog_BUTTON_AUTHORIZE_ONLY,false);
  createButton(parent,REFUSE_ID,Messages.ReceiveAuthorizeRequestDialog_BUTTON_REFUSE,true);
}
Program: 94939
Project: 94939
Buggy source:
protected void refreshTreeViewer(Object val,boolean labels){
  if (treeViewer != null) {
    Control c=treeViewer.getControl();
    if (c != null && !c.isDisposed()) {
      if (val != null) {
        treeViewer.refresh(val,labels);
      }
 else {
        treeViewer.refresh(labels);
      }
      treeViewer.expandToLevel(DEFAULT_EXPAND_LEVEL);
    }
  }
}

Fixed version (ground truth):
protected void refreshTreeViewer(Object val,boolean labels){
  if (treeViewer != null) {
    Control c=treeViewer.getControl();
    if (c != null && !c.isDisposed()) {
      if (val != null) {
        treeViewer.refresh(val,labels);
        ViewerFilter[] filters=treeViewer.getFilters();
        if (filters.length != 0) {
          treeViewer.refresh(labels);
        }
      }
 else {
        treeViewer.refresh(labels);
      }
      treeViewer.expandToLevel(DEFAULT_EXPAND_LEVEL);
    }
  }
}
Program: 94940
Project: 94940
Buggy source:
protected void removeRosterAccount(MultiRosterAccount account){
  account.getRosterManager().removeRosterSubscriptionListener(subscriptionListener);
  account.getRosterManager().removePresenceListener(presenceListener);
  if (treeViewer != null)   treeViewer.remove(account.getRoster());
  rosterAccounts.remove(account);
  disconnectAllAccountsAction.setEnabled(rosterAccounts.size() > 0);
  account.dispose();
  refreshTreeViewer(null,true);
}

Fixed version (ground truth):
protected void removeRosterAccount(MultiRosterAccount account){
  account.getRosterManager().removeRosterSubscriptionListener(subscriptionListener);
  account.getRosterManager().removePresenceListener(presenceListener);
  if (treeViewer != null)   treeViewer.remove(account.getRoster());
  rosterAccounts.remove(account);
  setLocalPullDownEnabled(rosterAccounts.size() > 0);
  account.dispose();
  refreshTreeViewer(null,true);
}
Program: 94942
Project: 94942
Buggy source:
private void fillLocalPullDown(IMenuManager manager){
  setStatusMenu=new MenuManager(Messages.MultiRosterView_SetStatusAs,null);
  setStatusMenu.add(setAvailableAction);
  setStatusMenu.add(setAwayAction);
  setStatusMenu.add(setDNDAction);
  setStatusMenu.add(setInvisibleAction);
  setStatusMenu.add(setOfflineAction);
  setStatusMenu.setVisible(false);
  manager.add(setStatusMenu);
  manager.add(new Separator());
  manager.add(new Action(Messages.MultiRosterView_ShowOffline,Action.AS_CHECK_BOX){
    public void run(){
      if (isChecked()) {
        treeViewer.removeFilter(hideOfflineFilter);
      }
 else {
        treeViewer.addFilter(hideOfflineFilter);
      }
    }
  }
);
  IAction showEmptyGroupsAction=new Action(Messages.MultiRosterView_ShowEmptyGroups,Action.AS_CHECK_BOX){
    public void run(){
      if (isChecked()) {
        treeViewer.removeFilter(hideEmptyGroupsFilter);
      }
 else {
        treeViewer.addFilter(hideEmptyGroupsFilter);
      }
    }
  }
;
  manager.add(showEmptyGroupsAction);
  manager.add(new Separator());
  manager.add(new Action(Messages.MultiRosterView_AddContact,SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)){
    public void run(){
      AddContactDialog dialog=new AddContactDialog(treeViewer.getControl().getShell());
      dialog.setInput(rosterAccounts);
      if (Window.OK == dialog.open()) {
        IPresenceContainerAdapter ipca=dialog.getSelection();
        IRosterSubscriptionSender sender=ipca.getRosterManager().getRosterSubscriptionSender();
        try {
          sender.sendRosterAdd(dialog.getAccountID(),dialog.getAlias(),null);
        }
 catch (        ECFException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  manager.add(new Separator());
  manager.add(openChatRoomAction);
  manager.add(new Separator());
  manager.add(disconnectAllAccountsAction);
}

Fixed version (ground truth):
private void fillLocalPullDown(IMenuManager manager){
  setStatusMenu=new MenuManager(Messages.MultiRosterView_SetStatusAs,null);
  setStatusMenu.add(setAvailableAction);
  setStatusMenu.add(setAwayAction);
  setStatusMenu.add(setDNDAction);
  setStatusMenu.add(setInvisibleAction);
  setStatusMenu.add(setOfflineAction);
  manager.add(setStatusMenu);
  manager.add(new Separator());
  manager.add(showOfflineAction);
  manager.add(showEmptyGroupsAction);
  manager.add(new Separator());
  manager.add(addContactAction);
  manager.add(new Separator());
  manager.add(openChatRoomAction);
  manager.add(new Separator());
  manager.add(disconnectAllAccountsAction);
  setLocalPullDownEnabled(false);
}
Program: 94943
Project: 94943
Buggy source:
protected boolean addRosterAccount(MultiRosterAccount account){
  boolean result=account != null && rosterAccounts.add(account);
  if (result)   disconnectAllAccountsAction.setEnabled(true);
  return result;
}

Fixed version (ground truth):
protected boolean addRosterAccount(MultiRosterAccount account){
  boolean result=account != null && rosterAccounts.add(account);
  if (result)   setLocalPullDownEnabled(true);
  return result;
}
Program: 94947
Project: 94947
Buggy source:
public void disposeClient(){
  myNames.clear();
  users.clear();
  if (teamChat != null) {
    final ChatWindow chatWindow=teamChat.chatWindow;
    if (chatWindow != null && !Display.getDefault().isDisposed()) {
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          chatWindow.close();
        }
      }
);
    }
    teamChat=null;
  }
  if (lch != null) {
    lch=null;
  }
  view.disposeClient(this);
}

Fixed version (ground truth):
public void disposeClient(){
  myNames.clear();
  users.clear();
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      if (!teamChat.isDisposed() && teamChat.chatWindow != null)       teamChat.chatWindow.close();
    }
  }
);
  view.disposeClient(this);
}
Program: 94948
Project: 94948
Buggy source:
protected boolean changeUserInTree(final User userdata){
  for (int i=0; i < users.size(); i++) {
    final User user=(User)users.get(i);
    if (user.getUserID().equals(userdata.getUserID())) {
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          TableViewer view=teamChat.getTableViewer();
          view.remove(user);
          users.remove(user);
          view.add(userdata);
          users.add(userdata);
        }
      }
);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean changeUserInTree(final User userdata){
  for (int i=0; i < users.size(); i++) {
    final User user=(User)users.get(i);
    if (user.getUserID().equals(userdata.getUserID())) {
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          if (!teamChat.isDisposed()) {
            TableViewer view=teamChat.getTableViewer();
            view.remove(user);
            users.remove(user);
            view.add(userdata);
            users.add(userdata);
          }
        }
      }
);
      return true;
    }
  }
  return false;
}
Program: 94949
Project: 94949
Buggy source:
public void run(){
  if (teamChat != null)   teamChat.setStatus(user.getNickname() + "String_Node_Str");
}

Fixed version (ground truth):
public void run(){
  if (!teamChat.isDisposed())   teamChat.setStatus(user.getNickname() + "String_Node_Str");
}
Program: 94950
Project: 94950
Buggy source:
protected void removeUserFromTree(ID id){
  if (id == null) {
    return;
  }
 else {
    for (int i=0; i < users.size(); i++) {
      final User user=(User)users.get(i);
      if (user.getUserID().equals(id)) {
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            teamChat.getTableViewer().remove(user);
          }
        }
);
        users.remove(i);
        break;
      }
    }
  }
}

Fixed version (ground truth):
protected void removeUserFromTree(ID id){
  if (id == null) {
    return;
  }
 else {
    for (int i=0; i < users.size(); i++) {
      final User user=(User)users.get(i);
      if (user.getUserID().equals(id)) {
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            if (!teamChat.isDisposed())             teamChat.getTableViewer().remove(user);
          }
        }
);
        users.remove(i);
        break;
      }
    }
  }
}
Program: 94951
Project: 94951
Buggy source:
protected void appendAndScrollToBottom(final ChatLine str){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (teamChat != null)       teamChat.appendText(str);
    }
  }
);
}

Fixed version (ground truth):
protected void appendAndScrollToBottom(final ChatLine str){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (!teamChat.isDisposed())       teamChat.appendText(str);
    }
  }
);
}
Program: 94952
Project: 94952
Buggy source:
protected void refreshTreeView(){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (teamChat != null) {
        try {
          teamChat.getTableViewer().refresh();
        }
 catch (        Exception e) {
        }
      }
    }
  }
);
}

Fixed version (ground truth):
protected void refreshTreeView(){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (!teamChat.isDisposed())       teamChat.getTableViewer().refresh();
    }
  }
);
}
Program: 94953
Project: 94953
Buggy source:
protected void addUserToTree(final User user){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      users.add(user);
      teamChat.getTableViewer().add(user);
    }
  }
);
}

Fixed version (ground truth):
protected void addUserToTree(final User user){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      users.add(user);
      if (!teamChat.isDisposed())       teamChat.getTableViewer().add(user);
    }
  }
);
}
Program: 94954
Project: 94954
Buggy source:
public void startedTyping(final User user){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (teamChat != null)       teamChat.setStatus(user.getNickname() + "String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
public void startedTyping(final User user){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (!teamChat.isDisposed())       teamChat.setStatus(user.getNickname() + "String_Node_Str");
    }
  }
);
}
Program: 94955
Project: 94955
Buggy source:
private void showErrorMessage(String channel,String msg){
  IRCChannelContainer msgChannel=getChannel(channel);
  if (msgChannel != null)   msgChannel.fireMessageListeners((username == null) ? getSystemID() : createIDFromString(username),msg);
 else   fireMessageListeners((username == null) ? getSystemID() : createIDFromString(username),msg);
}

Fixed version (ground truth):
private void showErrorMessage(String channel,String msg){
  IRCChannelContainer msgChannel=getChannel(channel);
  if (msgChannel != null)   msgChannel.fireChatRoomMessageEvent((username == null) ? getSystemID() : createIDFromString(username),msg);
 else   fireChatRoomMessageEvent((username == null) ? getSystemID() : createIDFromString(username),msg);
}
Program: 94956
Project: 94956
Buggy source:
private void showMessage(String channel,String user,String msg){
  IRCChannelContainer msgChannel=getChannel(channel);
  if (msgChannel != null)   msgChannel.fireMessageListeners(createIDFromString(user),msg);
 else   fireMessageListeners(createIDFromString(user),msg);
}

Fixed version (ground truth):
private void showMessage(String channel,String user,String msg){
  IRCChannelContainer msgChannel=getChannel(channel);
  if (msgChannel != null) {
    msgChannel.fireChatRoomMessageEvent(createIDFromString(user),msg);
  }
 else {
    fireChatMessageEvent(createIDFromString(user),msg);
    for (Iterator it=channels.values().iterator(); it.hasNext(); ) {
      msgChannel=(IRCChannelContainer)it.next();
      msgChannel.fireChatMessageEvent(createIDFromString(user),msg);
    }
  }
}
Program: 94957
Project: 94957
Buggy source:
/** 
 * Add chat room admin listener to listen for room admin changes.
 * @param adminListener the listener to add.  Must not be <code>null</code>.
 */
public void addChatRoomAdminListener(IChatRoomAdminListener adminListener);

Fixed version (ground truth):
/** 
 * Add chat room admin listener to listen for room admin changes.
 * @param adminListener the listener to add. Must not be <code>null</code>.
 */
public void addChatRoomAdminListener(IChatRoomAdminListener adminListener);
Program: 94958
Project: 94958
Buggy source:
/** 
 * Remove chat room admin listener.
 * @param adminListener the listener to remove.  Must not be <code>null</code>.
 */
public void removeChatRoomAdminListener(IChatRoomAdminListener adminListener);

Fixed version (ground truth):
/** 
 * Remove chat room admin listener.
 * @param adminListener the listener to remove. Must not be <code>null</code>.
 */
public void removeChatRoomAdminListener(IChatRoomAdminListener adminListener);
Program: 94959
Project: 94959
Buggy source:
public synchronized void selectTab(IChatMessageSender messageSender,ITypingMessageSender typingSender,ID localID,ID userID){
  ChatTab tab=getTab(messageSender,typingSender,localID,userID);
  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.item);
  tab.inputText.setFocus();
}

Fixed version (ground truth):
public synchronized void selectTab(IChatMessageSender messageSender,ITypingMessageSender typingSender,ID localID,ID userID){
  ChatTab tab=getTab(messageSender,typingSender,localID,userID);
  tabFolder.setSelection(tab.item);
  tab.inputText.setFocus();
}
Program: 94960
Project: 94960
Buggy source:
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;
}
}

Fixed version (ground truth):
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;
}
}
Program: 94961
Project: 94961
Buggy source:
public void run(){
  item.dispose();
  removeTab(ChatTab.this);
  switchActions.remove(switchItem);
  menuManagers.remove(manager);
  for (int i=0; i < menuManagers.size(); i++) {
    IMenuManager manager=(IMenuManager)menuManagers.get(i);
    manager.remove(switchItem);
    manager.update(true);
  }
}

Fixed version (ground truth):
public void run(){
  CTabItem item=tabFolder.getSelection();
  if (item != null) {
    Iterator iterator=tabs.values().iterator();
    while (iterator.hasNext()) {
      ChatTab tab=(ChatTab)iterator.next();
      if (tab.item == item) {
        if (MessageDialog.openConfirm(tabFolder.getShell(),Messages.MessagesView_ClearChatLogDialogTitle,NLS.bind(Messages.MessagesView_ClearChatLogDialogMessage,getUserName(tab.remoteID)))) {
synchronized (tab) {
            tab.chatText.setText("String_Node_Str");
          }
        }
        return;
      }
    }
  }
}
Program: 94962
Project: 94962
Buggy source:
private void showIsTyping(boolean isTyping){
  form.setMessage(isTyping ? NLS.bind(Messages.MessagesView_TypingNotification,getUserName(remoteID)) : null);
}

Fixed version (ground truth):
private void showIsTyping(boolean isTyping){
  notificationLabel.setText(isTyping ? NLS.bind(Messages.MessagesView_TypingNotification,getUserName(remoteID)) : "String_Node_Str");
}