nus-yam/ex-repair huggingface dataset:
Program: 94739
Project: 94739
Buggy source:
private void verify(){
  String text=connectText.getText();
  passwordText.setText("String_Node_Str");
  if (text.equals("String_Node_Str")) {
    updateStatus(Messages.XMPPSConnectWizardPage_WIZARD_PAGE_STATUS);
  }
 else   if (text.indexOf('@') == -1) {
    updateStatus(Messages.XMPPConnectWizardPage_WIZARD_STATUS_INCOMPLETE);
  }
 else {
    updateStatus(null);
    restorePassword(text);
  }
}

Fixed version (ground truth):
private void verify(){
  String text=connectText.getText();
  if (text.equals("String_Node_Str")) {
    updateStatus(Messages.XMPPSConnectWizardPage_WIZARD_PAGE_STATUS);
  }
 else   if (text.indexOf('@') == -1) {
    updateStatus(Messages.XMPPConnectWizardPage_WIZARD_STATUS_INCOMPLETE);
  }
 else {
    updateStatus(null);
    restorePassword(text);
  }
}
Program: 94740
Project: 94740
Buggy source:
public void handleEvent(IContainerEvent event){
  final IContainerManager containerManager=Activator.getDefault().getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        Activator.getDefault().addDocShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,IStatus.WARNING,NLS.bind(Messages.ECFStart_ERROR_DOCUMENT_SHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent) {
      Activator.getDefault().removeDocShare(containerID);
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}

Fixed version (ground truth):
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        activator.addDocShare(containerID,cca);
      }
 catch (      ECFException e) {
        activator.getLog().log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,IStatus.WARNING,NLS.bind(Messages.ECFStart_ERROR_DOCUMENT_SHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent) {
      Activator.getDefault().removeDocShare(containerID);
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}
Program: 94741
Project: 94741
Buggy source:
private void verifyEmail(){
  String email=emailText.getText().trim();
  passwordText.setText("String_Node_Str");
  if (email.equals("String_Node_Str")) {
    setErrorMessage(Messages.MSNConnectWizardPage_EmailAddressRequired);
  }
 else   if (email.indexOf('@') == -1) {
    setErrorMessage(Messages.MSNConnectWizardPage_EmailAddressInvalid);
  }
 else {
    setErrorMessage(null);
    restorePassword(email);
  }
}

Fixed version (ground truth):
private void verifyEmail(){
  String email=emailText.getText().trim();
  if (email.equals("String_Node_Str")) {
    setErrorMessage(Messages.MSNConnectWizardPage_EmailAddressRequired);
  }
 else   if (email.indexOf('@') == -1) {
    setErrorMessage(Messages.MSNConnectWizardPage_EmailAddressInvalid);
  }
 else {
    setErrorMessage(null);
    restorePassword(email);
  }
}
Program: 94743
Project: 94743
Buggy source:
public IIncomingFileTransfer receive(OutputStream streamToStore) throws IOException {
  setOutputStream(streamToStore);
  setCloseOutputStream(false);
  job=new FileTransferJob(getRemoteFileURL().toString());
  job.schedule();
  return RetrieveFileTransfer.this;
}

Fixed version (ground truth):
/** 
 * @throws IOException not actually thrown by this implementation.
 */
public IIncomingFileTransfer receive(OutputStream streamToStore,FileTransferJob fileTransferJob) throws IOException {
  setOutputStream(streamToStore);
  setCloseOutputStream(false);
  setupAndScheduleJob(fileTransferJob);
  return RetrieveFileTransfer.this;
}
Program: 94744
Project: 94744
Buggy source:
protected void openStreams() throws SendFileTransferException {
  try {
    setInputStream(new BufferedInputStream(new FileInputStream(getFileTransferInfo().getFile())));
    final IFileStore fileStore=EFS.getStore(new URI(getRemoteFileURL().getPath()));
    setOutputStream(fileStore.openOutputStream(0,null));
    listener.handleTransferEvent(new IOutgoingFileTransferResponseEvent(){
      private static final long serialVersionUID=8414116325104138848L;
      public String toString(){
        final StringBuffer sb=new StringBuffer("String_Node_Str");
        sb.append("String_Node_Str").append(done).append("String_Node_Str");
        sb.append("String_Node_Str").append(bytesSent).append("String_Node_Str");
        return sb.toString();
      }
      public boolean requestAccepted(){
        return true;
      }
      public IOutgoingFileTransfer getSource(){
        return SendFileTransfer.this;
      }
    }
);
  }
 catch (  final Exception e) {
    throw new SendFileTransferException(e);
  }
}

Fixed version (ground truth):
protected void openStreams() throws SendFileTransferException {
  try {
    setInputStream(new BufferedInputStream(new FileInputStream(getFileTransferInfo().getFile())));
    final IFileStore fileStore=EFS.getStore(new URI(getRemoteFileURL().getPath()));
    setOutputStream(fileStore.openOutputStream(0,null));
  }
 catch (  final Exception e) {
    throw new SendFileTransferException(e);
  }
}
Program: 94745
Project: 94745
Buggy source:
protected void setupAndScheduleJob(){
  job=new FileTransferJob(getRemoteFileURL().toString());
  job.schedule();
}

Fixed version (ground truth):
protected void setupAndScheduleJob(){
  if (fileTransferJob == null)   fileTransferJob=new FileTransferJob(createJobName());
  fileTransferJob.setFileTransferRunnable(fileTransferRunnable);
  job=fileTransferJob;
  job.schedule();
}
Program: 94746
Project: 94746
Buggy source:
protected void fireSendStartEvent(){
  listener.handleTransferEvent(new IOutgoingFileTransferResponseEvent(){
    private static final long serialVersionUID=2171381825030082432L;
    public String toString(){
      final StringBuffer sb=new StringBuffer("String_Node_Str");
      sb.append("String_Node_Str").append(done).append("String_Node_Str");
      sb.append("String_Node_Str").append(bytesSent).append("String_Node_Str");
      return sb.toString();
    }
    public boolean requestAccepted(){
      return true;
    }
    public IOutgoingFileTransfer getSource(){
      return AbstractOutgoingFileTransfer.this;
    }
  }
);
}

Fixed version (ground truth):
protected void fireSendStartEvent(){
  listener.handleTransferEvent(new IOutgoingFileTransferResponseEvent(){
    private static final long serialVersionUID=2171381825030082432L;
    public String toString(){
      final StringBuffer sb=new StringBuffer("String_Node_Str");
      sb.append("String_Node_Str").append(done).append("String_Node_Str");
      sb.append("String_Node_Str").append(bytesSent).append("String_Node_Str");
      return sb.toString();
    }
    public boolean requestAccepted(){
      return true;
    }
    public IOutgoingFileTransfer getSource(){
      return AbstractOutgoingFileTransfer.this;
    }
    public void setFileTransferJob(    org.eclipse.ecf.filetransfer.FileTransferJob ftj){
      AbstractOutgoingFileTransfer.this.fileTransferJob=ftj;
    }
  }
);
}
Program: 94747
Project: 94747
Buggy source:
protected void openStreams() throws SendFileTransferException {
  try {
    File localFile=getFileTransferInfo().getFile();
    setInputStream(new BufferedInputStream(new FileInputStream(localFile)));
    connect();
    setOutputStream(urlConnection.getOutputStream());
    fireSendStartEvent();
  }
 catch (  final Exception e) {
    throw new SendFileTransferException(NLS.bind(Messages.UrlConnectionOutgoingFileTransfer_EXCEPTION_COULD_NOT_CONNECT,getRemoteFileURL().toString()),e);
  }
}

Fixed version (ground truth):
protected void openStreams() throws SendFileTransferException {
  try {
    File localFile=getFileTransferInfo().getFile();
    setInputStream(new BufferedInputStream(new FileInputStream(localFile)));
    connect();
    setOutputStream(urlConnection.getOutputStream());
  }
 catch (  final Exception e) {
    throw new SendFileTransferException(NLS.bind(Messages.UrlConnectionOutgoingFileTransfer_EXCEPTION_COULD_NOT_CONNECT,getRemoteFileURL().toString()),e);
  }
}
Program: 94748
Project: 94748
Buggy source:
protected void openStreams() throws SendFileTransferException {
  IFileTransferInfo localFileTransferInfo=getFileTransferInfo();
  Assert.isNotNull(localFileTransferInfo);
  File inputFile=localFileTransferInfo.getFile();
  try {
    setInputStream(new BufferedInputStream(new FileInputStream(inputFile)));
  }
 catch (  Exception e) {
    hardClose();
    throw new SendFileTransferException(NLS.bind(Messages.LocalFileOutgoingFileTransfer_EXCEPTION_OPENING_FOR_INPUT,inputFile));
  }
  URL url=getRemoteFileURL();
  Assert.isNotNull(url);
  try {
    File outputFile=new File(url.getPath());
    setOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
  }
 catch (  Exception e) {
    hardClose();
    throw new SendFileTransferException(NLS.bind(Messages.LocalFileOutgoingFileTransfer_EXCEPTION_OPENING_FOR_OUTPUT,url));
  }
  fireSendStartEvent();
}

Fixed version (ground truth):
protected void openStreams() throws SendFileTransferException {
  IFileTransferInfo localFileTransferInfo=getFileTransferInfo();
  Assert.isNotNull(localFileTransferInfo);
  File inputFile=localFileTransferInfo.getFile();
  try {
    setInputStream(new BufferedInputStream(new FileInputStream(inputFile)));
  }
 catch (  Exception e) {
    hardClose();
    throw new SendFileTransferException(NLS.bind(Messages.LocalFileOutgoingFileTransfer_EXCEPTION_OPENING_FOR_INPUT,inputFile));
  }
  URL url=getRemoteFileURL();
  Assert.isNotNull(url);
  try {
    File outputFile=new File(url.getPath());
    setOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
  }
 catch (  Exception e) {
    hardClose();
    throw new SendFileTransferException(NLS.bind(Messages.LocalFileOutgoingFileTransfer_EXCEPTION_OPENING_FOR_OUTPUT,url));
  }
}
Program: 94749
Project: 94749
Buggy source:
protected void openStreams() throws SendFileTransferException {
  try {
    final File localFile=getFileTransferInfo().getFile();
    setInputStream(new BufferedInputStream(new FileInputStream(localFile)));
    final URL url=getRemoteFileURL();
    this.username=url.getUserInfo();
    scpUtil=new ScpUtil(this);
    final Session s=scpUtil.getSession();
    s.connect();
    final String targetFileName=scpUtil.trimTargetFile(url.getPath());
    final String command=SCP_COMMAND + targetFileName;
    channel=s.openChannel(SCP_EXEC);
    ((ChannelExec)channel).setCommand(command);
    final OutputStream outs=channel.getOutputStream();
    responseStream=channel.getInputStream();
    channel.connect();
    scpUtil.checkAck(responseStream);
    sendFileNameAndSize(localFile,targetFileName,outs,responseStream);
    setOutputStream(outs);
    fireSendStartEvent();
  }
 catch (  final Exception e) {
    throw new SendFileTransferException(NLS.bind(Messages.ScpOutgoingFileTransfer_EXCEPTION_CONNECTING,getRemoteFileURL().toString()),e);
  }
}

Fixed version (ground truth):
protected void openStreams() throws SendFileTransferException {
  try {
    final File localFile=getFileTransferInfo().getFile();
    setInputStream(new BufferedInputStream(new FileInputStream(localFile)));
    final URL url=getRemoteFileURL();
    this.username=url.getUserInfo();
    scpUtil=new ScpUtil(this);
    final Session s=scpUtil.getSession();
    s.connect();
    final String targetFileName=scpUtil.trimTargetFile(url.getPath());
    final String command=SCP_COMMAND + targetFileName;
    channel=s.openChannel(SCP_EXEC);
    ((ChannelExec)channel).setCommand(command);
    final OutputStream outs=channel.getOutputStream();
    responseStream=channel.getInputStream();
    channel.connect();
    scpUtil.checkAck(responseStream);
    sendFileNameAndSize(localFile,targetFileName,outs,responseStream);
    setOutputStream(outs);
  }
 catch (  final Exception e) {
    throw new SendFileTransferException(NLS.bind(Messages.ScpOutgoingFileTransfer_EXCEPTION_CONNECTING,getRemoteFileURL().toString()),e);
  }
}
Program: 94752
Project: 94752
Buggy source:
IServiceInfo createIServiceInfoFromServiceInfo(final ServiceInfo serviceInfo) throws Exception {
  if (serviceInfo == null)   return null;
  String st=serviceInfo.getType();
  String n=serviceInfo.getName();
  if (st == null || n == null)   throw new InvalidObjectException(Messages.JMDNSDiscoveryContainer_EXCEPTION_SERVICEINFO_INVALID);
  final ServiceID sID=createServiceID(serviceInfo.getType(),serviceInfo.getName());
  if (sID == null)   throw new InvalidObjectException(Messages.JMDNSDiscoveryContainer_EXCEPTION_SERVICEINFO_INVALID);
  final InetAddress addr=serviceInfo.getAddress();
  final int port=serviceInfo.getPort();
  final int priority=serviceInfo.getPriority();
  final int weight=serviceInfo.getWeight();
  final Properties props=new Properties();
  for (final Enumeration e=serviceInfo.getPropertyNames(); e.hasMoreElements(); ) {
    final String name=(String)e.nextElement();
    Object value=serviceInfo.getPropertyString(name);
    if (value == null)     value=serviceInfo.getPropertyBytes(name);
    if (value != null)     props.put(name,value);
  }
  final ServiceProperties svcProperties=new ServiceProperties(props);
  final IServiceInfo newInfo=new JMDNSServiceInfo(addr,sID,port,priority,weight,svcProperties);
  return newInfo;
}

Fixed version (ground truth):
IServiceInfo createIServiceInfoFromServiceInfo(final ServiceInfo serviceInfo) throws Exception {
  if (serviceInfo == null)   return null;
  String st=serviceInfo.getType();
  String n=serviceInfo.getName();
  if (st == null || n == null)   throw new InvalidObjectException(Messages.JMDNSDiscoveryContainer_EXCEPTION_SERVICEINFO_INVALID);
  final ServiceID sID=createServiceID(serviceInfo.getType(),serviceInfo.getName());
  if (sID == null)   throw new InvalidObjectException(Messages.JMDNSDiscoveryContainer_EXCEPTION_SERVICEINFO_INVALID);
  final InetAddress addr=serviceInfo.getAddress();
  final int port=serviceInfo.getPort();
  final int priority=serviceInfo.getPriority();
  final int weight=serviceInfo.getWeight();
  final Properties props=new Properties();
  String uriProtocol=null;
  for (final Enumeration e=serviceInfo.getPropertyNames(); e.hasMoreElements(); ) {
    final String name=(String)e.nextElement();
    if (name.equals(SCHEME_PROPERTY))     uriProtocol=serviceInfo.getPropertyString(name);
 else {
      Object value=serviceInfo.getPropertyString(name);
      if (value == null)       value=serviceInfo.getPropertyBytes(name);
      if (value != null)       props.put(name,value);
    }
  }
  return new org.eclipse.ecf.discovery.ServiceInfo(uriProtocol,addr.getHostAddress(),port,sID,priority,weight,new ServiceProperties(props));
}
Program: 94753
Project: 94753
Buggy source:
private ServiceInfo createServiceInfoFromIServiceInfo(IServiceInfo serviceInfo){
  if (serviceInfo == null)   return null;
  final IServiceID sID=serviceInfo.getServiceID();
  final Hashtable props=new Hashtable();
  final IServiceProperties svcProps=serviceInfo.getServiceProperties();
  if (svcProps != null) {
    for (final Enumeration e=svcProps.getPropertyNames(); e.hasMoreElements(); ) {
      final String key=(String)e.nextElement();
      final Object val=svcProps.getProperty(key);
      if (val != null) {
        props.put(key,val);
      }
    }
  }
  final ServiceInfo si=new ServiceInfo(sID.getServiceTypeID().getInternal(),sID.getServiceName(),serviceInfo.getLocation().getPort(),serviceInfo.getPriority(),serviceInfo.getWeight(),props);
  return si;
}

Fixed version (ground truth):
private ServiceInfo createServiceInfoFromIServiceInfo(IServiceInfo serviceInfo){
  if (serviceInfo == null)   return null;
  final IServiceID sID=serviceInfo.getServiceID();
  final Hashtable props=new Hashtable();
  final IServiceProperties svcProps=serviceInfo.getServiceProperties();
  if (svcProps != null) {
    for (final Enumeration e=svcProps.getPropertyNames(); e.hasMoreElements(); ) {
      final String key=(String)e.nextElement();
      final Object val=svcProps.getProperty(key);
      if (val != null) {
        props.put(key,val);
      }
    }
  }
  URI location=serviceInfo.getLocation();
  props.put(SCHEME_PROPERTY,location.getScheme());
  final ServiceInfo si=new ServiceInfo(sID.getServiceTypeID().getInternal(),sID.getServiceName(),location.getPort(),serviceInfo.getPriority(),serviceInfo.getWeight(),props);
  return si;
}
Program: 94754
Project: 94754
Buggy source:
private void hookActionBars(){
  final IActionBars bars=this.getViewSite().getActionBars();
  bars.getMenuManager().add(refreshAction);
  bars.getToolBarManager().add(refreshAction);
}

Fixed version (ground truth):
private void hookActionBars(){
  final IActionBars bars=this.getViewSite().getActionBars();
  bars.getToolBarManager().add(refreshAction);
}
Program: 94757
Project: 94757
Buggy source:
private void registerRemoteService(String className,Object service){
  try {
    final IRemoteServiceContainerAdapter containerAdapter=(IRemoteServiceContainerAdapter)serviceHostContainer.getAdapter(IRemoteServiceContainerAdapter.class);
    Assert.isNotNull(containerAdapter);
    containerAdapter.registerRemoteService(new String[]{className},service,new RemoteServiceProperties(ECF_GENERIC_CLIENT,serviceHostContainer));
    System.out.println("String_Node_Str" + className);
    final String serviceName=System.getProperty("String_Node_Str") + System.currentTimeMillis();
    final IServiceID serviceID=ServiceIDFactory.getDefault().createServiceID(discovery.getServicesNamespace(),REMOTE_SERVICE_TYPE,serviceName);
    serviceInfo=new ServiceInfo(null,80,serviceID,new ServiceProperties(new DiscoveryProperties(className,ECF_GENERIC_CLIENT,serviceHostContainer)));
    discovery.registerService(serviceInfo);
    System.out.println("String_Node_Str" + serviceID);
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void registerRemoteService(String className,Object service){
  try {
    final IRemoteServiceContainerAdapter containerAdapter=(IRemoteServiceContainerAdapter)serviceHostContainer.getAdapter(IRemoteServiceContainerAdapter.class);
    Assert.isNotNull(containerAdapter);
    containerAdapter.registerRemoteService(new String[]{className},service,new RemoteServiceProperties(ECF_GENERIC_CLIENT,serviceHostContainer));
    System.out.println("String_Node_Str" + className);
    final String serviceName=System.getProperty("String_Node_Str") + System.currentTimeMillis();
    final IServiceID serviceID=ServiceIDFactory.getDefault().createServiceID(discovery.getServicesNamespace(),REMOTE_SERVICE_TYPE,serviceName);
    serviceInfo=new ServiceInfo(Constants.DISCOVERY_SERVICE_TYPE,null,80,serviceID,new ServiceProperties(new DiscoveryProperties(className,ECF_GENERIC_CLIENT,serviceHostContainer)));
    discovery.registerService(serviceInfo);
    System.out.println("String_Node_Str" + serviceID);
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
}
Program: 94758
Project: 94758
Buggy source:
private void registerService(String serviceType1,String serviceName1,String updateSiteName1,String servicePath1) throws Exception {
  try {
    serviceInfo=new ServiceInfo(null,getServicePort(),ServiceIDFactory.getDefault().createServiceID(discovery.getServicesNamespace(),serviceType1,serviceName1),new ServiceProperties(new UpdateSiteProperties(serviceName1,servicePath1).toProperties()));
    discovery.registerService(serviceInfo);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    throw e;
  }
}

Fixed version (ground truth):
private void registerService(String serviceType1,String serviceName1,String updateSiteName1,String servicePath1) throws Exception {
  try {
    serviceInfo=new ServiceInfo(UPDATE_SITE_SERVICE_TYPE,null,getServicePort(),ServiceIDFactory.getDefault().createServiceID(discovery.getServicesNamespace(),serviceType1,serviceName1),new ServiceProperties(new UpdateSiteProperties(serviceName1,servicePath1).toProperties()));
    discovery.registerService(serviceInfo);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    throw e;
  }
}
Program: 94759
Project: 94759
Buggy source:
protected IDiscoveryContainerAdapter getAdapter(Class clazz){
  IDiscoveryService discoveryService=Activator.getDefault().getDiscoveryService();
  assertNotNull(discoveryService);
  return discoveryService;
}

Fixed version (ground truth):
protected IDiscoveryContainerAdapter getAdapter(Class clazz){
  final IDiscoveryService discoveryService=Activator.getDefault().getDiscoveryService();
  assertNotNull(discoveryService);
  return discoveryService;
}
Program: 94760
Project: 94760
Buggy source:
/** 
 * @param name
 */
public DiscoveryServiceTest(String name,long aDiscoveryContainerInterval){
  super(name,aDiscoveryContainerInterval);
}

Fixed version (ground truth):
/** 
 * @param name
 * @param aDiscoveryContainerInterval 
 */
public DiscoveryServiceTest(String name,long aDiscoveryContainerInterval){
  super(name,aDiscoveryContainerInterval);
}
Program: 94761
Project: 94761
Buggy source:
/** 
 * Test method for   {@link org.eclipse.ecf.discovery.ServiceInfo()}.
 */
public void testServiceInfo(){
  IServiceInfo si=null;
  try {
    si=getServiceInfo(serviceInfo);
  }
 catch (  IDCreateException e) {
    fail();
  }
catch (  SecurityException e) {
    fail();
  }
  assertTrue(serviceInfoComparator.compare(si,serviceInfo) == 0);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.ecf.discovery.ServiceInfo}.
 */
public void testServiceInfo(){
  IServiceInfo si=null;
  try {
    si=getServiceInfo(serviceInfo);
  }
 catch (  final IDCreateException e) {
    fail();
  }
catch (  final SecurityException e) {
    fail();
  }
  assertTrue(serviceInfoComparator.compare(si,serviceInfo) == 0);
}
Program: 94762
Project: 94762
Buggy source:
/** 
 * Test method for   {@link org.eclipse.ecf.discovery.ServiceInfo#getServiceProperties()}.
 */
public void testGetServiceProperties(){
  IServiceProperties sprops=serviceInfo.getServiceProperties();
  assertEquals(sprops,serviceProperties);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.ecf.discovery.ServiceInfo#getServiceProperties()}.
 */
public void testGetServiceProperties(){
  final IServiceProperties sprops=serviceInfo.getServiceProperties();
  assertEquals(sprops,serviceProperties);
}
Program: 94763
Project: 94763
Buggy source:
public void handleRoomMessage(IChatRoomMessage message){
  ID fromID=message.getFromID();
  if (fromID.getName().equals("String_Node_Str")) {
    return;
  }
  String msg=message.getMessage();
switch (msg.charAt(0)) {
case '~':
case '!':
    handleMessage(fromID,message.getChatRoomID(),msg.substring(1).trim());
  break;
default :
String upperCase=msg.toUpperCase();
if (upperCase.startsWith("String_Node_Str") || upperCase.startsWith("String_Node_Str")) {
msg=upperCase.substring(8).trim();
switch (msg.charAt(0)) {
case '~':
case '!':
  handleMessage(fromID,message.getChatRoomID(),msg.substring(1).trim());
break;
}
}
 else {
String[] split=msg.split("String_Node_Str");
for (int i=0; i < split.length; i++) {
switch (split[i].charAt(0)) {
case '~':
case '!':
handleMessage(fromID,message.getChatRoomID(),split[i].substring(1).trim());
break;
}
}
}
break;
}
}

Fixed version (ground truth):
public void handleRoomMessage(IChatRoomMessage message){
  ID fromID=message.getFromID();
  String name=fromID.getName();
  if (name.charAt(0) == '#' || name.equals("String_Node_Str")) {
    return;
  }
  String msg=message.getMessage();
switch (msg.charAt(0)) {
case '~':
case '!':
    handleMessage(fromID,message.getChatRoomID(),msg.substring(1).trim());
  break;
default :
String upperCase=msg.toUpperCase();
if (upperCase.startsWith("String_Node_Str") || upperCase.startsWith("String_Node_Str")) {
msg=upperCase.substring(8).trim();
switch (msg.charAt(0)) {
case '~':
case '!':
  handleMessage(fromID,message.getChatRoomID(),msg.substring(1).trim());
break;
}
}
 else {
String[] split=msg.split("String_Node_Str");
for (int i=0; i < split.length; i++) {
if (split[i].length() > 0) {
switch (split[i].charAt(0)) {
case '~':
case '!':
  handleMessage(fromID,message.getChatRoomID(),split[i].substring(1).trim());
break;
}
}
}
}
break;
}
}
Program: 94764
Project: 94764
Buggy source:
private void sendWiki(ID roomID,String target,String articleName){
  articleName=articleName.replace(' ','_');
  if (target == null) {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.Wiki),articleName));
  }
 else {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.Wiki_Reply),target,articleName));
  }
}

Fixed version (ground truth):
private void sendWiki(ID roomID,String target,String articleName){
  articleName=articleName.replace(' ','_');
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + NLS.bind(CustomMessages.getString(CustomMessages.Wiki),articleName));
}
Program: 94765
Project: 94765
Buggy source:
private void sendMessageList(ID roomID,String target){
  if (target == null) {
    sendMessage(roomID,CustomMessages.getString(CustomMessages.MessageList));
  }
 else {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.MessageList_Reply),target));
  }
}

Fixed version (ground truth):
private void sendMessageList(ID roomID,String target){
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + CustomMessages.getString(CustomMessages.MessageList));
}
Program: 94766
Project: 94766
Buggy source:
private void sendGoogle(ID roomID,String target,String searchString){
  searchString=searchString.replace(' ','+');
  if (target == null) {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.Google),searchString));
  }
 else {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.Google_Reply),target,searchString));
  }
}

Fixed version (ground truth):
private void sendGoogle(ID roomID,String target,String searchString){
  searchString=searchString.replace(' ','+');
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + NLS.bind(CustomMessages.getString(CustomMessages.Google),searchString));
}
Program: 94768
Project: 94768
Buggy source:
private void sendJavaDoc(ID roomID,String target,String parameter){
  String append=target == null ? "String_Node_Str" : target + "String_Node_Str";
  String message=null;
  int index=parameter.indexOf('#');
  if (index == -1) {
    message=analyzer.getJavadocs(parameter);
  }
 else {
    String className=parameter.substring(0,index);
    parameter=parameter.substring(index + 1);
    index=parameter.indexOf('(');
    if (index == -1) {
      message=className + '#' + parameter+ "String_Node_Str"+ analyzer.getJavadocs(className,parameter);
    }
 else {
      String method=parameter.substring(0,index);
      parameter=parameter.substring(index + 1);
      parameter=parameter.substring(0,parameter.indexOf(')'));
      String[] parameters=parameter.split("String_Node_Str");
      for (int i=0; i < parameters.length; i++) {
        parameters[i]=parameters[i].trim();
      }
      message=className + '#' + method+ "String_Node_Str"+ analyzer.getJavadocs(className,method,parameters);
    }
  }
  sendMessage(roomID,append + message);
}

Fixed version (ground truth):
private void sendJavaDoc(ID roomID,String target,String parameter){
  String message=null;
  int index=parameter.indexOf('#');
  if (index == -1) {
    message=analyzer.getJavadocs(parameter);
  }
 else {
    String className=parameter.substring(0,index);
    parameter=parameter.substring(index + 1);
    index=parameter.indexOf('(');
    if (index == -1) {
      message=className + '#' + parameter+ "String_Node_Str"+ analyzer.getJavadocs(className,parameter);
    }
 else {
      String method=parameter.substring(0,index);
      parameter=parameter.substring(index + 1);
      parameter=parameter.substring(0,parameter.indexOf(')'));
      String[] parameters=parameter.split("String_Node_Str");
      for (int i=0; i < parameters.length; i++) {
        parameters[i]=parameters[i].trim();
      }
      message=className + '#' + method+ "String_Node_Str"+ analyzer.getJavadocs(className,method,parameters);
    }
  }
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + message);
}
Program: 94769
Project: 94769
Buggy source:
private void sendNewsgroupSearch(ID roomID,String target,String query){
  String[] strings=query.split("String_Node_Str");
  if (strings.length == 1) {
    return;
  }
  for (int i=0; i < strings.length; i++) {
    try {
      strings[i]=URLEncoder.encode(strings[i].trim(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      strings[i]=URLEncoder.encode(strings[i].trim());
    }
  }
  String newsgroup=(String)newsgroups.get(strings[0]);
  if (target == null) {
    StringBuffer buffer=new StringBuffer();
synchronized (buffer) {
      for (int i=1; i < strings.length; i++) {
        buffer.append(strings[i] + '+');
      }
      buffer.deleteCharAt(buffer.length() - 1);
    }
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.NewsgroupSearch),buffer.toString(),newsgroup));
  }
 else {
    StringBuffer buffer=new StringBuffer();
synchronized (buffer) {
      for (int i=1; i < strings.length; i++) {
        buffer.append(strings[i] + '+');
      }
      buffer.deleteCharAt(buffer.length() - 1);
    }
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.NewsgroupSearch_Reply),new Object[]{target,buffer.toString(),newsgroup}));
  }
}

Fixed version (ground truth):
private void sendNewsgroupSearch(ID roomID,String target,String query){
  String[] strings=query.split("String_Node_Str");
  if (strings.length == 1) {
    sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + CustomMessages.getString(CustomMessages.NewsgroupSearch_Invalid));
    return;
  }
  for (int i=0; i < strings.length; i++) {
    System.out.println(i + "String_Node_Str" + strings[i]);
    try {
      strings[i]=URLEncoder.encode(strings[i].trim(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      strings[i]=URLEncoder.encode(strings[i].trim());
    }
  }
  String newsgroup=strings[0].startsWith("String_Node_Str") ? "String_Node_Str" + strings[0] : (String)newsgroups.get(strings[0]);
  if (newsgroup == null) {
    sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + CustomMessages.getString(CustomMessages.NewsgroupSearch_InvalidGroup));
    return;
  }
  StringBuffer buffer=new StringBuffer();
synchronized (buffer) {
    for (int i=1; i < strings.length; i++) {
      buffer.append(strings[i] + '+');
    }
    buffer.deleteCharAt(buffer.length() - 1);
  }
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + NLS.bind(CustomMessages.getString(CustomMessages.NewsgroupSearch),newsgroup,buffer.toString()));
}
Program: 94770
Project: 94770
Buggy source:
private void sendEclipseHelp(ID roomID,String target,String searchString){
  searchString=searchString.replace(' ','+');
  if (target == null) {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.EclipseHelp),searchString));
  }
 else {
    sendMessage(roomID,NLS.bind(CustomMessages.getString(CustomMessages.EclipseHelp_Reply),target,searchString));
  }
}

Fixed version (ground truth):
private void sendEclipseHelp(ID roomID,String target,String searchString){
  searchString=searchString.replace(' ','+');
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + NLS.bind(CustomMessages.getString(CustomMessages.EclipseHelp),searchString));
}
Program: 94771
Project: 94771
Buggy source:
private String formatTableRow(String key,String val){
  return "String_Node_Str" + key + "String_Node_Str"+ text2html(val)+ "String_Node_Str";
}

Fixed version (ground truth):
private String formatTableRow(String key,String val){
  return "String_Node_Str" + key.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str"+ text2html(val)+ "String_Node_Str";
}
Program: 94772
Project: 94772
Buggy source:
private String text2html(String val){
  StringTokenizer st=new StringTokenizer(val,"String_Node_Str",true);
  StringBuffer sb=new StringBuffer();
  while (st.hasMoreTokens()) {
    String tok=st.nextToken();
    Matcher patternMatcher=URL_PATTERN.matcher(tok);
    if (patternMatcher.matches()) {
      sb.append("String_Node_Str");
      sb.append(patternMatcher.group(1));
      sb.append("String_Node_Str");
      sb.append(patternMatcher.group(1));
      sb.append("String_Node_Str");
    }
 else {
      Matcher cmdMatcher=CMD_PATTERN.matcher(tok);
      if (cmdMatcher.matches()) {
        sb.append("String_Node_Str");
        sb.append(cmdMatcher.group(1));
        sb.append("String_Node_Str");
      }
 else {
        sb.append(tok);
      }
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
private String text2html(String val){
  StringTokenizer st=new StringTokenizer(val,"String_Node_Str",true);
  StringBuffer sb=new StringBuffer();
  while (st.hasMoreTokens()) {
    String tok=st.nextToken();
    Matcher patternMatcher=URL_PATTERN.matcher(tok);
    if (patternMatcher.matches()) {
      sb.append("String_Node_Str");
      sb.append(patternMatcher.group(1));
      sb.append("String_Node_Str");
      if (patternMatcher.group(1).length() >= 120) {
        StringTokenizer st2=new StringTokenizer(patternMatcher.group(1),"String_Node_Str",true);
        StringBuffer sb2=new StringBuffer();
        while (st2.hasMoreTokens()) {
          sb2.append(st2.nextToken());
          if (sb2.length() >= 100) {
            sb2.append("String_Node_Str");
          }
        }
        sb.append(sb2.toString().replaceAll(BINDING_REGEX,"String_Node_Str"));
      }
 else {
        sb.append(patternMatcher.group(1).replaceAll(BINDING_REGEX,"String_Node_Str"));
      }
      sb.append("String_Node_Str");
    }
 else {
      Matcher cmdMatcher=CMD_PATTERN.matcher(tok);
      if (cmdMatcher.matches()) {
        sb.append("String_Node_Str");
        sb.append(cmdMatcher.group(1));
        sb.append("String_Node_Str");
      }
 else {
        Matcher bindingMatcher=BINDING_PATTERN.matcher(tok);
        if (bindingMatcher.matches()) {
          sb.append("String_Node_Str");
          sb.append(bindingMatcher.group(1));
          sb.append("String_Node_Str");
        }
 else {
          sb.append(tok);
        }
      }
    }
  }
  return sb.toString();
}
Program: 94773
Project: 94773
Buggy source:
private boolean isProcessed(ID roomID,String target,String msg){
  String reply=(String)messages.get(msg);
  if (reply == null) {
    return false;
  }
  if (target == null) {
    sendMessage(roomID,reply);
  }
 else {
    sendMessage(roomID,target + "String_Node_Str" + reply);
  }
  return true;
}

Fixed version (ground truth):
private boolean isProcessed(ID roomID,String target,String msg){
  String reply=(String)messages.get(msg);
  if (reply == null) {
    return false;
  }
  sendMessage(roomID,(target != null ? target + "String_Node_Str" : "String_Node_Str") + reply);
  return true;
}
Program: 94775
Project: 94775
Buggy source:
public int getResponseCode(){
  if (responseCode != -1)   return responseCode;
  if (isHTTP()) {
    final String response=urlConnection.getHeaderField(0);
    if (response == null) {
      responseCode=-1;
      httpVersion=1;
      return responseCode;
    }
    if (response == null || !response.startsWith("String_Node_Str"))     return -1;
    response.trim();
    final int mark=response.indexOf("String_Node_Str") + 1;
    if (mark == 0)     return -1;
    if (response.charAt(mark - 2) != '1')     httpVersion=0;
    int last=mark + 3;
    if (last > response.length())     last=response.length();
    responseCode=Integer.parseInt(response.substring(mark,last));
    if (last + 1 <= response.length())     responseMessage=response.substring(last + 1);
  }
 else {
    responseCode=OK_RESPONSE_CODE;
    responseMessage="String_Node_Str";
  }
  return responseCode;
}

Fixed version (ground truth):
public int getResponseCode(){
  if (responseCode != -1)   return responseCode;
  if (isHTTP()) {
    String response=urlConnection.getHeaderField(0);
    if (response == null) {
      responseCode=-1;
      httpVersion=1;
      return responseCode;
    }
    if (!response.startsWith("String_Node_Str"))     return -1;
    response=response.trim();
    final int mark=response.indexOf("String_Node_Str") + 1;
    if (mark == 0)     return -1;
    if (response.charAt(mark - 2) != '1')     httpVersion=0;
    int last=mark + 3;
    if (last > response.length())     last=response.length();
    responseCode=Integer.parseInt(response.substring(mark,last));
    if (last + 1 <= response.length())     responseMessage=response.substring(last + 1);
  }
 else {
    responseCode=OK_RESPONSE_CODE;
    responseMessage="String_Node_Str";
  }
  return responseCode;
}
Program: 94776
Project: 94776
Buggy source:
/** 
 * Returns the string resulting from replacing all occurrences of the target with the replace string.  Note that the target matches literally, and this is not the same behavior as the  String.replaceAll, which uses regular expressions for doing the matching.  
 * @param string the start string.  Must not be <code>null</code>.
 * @param target the target to search for in the start string.  Must not be <code>null</code>.
 * @param replace the replacement string to substitute when the target is found.  Must not be <code>null</code>.
 * @return String result.  Will not be <code>null</code>.   If target is not found in the given string,then the result will be the entire input string.  
 */
public static String replaceAll(String string,String target,String replace){
  final int index=string.indexOf(target);
  if (index == -1)   return string;
  return string.substring(0,index) + replace + replaceAll(string.substring(index + replace.length()),target,replace);
}

Fixed version (ground truth):
/** 
 * Returns the string resulting from replacing all occurrences of the target with the replace string.  Note that the target matches literally, and this is not the same behavior as the  String.replaceAll, which uses regular expressions for doing the matching.  
 * @param string the start string.  Must not be <code>null</code>.
 * @param target the target to search for in the start string.  Must not be <code>null</code>.
 * @param replace the replacement string to substitute when the target is found.  Must not be <code>null</code>.
 * @return String result.  Will not be <code>null</code>.   If target is not found in the given string,then the result will be the entire input string.  
 */
public static String replaceAll(String string,String target,String replace){
  final int index=string.indexOf(target);
  if (index == -1)   return string;
  return string.substring(0,index) + replace + replaceAll(string.substring(index + target.length()),target,replace);
}
Program: 94777
Project: 94777
Buggy source:
public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter,String clazz,String filter){
  return registry.getRemoteServiceReferences(idFilter,clazz,filter);
}

Fixed version (ground truth):
public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter,String clazz,String filter) throws InvalidSyntaxException {
  return registry.getRemoteServiceReferences(idFilter,clazz,filter);
}
Program: 94778
Project: 94778
Buggy source:
protected IRemoteServiceReference[] getRemoteServiceReferences(IRemoteServiceContainerAdapter adapter,String clazz){
  return adapter.getRemoteServiceReferences(null,clazz,null);
}

Fixed version (ground truth):
protected IRemoteServiceReference[] getRemoteServiceReferences(IRemoteServiceContainerAdapter adapter,String clazz){
  try {
    return adapter.getRemoteServiceReferences(null,clazz,null);
  }
 catch (  final InvalidSyntaxException e) {
    fail("String_Node_Str");
  }
  return null;
}
Program: 94779
Project: 94779
Buggy source:
protected IRemoteServiceRegistration registerService(IRemoteServiceContainerAdapter adapter,String serviceInterface,Object service,int sleepTime){
  IRemoteServiceRegistration result=adapter.registerRemoteService(new String[]{serviceInterface},service,null);
  sleep(sleepTime);
  return result;
}

Fixed version (ground truth):
protected IRemoteServiceRegistration registerService(IRemoteServiceContainerAdapter adapter,String serviceInterface,Object service,int sleepTime){
  final IRemoteServiceRegistration result=adapter.registerRemoteService(new String[]{serviceInterface},service,null);
  sleep(sleepTime);
  return result;
}
Program: 94780
Project: 94780
Buggy source:
protected IRemoteService getRemoteService(IRemoteServiceContainerAdapter adapter,String clazz){
  IRemoteServiceReference[] refs=getRemoteServiceReferences(adapter,clazz);
  if (refs.length == 0)   return null;
  return adapter.getRemoteService(refs[0]);
}

Fixed version (ground truth):
protected IRemoteService getRemoteService(IRemoteServiceContainerAdapter adapter,String clazz){
  final IRemoteServiceReference[] refs=getRemoteServiceReferences(adapter,clazz);
  if (refs.length == 0)   return null;
  return adapter.getRemoteService(refs[0]);
}
Program: 94781
Project: 94781
Buggy source:
protected void setupRemoteServiceAdapters() throws Exception {
  int clientCount=getClientCount();
  for (int i=0; i < clientCount; i++) {
    adapters[i]=(IRemoteServiceContainerAdapter)getClients()[i].getAdapter(IRemoteServiceContainerAdapter.class);
  }
}

Fixed version (ground truth):
protected void setupRemoteServiceAdapters() throws Exception {
  final int clientCount=getClientCount();
  for (int i=0; i < clientCount; i++) {
    adapters[i]=(IRemoteServiceContainerAdapter)getClients()[i].getAdapter(IRemoteServiceContainerAdapter.class);
  }
}
Program: 94782
Project: 94782
Buggy source:
protected IRemoteService registerAndGetRemoteService(){
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  final ID targetID=getClients()[1].getConnectedID();
  final String serviceName=IConcatService.class.getName();
  final Dictionary props=new Hashtable();
  props.put(Constants.SERVICE_REGISTRATION_TARGETS,targetID);
  adapters[0].registerRemoteService(new String[]{serviceName},createService(),props);
  sleep(1500);
  final IRemoteServiceContainerAdapter adapter=adapters[1];
  final IRemoteServiceReference[] refs=adapter.getRemoteServiceReferences(null,serviceName,null);
  if (refs.length == 0)   return null;
  return adapter.getRemoteService(refs[0]);
}

Fixed version (ground truth):
protected IRemoteService registerAndGetRemoteService() throws Exception {
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  final ID targetID=getClients()[1].getConnectedID();
  final String serviceName=IConcatService.class.getName();
  final Dictionary props=new Hashtable();
  props.put(Constants.SERVICE_REGISTRATION_TARGETS,targetID);
  adapters[0].registerRemoteService(new String[]{serviceName},createService(),props);
  sleep(1500);
  final IRemoteServiceContainerAdapter adapter=adapters[1];
  final IRemoteServiceReference[] refs=adapter.getRemoteServiceReferences(null,serviceName,null);
  if (refs.length == 0)   return null;
  return adapter.getRemoteService(refs[0]);
}
Program: 94784
Project: 94784
Buggy source:
/** 
 * This method is called upon plug-in activation
 * @param context 
 * @throws Exception 
 */
public void start(BundleContext context) throws Exception {
  this.context=context;
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 * @param context 
 * @throws Exception 
 */
public void start(BundleContext context) throws Exception {
  this.context=context;
  services=new HashMap();
}
Program: 94785
Project: 94785
Buggy source:
public void disconnect(){
  final ID groupID=getConnectedID();
  fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (getConnectLock()) {
    if (isConnected()) {
      final ISynchAsynchConnection conn=getConnection();
synchronized (conn) {
synchronized (getGroupMembershipLock()) {
          handleLeave(groupID,conn);
        }
      }
    }
    this.connection=null;
    remoteServerID=null;
    accountManager.setConnection(null);
    chatRoomManager.setConnection(null,null,null);
    outgoingFileTransferContainerAdapter.setConnection(null);
    presenceHelper.disconnect();
    getSharedObjectManager().removeSharedObject(presenceHelperID);
  }
  fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
}

Fixed version (ground truth):
public void disconnect(){
  final ID groupID=getConnectedID();
  fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (getConnectLock()) {
    if (isConnected()) {
      XmppPlugin.getDefault().unregisterService(this);
      final ISynchAsynchConnection conn=getConnection();
synchronized (conn) {
synchronized (getGroupMembershipLock()) {
          handleLeave(groupID,conn);
        }
      }
    }
    this.connection=null;
    remoteServerID=null;
    accountManager.setConnection(null);
    chatRoomManager.setConnection(null,null,null);
    outgoingFileTransferContainerAdapter.setConnection(null);
    presenceHelper.disconnect();
    getSharedObjectManager().removeSharedObject(presenceHelperID);
  }
  fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
}
Program: 94786
Project: 94786
Buggy source:
public void connect(ID remote,IConnectContext joinContext) throws ContainerConnectException {
  try {
    getSharedObjectManager().addSharedObject(presenceHelperID,presenceHelper,null);
    super.connect(remote,joinContext);
  }
 catch (  final ContainerConnectException e) {
    disconnect();
    throw e;
  }
catch (  final SharedObjectAddException e1) {
    disconnect();
    throw new ContainerConnectException(NLS.bind(Messages.XMPPContainer_EXCEPTION_ADDING_SHARED_OBJECT,presenceHelperID),e1);
  }
}

Fixed version (ground truth):
public void connect(ID remote,IConnectContext joinContext) throws ContainerConnectException {
  try {
    getSharedObjectManager().addSharedObject(presenceHelperID,presenceHelper,null);
    super.connect(remote,joinContext);
    XmppPlugin.getDefault().registerService(this);
  }
 catch (  final ContainerConnectException e) {
    disconnect();
    throw e;
  }
catch (  final SharedObjectAddException e1) {
    disconnect();
    throw new ContainerConnectException(NLS.bind(Messages.XMPPContainer_EXCEPTION_ADDING_SHARED_OBJECT,presenceHelperID),e1);
  }
}
Program: 94788
Project: 94788
Buggy source:
/** 
 * Sends a message to the users connected to this chat session.
 * @param message the message to be sent
 * @throws IOException If an I/O occurs when sending the message to the server
 */
public void sendMessage(String message) throws IOException {
  message="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ message;
  write("String_Node_Str","String_Node_Str" + message.length() + "String_Node_Str"+ message,false);
}

Fixed version (ground truth):
/** 
 * Sends a message to the users connected to this chat session.
 * @param message the message to be sent
 * @throws IOException If an I/O occurs when sending the message to the server
 */
public void sendMessage(String message) throws IOException {
  message="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ message;
  write("String_Node_Str","String_Node_Str" + message.getBytes("String_Node_Str").length + "String_Node_Str"+ message,false);
}