nus-yam/ex-repair huggingface dataset:
Program: 94478
Project: 94478
Buggy source:
private void processFutureForRemoteServiceReferences(final ServiceEndpointDescriptionHelper sedh,final IFuture futureRemoteReferences,final ContainerHelper ch){
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        IRemoteServiceReference[] remoteReferences=(IRemoteServiceReference[])futureRemoteReferences.get(sedh.getFutureTimeout());
        IStatus futureStatus=futureRemoteReferences.getStatus();
        if (futureStatus.isOK()) {
          trace("String_Node_Str","String_Node_Str" + ch + "String_Node_Str"+ ((remoteReferences == null) ? "String_Node_Str" : Arrays.asList(remoteReferences)));
          if (remoteReferences != null) {
            registerRemoteServiceReferences(sedh,ch,remoteReferences);
          }
        }
 else {
          logError("String_Node_Str" + futureStatus.getMessage(),futureStatus.getException());
        }
      }
 catch (      InterruptedException e) {
        logError("String_Node_Str",e);
      }
catch (      OperationCanceledException e) {
        logError("String_Node_Str",e);
      }
catch (      TimeoutException e) {
        logError("String_Node_Str" + e.getDuration(),e);
      }
    }
  }
);
  t.start();
}

Fixed version (ground truth):
private void processFutureForRemoteServiceReferences(final ServiceEndpointDescriptionHelper sedh,final IFuture futureRemoteReferences,final ContainerHelper ch){
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        IRemoteServiceReference[] remoteReferences=(IRemoteServiceReference[])futureRemoteReferences.get(sedh.getFutureTimeout());
        IStatus futureStatus=futureRemoteReferences.getStatus();
        if (futureStatus.isOK()) {
          trace("String_Node_Str","String_Node_Str" + ch + "String_Node_Str"+ ((remoteReferences == null) ? "String_Node_Str" : Arrays.asList(remoteReferences).toString()));
          if (remoteReferences != null) {
            registerRemoteServiceReferences(sedh,ch,remoteReferences);
          }
        }
 else {
          logError("String_Node_Str" + futureStatus.getMessage(),futureStatus.getException());
        }
      }
 catch (      InterruptedException e) {
        logError("String_Node_Str",e);
      }
catch (      OperationCanceledException e) {
        logError("String_Node_Str",e);
      }
catch (      TimeoutException e) {
        logError("String_Node_Str" + e.getDuration(),e);
      }
    }
  }
);
  t.start();
}
Program: 94479
Project: 94479
Buggy source:
public void run(){
  try {
    IRemoteServiceReference[] remoteReferences=(IRemoteServiceReference[])futureRemoteReferences.get(sedh.getFutureTimeout());
    IStatus futureStatus=futureRemoteReferences.getStatus();
    if (futureStatus.isOK()) {
      trace("String_Node_Str","String_Node_Str" + ch + "String_Node_Str"+ ((remoteReferences == null) ? "String_Node_Str" : Arrays.asList(remoteReferences)));
      if (remoteReferences != null) {
        registerRemoteServiceReferences(sedh,ch,remoteReferences);
      }
    }
 else {
      logError("String_Node_Str" + futureStatus.getMessage(),futureStatus.getException());
    }
  }
 catch (  InterruptedException e) {
    logError("String_Node_Str",e);
  }
catch (  OperationCanceledException e) {
    logError("String_Node_Str",e);
  }
catch (  TimeoutException e) {
    logError("String_Node_Str" + e.getDuration(),e);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    IRemoteServiceReference[] remoteReferences=(IRemoteServiceReference[])futureRemoteReferences.get(sedh.getFutureTimeout());
    IStatus futureStatus=futureRemoteReferences.getStatus();
    if (futureStatus.isOK()) {
      trace("String_Node_Str","String_Node_Str" + ch + "String_Node_Str"+ ((remoteReferences == null) ? "String_Node_Str" : Arrays.asList(remoteReferences).toString()));
      if (remoteReferences != null) {
        registerRemoteServiceReferences(sedh,ch,remoteReferences);
      }
    }
 else {
      logError("String_Node_Str" + futureStatus.getMessage(),futureStatus.getException());
    }
  }
 catch (  InterruptedException e) {
    logError("String_Node_Str",e);
  }
catch (  OperationCanceledException e) {
    logError("String_Node_Str",e);
  }
catch (  TimeoutException e) {
    logError("String_Node_Str" + e.getDuration(),e);
  }
}
Program: 94480
Project: 94480
Buggy source:
protected static String getPathFromURL(String url){
  final int colonSlashSlash=url.indexOf("String_Node_Str");
  final int requestPath=url.indexOf('/',colonSlashSlash + 3);
  if (requestPath < 0)   return "String_Node_Str";
  int end=url.length();
  return url.substring(requestPath,end);
}

Fixed version (ground truth):
protected static String getPathFromURL(String url){
  final int colonSlashSlash=url.indexOf("String_Node_Str");
  if (colonSlashSlash < 0)   return "String_Node_Str";
  final int requestPath=url.indexOf('/',colonSlashSlash + 3);
  if (requestPath < 0)   return "String_Node_Str";
  int end=url.length();
  return url.substring(requestPath,end);
}
Program: 94481
Project: 94481
Buggy source:
protected static String getHostFromURL(String url){
  String result=url;
  final int colonSlashSlash=url.indexOf("String_Node_Str");
  if (colonSlashSlash >= 0) {
    result=url.substring(colonSlashSlash + 3);
  }
  final int colonPort=result.indexOf(':');
  final int requestPath=result.indexOf('/');
  int substringEnd;
  if (colonPort > 0 && requestPath > 0)   substringEnd=Math.min(colonPort,requestPath);
 else   if (colonPort > 0)   substringEnd=colonPort;
 else   if (requestPath > 0)   substringEnd=requestPath;
 else   substringEnd=result.length();
  return result.substring(0,substringEnd);
}

Fixed version (ground truth):
protected static String getHostFromURL(String url){
  String result=url;
  final int colonSlashSlash=url.indexOf("String_Node_Str");
  if (colonSlashSlash < 0)   return "String_Node_Str";
  if (colonSlashSlash >= 0) {
    result=url.substring(colonSlashSlash + 3);
  }
  final int colonPort=result.indexOf(':');
  final int requestPath=result.indexOf('/');
  int substringEnd;
  if (colonPort > 0 && requestPath > 0)   substringEnd=Math.min(colonPort,requestPath);
 else   if (colonPort > 0)   substringEnd=colonPort;
 else   if (requestPath > 0)   substringEnd=requestPath;
 else   substringEnd=result.length();
  return result.substring(0,substringEnd);
}
Program: 94482
Project: 94482
Buggy source:
protected static int getPortFromURL(String url){
  final int colonSlashSlash=url.indexOf("String_Node_Str");
  final int colonPort=url.indexOf(':',colonSlashSlash + 1);
  if (colonPort < 0)   return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT;
  final int requestPath=url.indexOf('/',colonPort + 1);
  int end;
  if (requestPath < 0)   end=url.length();
 else   end=requestPath;
  return Integer.parseInt(url.substring(colonPort + 1,end));
}

Fixed version (ground truth):
protected static int getPortFromURL(String url){
  final int colonSlashSlash=url.indexOf("String_Node_Str");
  if (colonSlashSlash < 0)   return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT;
  final int colonPort=url.indexOf(':',colonSlashSlash + 1);
  if (colonPort < 0)   return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT;
  final int requestPath=url.indexOf('/',colonPort + 1);
  int end;
  if (requestPath < 0)   end=url.length();
 else   end=requestPath;
  return Integer.parseInt(url.substring(colonPort + 1,end));
}
Program: 94483
Project: 94483
Buggy source:
public Object getAdapter(Class adapter){
  return this;
}

Fixed version (ground truth):
public Object getAdapter(Class adapter){
  if (adapter == null)   return null;
  if (adapter.isInstance(this))   return this;
  return null;
}
Program: 94484
Project: 94484
Buggy source:
/** 
 * Check if 
 * @throws ContainerConnectException 
 */
public void testAddContainerWithRegisteredServices() throws ContainerConnectException {
  container.connect(null,null);
  try {
    discoveryContainer.registerService(serviceInfo);
  }
 catch (  ECFException e) {
    fail("String_Node_Str");
  }
  CompositeDiscoveryContainer cdc=(CompositeDiscoveryContainer)discoveryContainer;
  testDiscoveryContainer=new TestDiscoveryContainer();
  assertTrue(cdc.addContainer(testDiscoveryContainer));
  List registeredServices=testDiscoveryContainer.getRegisteredServices();
  assertEquals("String_Node_Str",serviceInfo,registeredServices.get(0));
}

Fixed version (ground truth):
/** 
 * Check if 
 * @throws ContainerConnectException 
 */
public void testAddContainerWithRegisteredServices() throws ContainerConnectException {
  try {
    container.connect(null,null);
    try {
      discoveryContainer.registerService(serviceInfo);
    }
 catch (    ECFException e) {
      fail("String_Node_Str");
    }
    CompositeDiscoveryContainer cdc=(CompositeDiscoveryContainer)discoveryContainer;
    testDiscoveryContainer=new TestDiscoveryContainer();
    assertTrue(cdc.addContainer(testDiscoveryContainer));
    List registeredServices=testDiscoveryContainer.getRegisteredServices();
    assertEquals("String_Node_Str",serviceInfo,registeredServices.get(0));
  }
  finally {
    CompositeDiscoveryContainer cdc=(CompositeDiscoveryContainer)discoveryContainer;
    assertTrue(cdc.removeContainer(testDiscoveryContainer));
  }
}
Program: 94485
Project: 94485
Buggy source:
public CompositeDiscoveryContainerTest(){
  super("String_Node_Str");
  setComparator(new CompositeServiceInfoComporator());
  setWaitTimeForProvider(Long.parseLong(System.getProperty("String_Node_Str",new Long(60L * 1000L).toString())));
  System.setProperty("String_Node_Str",SCOPE);
}

Fixed version (ground truth):
public CompositeDiscoveryContainerTest(){
  super("String_Node_Str");
  setComparator(new CompositeServiceInfoComporator());
  setWaitTimeForProvider(Long.parseLong(System.getProperty("String_Node_Str",new Long(60L * 1000L).toString())));
  setScope(IServiceTypeID.DEFAULT_SCOPE[0]);
}
Program: 94486
Project: 94486
Buggy source:
public void testAddContainerWithoutRegisteredServices() throws ContainerConnectException {
  container.connect(null,null);
  try {
    discoveryContainer.registerService(serviceInfo);
    discoveryContainer.unregisterService(serviceInfo);
  }
 catch (  ECFException e) {
    fail("String_Node_Str");
  }
  CompositeDiscoveryContainer cdc=(CompositeDiscoveryContainer)discoveryContainer;
  testDiscoveryContainer=new TestDiscoveryContainer();
  assertTrue(cdc.addContainer(testDiscoveryContainer));
  List registeredServices=testDiscoveryContainer.getRegisteredServices();
  assertTrue(registeredServices.isEmpty());
}

Fixed version (ground truth):
public void testAddContainerWithoutRegisteredServices() throws ContainerConnectException {
  try {
    container.connect(null,null);
    try {
      discoveryContainer.registerService(serviceInfo);
      discoveryContainer.unregisterService(serviceInfo);
    }
 catch (    ECFException e) {
      fail("String_Node_Str");
    }
    CompositeDiscoveryContainer cdc=(CompositeDiscoveryContainer)discoveryContainer;
    testDiscoveryContainer=new TestDiscoveryContainer();
    assertTrue(cdc.addContainer(testDiscoveryContainer));
    List registeredServices=testDiscoveryContainer.getRegisteredServices();
    assertTrue(registeredServices.isEmpty());
  }
  finally {
    CompositeDiscoveryContainer cdc=(CompositeDiscoveryContainer)discoveryContainer;
    assertTrue(cdc.removeContainer(testDiscoveryContainer));
  }
}
Program: 94487
Project: 94487
Buggy source:
public JSLPServiceInfoTest(){
  super();
  uri=createDefaultURI();
  priority=PRIORITY;
  weight=WEIGHT;
  serviceProperties=new ServiceProperties();
  serviceProperties.setProperty("String_Node_Str",new String("String_Node_Str"));
  Namespace namespace=IDFactory.getDefault().getNamespaceByName(JSLPNamespace.NAME);
  try {
    serviceID=(IServiceID)IDFactory.getDefault().createID(namespace,new Object[]{SERVICE_TYPE,getHost()});
  }
 catch (  IDCreateException e) {
    fail(e.getMessage());
  }
  serviceInfo=new JSLPServiceInfo(uri,serviceID,priority,weight,serviceProperties);
}

Fixed version (ground truth):
public JSLPServiceInfoTest(){
  super();
  uri=DiscoveryTestHelper.createDefaultURI();
  priority=DiscoveryTestHelper.PRIORITY;
  weight=DiscoveryTestHelper.WEIGHT;
  serviceProperties=new ServiceProperties();
  serviceProperties.setProperty("String_Node_Str",new String("String_Node_Str"));
  Namespace namespace=IDFactory.getDefault().getNamespaceByName(JSLPNamespace.NAME);
  try {
    serviceID=(IServiceID)IDFactory.getDefault().createID(namespace,new Object[]{DiscoveryTestHelper.SERVICE_TYPE,DiscoveryTestHelper.getHost()});
  }
 catch (  IDCreateException e) {
    fail(e.getMessage());
  }
  serviceInfo=new JSLPServiceInfo(uri,serviceID,priority,weight,serviceProperties);
}
Program: 94488
Project: 94488
Buggy source:
public void testjSLPDefaultsToECF2(){
  String expected="String_Node_Str";
  Namespace namespaceByName=IDFactory.getDefault().getNamespaceByName(namespace);
  IServiceID aServiceID=ServiceIDFactory.getDefault().createServiceID(namespaceByName,SERVICES,PROTOCOLS,expected);
  assertNotNull(aServiceID);
  IServiceTypeID stid=aServiceID.getServiceTypeID();
  assertEquals(IServiceTypeID.DEFAULT_NA,stid.getNamingAuthority());
  assertEquals("String_Node_Str" + IServiceTypeID.DEFAULT_SCOPE[0] + "String_Node_Str"+ IServiceTypeID.DEFAULT_NA+ "String_Node_Str"+ expected,aServiceID.getName());
}

Fixed version (ground truth):
public void testjSLPDefaultsToECF2(){
  String expected="String_Node_Str";
  Namespace namespaceByName=IDFactory.getDefault().getNamespaceByName(namespace);
  IServiceID aServiceID=ServiceIDFactory.getDefault().createServiceID(namespaceByName,DiscoveryTestHelper.SERVICES,DiscoveryTestHelper.PROTOCOLS,expected);
  assertNotNull(aServiceID);
  IServiceTypeID stid=aServiceID.getServiceTypeID();
  assertEquals(IServiceTypeID.DEFAULT_NA,stid.getNamingAuthority());
  assertEquals("String_Node_Str" + IServiceTypeID.DEFAULT_SCOPE[0] + "String_Node_Str"+ IServiceTypeID.DEFAULT_NA+ "String_Node_Str"+ expected,aServiceID.getName());
}
Program: 94489
Project: 94489
Buggy source:
public void testRemoveServicePrefixECFtojSLP() throws ServiceLocationException {
  final IServiceID sid=(IServiceID)createIDFromString(SERVICE_TYPE);
  final JSLPServiceTypeID stid=(JSLPServiceTypeID)sid.getServiceTypeID();
  assertEquals("String_Node_Str" + SERVICES[0] + "String_Node_Str"+ SERVICES[1]+ "String_Node_Str"+ NAMINGAUTHORITY+ "String_Node_Str"+ SERVICES[2],stid.getInternal());
  assertEquals(SERVICE_TYPE,stid.getName());
  assertEquals(NAMINGAUTHORITY,stid.getNamingAuthority());
  assertTrue(Arrays.equals(SERVICES,stid.getServices()));
  assertTrue(Arrays.equals(new String[]{SCOPE},stid.getScopes()));
  assertTrue(Arrays.equals(new String[]{PROTOCOL},stid.getProtocols()));
}

Fixed version (ground truth):
public void testRemoveServicePrefixECFtojSLP() throws ServiceLocationException {
  final IServiceID sid=(IServiceID)createIDFromString(DiscoveryTestHelper.SERVICE_TYPE);
  final JSLPServiceTypeID stid=(JSLPServiceTypeID)sid.getServiceTypeID();
  assertEquals("String_Node_Str" + DiscoveryTestHelper.SERVICES[0] + "String_Node_Str"+ DiscoveryTestHelper.SERVICES[1]+ "String_Node_Str"+ DiscoveryTestHelper.NAMINGAUTHORITY+ "String_Node_Str"+ DiscoveryTestHelper.SERVICES[2],stid.getInternal());
  assertEquals(DiscoveryTestHelper.SERVICE_TYPE,stid.getName());
  assertEquals(DiscoveryTestHelper.NAMINGAUTHORITY,stid.getNamingAuthority());
  assertTrue(Arrays.equals(DiscoveryTestHelper.SERVICES,stid.getServices()));
  assertTrue(Arrays.equals(new String[]{DiscoveryTestHelper.SCOPE},stid.getScopes()));
  assertTrue(Arrays.equals(new String[]{DiscoveryTestHelper.PROTOCOL},stid.getProtocols()));
}
Program: 94490
Project: 94490
Buggy source:
public void testCreateByjSLPAndRemoveServicePrefix() throws ServiceLocationException {
  final String internalRep="String_Node_Str";
  final ServiceURL sUrl=new ServiceURL(internalRep + "String_Node_Str",ServiceURL.LIFETIME_PERMANENT);
  final IServiceInfo serviceInfo=new JSLPServiceInfo(new ServiceURLAdapter(sUrl,SERVICENAME),PRIORITY,WEIGHT,new ServicePropertiesAdapter(new ArrayList()));
  assertEquals(serviceInfo.getPriority(),PRIORITY);
  assertEquals(serviceInfo.getWeight(),WEIGHT);
  final IServiceID sid=serviceInfo.getServiceID();
  assertEquals(sid.getServiceName(),SERVICENAME);
  final IServiceTypeID stid=sid.getServiceTypeID();
  String internal=stid.getInternal();
  assertEquals(internalRep,internal);
  assertEquals("String_Node_Str" + IServiceTypeID.DEFAULT_PROTO[0] + "String_Node_Str"+ IServiceTypeID.DEFAULT_SCOPE[0]+ "String_Node_Str",stid.getName());
  assertEquals("String_Node_Str",stid.getNamingAuthority());
  assertTrue(Arrays.equals(new String[]{"String_Node_Str","String_Node_Str"},stid.getServices()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE,stid.getScopes()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_PROTO,stid.getProtocols()));
}

Fixed version (ground truth):
public void testCreateByjSLPAndRemoveServicePrefix() throws ServiceLocationException {
  final String internalRep="String_Node_Str";
  final ServiceURL sUrl=new ServiceURL(internalRep + "String_Node_Str",ServiceURL.LIFETIME_PERMANENT);
  final IServiceInfo serviceInfo=new JSLPServiceInfo(new ServiceURLAdapter(sUrl,DiscoveryTestHelper.SERVICENAME),DiscoveryTestHelper.PRIORITY,DiscoveryTestHelper.WEIGHT,new ServicePropertiesAdapter(new ArrayList()));
  assertEquals(serviceInfo.getPriority(),DiscoveryTestHelper.PRIORITY);
  assertEquals(serviceInfo.getWeight(),DiscoveryTestHelper.WEIGHT);
  final IServiceID sid=serviceInfo.getServiceID();
  assertEquals(sid.getServiceName(),DiscoveryTestHelper.SERVICENAME);
  final IServiceTypeID stid=sid.getServiceTypeID();
  String internal=stid.getInternal();
  assertEquals(internalRep,internal);
  assertEquals("String_Node_Str" + IServiceTypeID.DEFAULT_PROTO[0] + "String_Node_Str"+ IServiceTypeID.DEFAULT_SCOPE[0]+ "String_Node_Str",stid.getName());
  assertEquals("String_Node_Str",stid.getNamingAuthority());
  assertTrue(Arrays.equals(new String[]{"String_Node_Str","String_Node_Str"},stid.getServices()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE,stid.getScopes()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_PROTO,stid.getProtocols()));
}
Program: 94491
Project: 94491
Buggy source:
public void testCreateByjSLPAndRemoveServicePrefixWithServiceService() throws ServiceLocationException {
  final String internalRep="String_Node_Str";
  final ServiceURL sUrl=new ServiceURL(internalRep + "String_Node_Str",ServiceURL.LIFETIME_PERMANENT);
  final IServiceInfo serviceInfo=new JSLPServiceInfo(new ServiceURLAdapter(sUrl,SERVICENAME),PRIORITY,WEIGHT,new ServicePropertiesAdapter(new ArrayList()));
  assertEquals(serviceInfo.getPriority(),PRIORITY);
  assertEquals(serviceInfo.getWeight(),WEIGHT);
  final IServiceID sid=serviceInfo.getServiceID();
  assertEquals(sid.getServiceName(),SERVICENAME);
  final IServiceTypeID stid=sid.getServiceTypeID();
  assertEquals(internalRep,stid.getInternal());
  assertEquals("String_Node_Str" + IServiceTypeID.DEFAULT_PROTO[0] + "String_Node_Str"+ IServiceTypeID.DEFAULT_SCOPE[0]+ "String_Node_Str",stid.getName());
  assertEquals("String_Node_Str",stid.getNamingAuthority());
  assertTrue(Arrays.equals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},stid.getServices()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE,stid.getScopes()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_PROTO,stid.getProtocols()));
}

Fixed version (ground truth):
public void testCreateByjSLPAndRemoveServicePrefixWithServiceService() throws ServiceLocationException {
  final String internalRep="String_Node_Str";
  final ServiceURL sUrl=new ServiceURL(internalRep + "String_Node_Str",ServiceURL.LIFETIME_PERMANENT);
  final IServiceInfo serviceInfo=new JSLPServiceInfo(new ServiceURLAdapter(sUrl,DiscoveryTestHelper.SERVICENAME),DiscoveryTestHelper.PRIORITY,DiscoveryTestHelper.WEIGHT,new ServicePropertiesAdapter(new ArrayList()));
  assertEquals(serviceInfo.getPriority(),DiscoveryTestHelper.PRIORITY);
  assertEquals(serviceInfo.getWeight(),DiscoveryTestHelper.WEIGHT);
  final IServiceID sid=serviceInfo.getServiceID();
  assertEquals(sid.getServiceName(),DiscoveryTestHelper.SERVICENAME);
  final IServiceTypeID stid=sid.getServiceTypeID();
  assertEquals(internalRep,stid.getInternal());
  assertEquals("String_Node_Str" + IServiceTypeID.DEFAULT_PROTO[0] + "String_Node_Str"+ IServiceTypeID.DEFAULT_SCOPE[0]+ "String_Node_Str",stid.getName());
  assertEquals("String_Node_Str",stid.getNamingAuthority());
  assertTrue(Arrays.equals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},stid.getServices()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE,stid.getScopes()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_PROTO,stid.getProtocols()));
}
Program: 94492
Project: 94492
Buggy source:
public void testECFDefaultsTojSLP(){
  String expected="String_Node_Str";
  Namespace namespaceByName=IDFactory.getDefault().getNamespaceByName(namespace);
  IServiceID aServiceID=ServiceIDFactory.getDefault().createServiceID(namespaceByName,SERVICES,PROTOCOLS,expected);
  assertNotNull(aServiceID);
  IServiceTypeID stid=aServiceID.getServiceTypeID();
  assertTrue(Arrays.equals(SERVICES,stid.getServices()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE,stid.getScopes()));
  assertTrue(Arrays.equals(PROTOCOLS,stid.getProtocols()));
  String internal=stid.getInternal();
  assertEquals("String_Node_Str" + SERVICES[0] + "String_Node_Str"+ SERVICES[1]+ "String_Node_Str"+ SERVICES[2],internal);
}

Fixed version (ground truth):
public void testECFDefaultsTojSLP(){
  String expected="String_Node_Str";
  Namespace namespaceByName=IDFactory.getDefault().getNamespaceByName(namespace);
  IServiceID aServiceID=ServiceIDFactory.getDefault().createServiceID(namespaceByName,DiscoveryTestHelper.SERVICES,DiscoveryTestHelper.PROTOCOLS,expected);
  assertNotNull(aServiceID);
  IServiceTypeID stid=aServiceID.getServiceTypeID();
  assertTrue(Arrays.equals(DiscoveryTestHelper.SERVICES,stid.getServices()));
  assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE,stid.getScopes()));
  assertTrue(Arrays.equals(DiscoveryTestHelper.PROTOCOLS,stid.getProtocols()));
  String internal=stid.getInternal();
  assertEquals("String_Node_Str" + DiscoveryTestHelper.SERVICES[0] + "String_Node_Str"+ DiscoveryTestHelper.SERVICES[1]+ "String_Node_Str"+ DiscoveryTestHelper.SERVICES[2],internal);
}
Program: 94493
Project: 94493
Buggy source:
public void testjSLPDefaultsToECF(){
  String expected="String_Node_Str";
  Namespace namespaceByName=IDFactory.getDefault().getNamespaceByName(namespace);
  IServiceID aServiceID=ServiceIDFactory.getDefault().createServiceID(namespaceByName,SERVICES,new String[]{SCOPE},PROTOCOLS,NAMINGAUTHORITY,expected);
  assertNotNull(aServiceID);
  IServiceTypeID stid=aServiceID.getServiceTypeID();
  assertEquals(NAMINGAUTHORITY,stid.getNamingAuthority());
  assertEquals("String_Node_Str" + SCOPE + "String_Node_Str"+ NAMINGAUTHORITY+ "String_Node_Str"+ expected,aServiceID.getName());
}

Fixed version (ground truth):
public void testjSLPDefaultsToECF(){
  String expected="String_Node_Str";
  Namespace namespaceByName=IDFactory.getDefault().getNamespaceByName(namespace);
  IServiceID aServiceID=ServiceIDFactory.getDefault().createServiceID(namespaceByName,DiscoveryTestHelper.SERVICES,new String[]{DiscoveryTestHelper.SCOPE},DiscoveryTestHelper.PROTOCOLS,DiscoveryTestHelper.NAMINGAUTHORITY,expected);
  assertNotNull(aServiceID);
  IServiceTypeID stid=aServiceID.getServiceTypeID();
  assertEquals(DiscoveryTestHelper.NAMINGAUTHORITY,stid.getNamingAuthority());
  assertEquals("String_Node_Str" + DiscoveryTestHelper.SCOPE + "String_Node_Str"+ DiscoveryTestHelper.NAMINGAUTHORITY+ "String_Node_Str"+ expected,aServiceID.getName());
}
Program: 94494
Project: 94494
Buggy source:
protected void tearDown() throws Exception {
  discoveryContainer.unregisterService(serviceInfo);
  discoveryContainer=null;
  container.disconnect();
  container=null;
}

Fixed version (ground truth):
protected void tearDown() throws Exception {
  discoveryContainer.unregisterService(serviceInfo);
}
Program: 94495
Project: 94495
Buggy source:
protected void setUp() throws Exception {
  setClientCount(CLIENT_COUNT);
  clients=createClients();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  setClientCount(CLIENT_COUNT);
  clients=createClients();
}
Program: 94497
Project: 94497
Buggy source:
private long getLastModifiedTimeFromHeader() throws IOException {
  Header lastModifiedHeader=getMethod.getResponseHeader("String_Node_Str");
  if (lastModifiedHeader == null)   return 0L;
  String lastModifiedString=lastModifiedHeader.getValue();
  long lastModified=0;
  if (lastModifiedString != null) {
    try {
      lastModified=DateUtil.parseDate(lastModifiedString).getTime();
    }
 catch (    Exception e) {
      throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER);
    }
  }
  return lastModified;
}

Fixed version (ground truth):
private long getLastModifiedTimeFromHeader() throws IOException {
  Header lastModifiedHeader=headMethod.getResponseHeader("String_Node_Str");
  if (lastModifiedHeader == null)   return 0L;
  String lastModifiedString=lastModifiedHeader.getValue();
  long lastModified=0;
  if (lastModifiedString != null) {
    try {
      lastModified=DateUtil.parseDate(lastModifiedString).getTime();
    }
 catch (    Exception e) {
      throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER);
    }
  }
  return lastModified;
}
Program: 94498
Project: 94498
Buggy source:
protected static String getNTLMUserName(Proxy p){
  String domainUsername=p.getUsername();
  int slashloc=domainUsername.indexOf('\\');
  if (slashloc == -1)   return null;
  return domainUsername.substring(slashloc + 1);
}

Fixed version (ground truth):
protected static String getNTLMUserName(Proxy p){
  String domainUsername=p.getUsername();
  if (domainUsername == null)   return null;
  int slashloc=domainUsername.indexOf('\\');
  if (slashloc == -1)   return null;
  return domainUsername.substring(slashloc + 1);
}
Program: 94499
Project: 94499
Buggy source:
protected static String getNTLMDomainName(Proxy p){
  String domainUsername=p.getUsername();
  int slashloc=domainUsername.indexOf('\\');
  if (slashloc == -1)   return null;
  return domainUsername.substring(0,slashloc);
}

Fixed version (ground truth):
protected static String getNTLMDomainName(Proxy p){
  String domainUsername=p.getUsername();
  if (domainUsername == null)   return null;
  int slashloc=domainUsername.indexOf('\\');
  if (slashloc == -1)   return null;
  return domainUsername.substring(0,slashloc);
}
Program: 94500
Project: 94500
Buggy source:
public int execute(HttpState state,HttpConnection conn) throws HttpException, IOException {
  Trace.entering(Activator.PLUGIN_ID,DebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  int result=super.execute(state,conn);
  Trace.exiting(Activator.PLUGIN_ID,DebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str",new Integer(result));
  return result;
}

Fixed version (ground truth):
public int execute(HttpState state,HttpConnection conn) throws HttpException, IOException {
  Trace.entering(Activator.PLUGIN_ID,DebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  int result=super.execute(state,conn);
switch (result) {
case HttpStatus.SC_MOVED_TEMPORARILY:
case HttpStatus.SC_MOVED_PERMANENTLY:
case HttpStatus.SC_SEE_OTHER:
case HttpStatus.SC_TEMPORARY_REDIRECT:
    Trace.trace(Activator.PLUGIN_ID,"String_Node_Str" + result + "String_Node_Str");
  gzipReceived=false;
removeRequestHeader(GzipGetMethod.ACCEPT_ENCODING);
default :
}
Trace.exiting(Activator.PLUGIN_ID,DebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str",new Integer(result));
return result;
}
Program: 94502
Project: 94502
Buggy source:
public int execute(HttpState state,HttpConnection conn) throws HttpException, IOException {
  Trace.entering(Activator.PLUGIN_ID,DebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str" + gzipReceived);
  if (getFileRangeSpecification() == null)   this.setRequestHeader(ACCEPT_ENCODING,CONTENT_ENCODING_ACCEPTED);
  gzipReceived=false;
  int result=super.execute(state,conn);
  if (isZippedReply()) {
    gzipReceived=true;
  }
  Trace.exiting(Activator.PLUGIN_ID,DebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str" + gzipReceived,new Integer(result));
  return result;
}

Fixed version (ground truth):
public int execute(HttpState state,HttpConnection conn) throws HttpException, IOException {
  Trace.entering(Activator.PLUGIN_ID,DebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  int result=super.execute(state,conn);
  Trace.exiting(Activator.PLUGIN_ID,DebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str",new Integer(result));
  return result;
}
Program: 94503
Project: 94503
Buggy source:
public InputStream getResponseBodyAsUnzippedStream() throws IOException {
  InputStream input=super.getResponseBodyAsStream();
  try {
    if (gzipReceived) {
      Trace.trace(Activator.PLUGIN_ID,"String_Node_Str");
      return new java.util.zip.GZIPInputStream(input);
    }
  }
 catch (  IOException e) {
    Activator.getDefault().log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,IStatus.WARNING,"String_Node_Str",e));
    throw e;
  }
  return input;
}

Fixed version (ground truth):
public InputStream getResponseBodyAsUnzippedStream() throws IOException {
  gzipReceived=isZippedResponse();
  InputStream input=super.getResponseBodyAsStream();
  try {
    if (gzipReceived) {
      Trace.trace(Activator.PLUGIN_ID,"String_Node_Str");
      return new java.util.zip.GZIPInputStream(input);
    }
  }
 catch (  IOException e) {
    Activator.getDefault().log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,IStatus.WARNING,"String_Node_Str",e));
    throw e;
  }
  return input;
}
Program: 94504
Project: 94504
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    try {
      IProxyService proxyService=Activator.getDefault().getProxyService();
      if (proxyService != null) {
        URL target=directoryOrFile;
        final IProxyData[] proxies=proxyService.getProxyDataForHost(target.getHost());
        IProxyData selectedProxy=selectProxyFromProxies(target.getProtocol(),proxies);
        if (selectedProxy != null) {
          proxy=new Proxy(((selectedProxy.getType().equalsIgnoreCase(IProxyData.SOCKS_PROXY_TYPE)) ? Proxy.Type.SOCKS : Proxy.Type.HTTP),new ProxyAddress(selectedProxy.getHost(),selectedProxy.getPort()),selectedProxy.getUserId(),selectedProxy.getPassword());
        }
      }
    }
 catch (    Exception e) {
      Activator.logNoProxyWarning(e);
    }
catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    try {
      IProxyService proxyService=Activator.getDefault().getProxyService();
      if (proxyService != null && proxyService.isProxiesEnabled()) {
        URL target=directoryOrFile;
        final IProxyData[] proxies=proxyService.getProxyDataForHost(target.getHost());
        IProxyData selectedProxy=selectProxyFromProxies(target.getProtocol(),proxies);
        if (selectedProxy != null) {
          proxy=new Proxy(((selectedProxy.getType().equalsIgnoreCase(IProxyData.SOCKS_PROXY_TYPE)) ? Proxy.Type.SOCKS : Proxy.Type.HTTP),new ProxyAddress(selectedProxy.getHost(),selectedProxy.getPort()),selectedProxy.getUserId(),selectedProxy.getPassword());
        }
      }
    }
 catch (    Exception e) {
      Activator.logNoProxyWarning(e);
    }
catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94505
Project: 94505
Buggy source:
private Throwable createNewExceptionFor(Throwable exception2){
  Exception re=new Exception(exception2.getMessage());
  re.setStackTrace(exception2.getStackTrace());
  return re;
}

Fixed version (ground truth):
private Throwable createNewExceptionFor(Throwable exception2){
  Exception re=new Exception(exception2.getMessage());
  return re;
}
Program: 94506
Project: 94506
Buggy source:
/** 
 * Merges the given status into this multi-status. Equivalent to <code>add(status)</code> if the given status is not a multi-status. Equivalent to <code>addAll(status)</code> if the given status is a multi-status.
 * @param status the status to merge into this one
 * @see #add(IStatus)
 * @see #addAll(IStatus)
 */
public void merge(SerializableStatus status){
  Assert.isLegal(status != null);
  if (!status.isMultiStatus()) {
    add(status);
  }
 else {
    addAll(status);
  }
}

Fixed version (ground truth):
/** 
 * Merges the given status into this multi-status. Equivalent to <code>add(status)</code> if the given status is not a multi-status. Equivalent to <code>addAll(status)</code> if the given status is a multi-status.
 * @param status the status to merge into this one
 * @see #add(SerializableStatus)
 * @see #addAll(SerializableStatus)
 */
public void merge(SerializableStatus status){
  Assert.isLegal(status != null);
  if (!status.isMultiStatus()) {
    add(status);
  }
 else {
    addAll(status);
  }
}
Program: 94507
Project: 94507
Buggy source:
private void invokeAsyncListener(final Class interfaceClass,final IRemoteService remoteService,final IRemoteCall remoteCall){
  remoteService.callAsynch(remoteCall,new IRemoteCallListener(){
    public void handleEvent(    IRemoteCallEvent event){
      if (event instanceof IRemoteCallCompleteEvent) {
        final IRemoteCallCompleteEvent complete=(IRemoteCallCompleteEvent)event;
        if (complete.hadException()) {
          showException(complete.getException());
        }
 else         showResult(interfaceClass.getName(),remoteCall,complete.getResponse());
      }
    }
  }
);
}

Fixed version (ground truth):
private void invokeAsyncListener(final Class interfaceClass,final IRemoteService remoteService,final IRemoteCall remoteCall){
  remoteService.callAsync(remoteCall,new IRemoteCallListener(){
    public void handleEvent(    IRemoteCallEvent event){
      if (event instanceof IRemoteCallCompleteEvent) {
        final IRemoteCallCompleteEvent complete=(IRemoteCallCompleteEvent)event;
        if (complete.hadException()) {
          showException(complete.getException());
        }
 else         showResult(interfaceClass.getName(),remoteCall,complete.getResponse());
      }
    }
  }
);
}
Program: 94508
Project: 94508
Buggy source:
private void executeMethodInvocationDialog(final Class cls,final IRemoteService remoteService){
  final MethodInvocationDialog mid=new MethodInvocationDialog((Shell)null,cls);
  if (mid.open() == Window.OK) {
    final int timeout=(mid.getTimeout() > 0) ? mid.getTimeout() : 30000;
    final String methodName=mid.getMethod().getName();
    final Object[] methodArgs=mid.getMethodArguments();
    final IRemoteCall remoteCall=new IRemoteCall(){
      public String getMethod(){
        return methodName;
      }
      public Object[] getParameters(){
        return methodArgs;
      }
      public long getTimeout(){
        return timeout;
      }
    }
;
    final int invokeType=mid.getInvocationType();
    try {
switch (invokeType) {
case MethodInvocationDialog.ASYNC_FIRE_AND_GO:
        remoteService.callAsynch(remoteCall);
      break;
case MethodInvocationDialog.ASYNC_FUTURE_RESULT:
    invokeFuture(cls,remoteService,remoteCall);
  break;
case MethodInvocationDialog.ASYNC_LISTENER:
invokeAsyncListener(cls,remoteService,remoteCall);
break;
case MethodInvocationDialog.OSGI_SERVICE_PROXY:
throw new UnsupportedOperationException();
case MethodInvocationDialog.REMOTE_SERVICE_PROXY:
throw new UnsupportedOperationException();
case MethodInvocationDialog.SYNCHRONOUS:
throw new UnsupportedOperationException();
default :
break;
}
}
 catch (final Exception e) {
showException(e);
}
}
}

Fixed version (ground truth):
private void executeMethodInvocationDialog(final Class cls,final IRemoteService remoteService){
  final MethodInvocationDialog mid=new MethodInvocationDialog((Shell)null,cls);
  if (mid.open() == Window.OK) {
    final int timeout=(mid.getTimeout() > 0) ? mid.getTimeout() : 30000;
    final String methodName=mid.getMethod().getName();
    final Object[] methodArgs=mid.getMethodArguments();
    final IRemoteCall remoteCall=new IRemoteCall(){
      public String getMethod(){
        return methodName;
      }
      public Object[] getParameters(){
        return methodArgs;
      }
      public long getTimeout(){
        return timeout;
      }
    }
;
    final int invokeType=mid.getInvocationType();
    try {
switch (invokeType) {
case MethodInvocationDialog.ASYNC_FIRE_AND_GO:
        remoteService.callAsync(remoteCall);
      break;
case MethodInvocationDialog.ASYNC_FUTURE_RESULT:
    invokeFuture(cls,remoteService,remoteCall);
  break;
case MethodInvocationDialog.ASYNC_LISTENER:
invokeAsyncListener(cls,remoteService,remoteCall);
break;
case MethodInvocationDialog.OSGI_SERVICE_PROXY:
throw new UnsupportedOperationException();
case MethodInvocationDialog.REMOTE_SERVICE_PROXY:
throw new UnsupportedOperationException();
case MethodInvocationDialog.SYNCHRONOUS:
throw new UnsupportedOperationException();
default :
break;
}
}
 catch (final Exception e) {
showException(e);
}
}
}
Program: 94509
Project: 94509
Buggy source:
protected void invokeFuture(Class cls,IRemoteService remoteService,IRemoteCall remoteCall) throws InterruptedException, InvocationTargetException, OperationCanceledException {
  final IFuture asyncResult=remoteService.callAsynch(remoteCall);
  showResult(cls.getName(),remoteCall,asyncResult.get());
}

Fixed version (ground truth):
protected void invokeFuture(Class cls,IRemoteService remoteService,IRemoteCall remoteCall) throws InterruptedException, InvocationTargetException, OperationCanceledException {
  final IFuture asyncResult=remoteService.callAsync(remoteCall);
  showResult(cls.getName(),remoteCall,asyncResult.get());
}
Program: 94510
Project: 94510
Buggy source:
public int execute(HttpState state,HttpConnection conn) throws HttpException, IOException {
  if (getFileRangeSpecification() == null)   this.setRequestHeader(ACCEPT_ENCODING,CONTENT_ENCODING_ACCEPTED);
  int result=super.execute(state,conn);
  if (isZippedReply()) {
    gzipReceived=true;
  }
  return result;
}

Fixed version (ground truth):
public int execute(HttpState state,HttpConnection conn) throws HttpException, IOException {
  if (getFileRangeSpecification() == null)   this.setRequestHeader(ACCEPT_ENCODING,CONTENT_ENCODING_ACCEPTED);
  gzipReceived=false;
  int result=super.execute(state,conn);
  if (isZippedReply()) {
    gzipReceived=true;
  }
  return result;
}
Program: 94511
Project: 94511
Buggy source:
private IDocumentChange getLocalDocumentChange(){
  final int offset=random.nextInt(document.getLength());
  final int length=random.nextInt(2);
  final String text=(random.nextInt(2) == 0) ? "String_Node_Str" : "String_Node_Str";
  return new IDocumentChange(){
    public int getLengthOfReplacedText(){
      return length;
    }
    public int getOffset(){
      return offset;
    }
    public String getText(){
      return text;
    }
    public Object getAdapter(    Class adapter){
      return null;
    }
    public void applyToModel(    Object model) throws ModelUpdateException {
      IDocument doc=(IDocument)model;
      System.out.println();
      System.out.println(name + "String_Node_Str" + doc.get());
      System.out.println(name + "String_Node_Str" + "String_Node_Str"+ System.currentTimeMillis()+ "String_Node_Str"+ getOffset()+ "String_Node_Str"+ getLengthOfReplacedText()+ "String_Node_Str"+ getText());
      try {
        document.replace(getOffset(),getLengthOfReplacedText(),getText());
      }
 catch (      BadLocationException e) {
        throw new ModelUpdateException("String_Node_Str",this,model);
      }
      System.out.println(name + "String_Node_Str" + doc.get());
    }
  }
;
}

Fixed version (ground truth):
private IDocumentChange getLocalDocumentChange(){
  final int offset=random.nextInt(document.getLength());
  final int length=random.nextInt(2);
  final String text=(random.nextInt(2) == 0) ? "String_Node_Str" : "String_Node_Str";
  return new DocumentChangeMessage(offset,length,text);
}
Program: 94512
Project: 94512
Buggy source:
private void applyChangeToLocalDocument(boolean local,IDocumentChange change){
  System.out.println();
  System.out.println(name + "String_Node_Str" + document.get());
  System.out.println(name + (local ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ System.currentTimeMillis()+ "String_Node_Str"+ change.getOffset()+ "String_Node_Str"+ change.getLengthOfReplacedText()+ "String_Node_Str"+ change.getText());
  try {
    document.replace(change.getOffset(),change.getLengthOfReplacedText(),change.getText());
  }
 catch (  BadLocationException e) {
    e.printStackTrace();
  }
  System.out.println(name + "String_Node_Str" + document.get());
}

Fixed version (ground truth):
private void applyChangeToLocalDocument(boolean local,IDocumentChange change){
  System.out.println(name + "String_Node_Str" + document.get());
  System.out.println(name + (local ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ change);
  try {
    change.applyToModel(document);
  }
 catch (  ModelUpdateException e) {
    e.printStackTrace();
  }
  System.out.println(name + "String_Node_Str" + document.get());
}
Program: 94513
Project: 94513
Buggy source:
private void deliverChangeToOther(IModelChangeMessage[] changeMessages){
  for (int i=0; i < changeMessages.length; i++) {
    try {
      final byte[] bytes=changeMessages[i].serialize();
      otherQueue.enqueue(bytes);
    }
 catch (    SerializationException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void deliverChangeToOther(IModelChangeMessage[] changeMessages){
  for (int i=0; i < changeMessages.length; i++) {
    try {
      System.out.println(name + "String_Node_Str" + changeMessages[i]);
      otherQueue.enqueue(changeMessages[i].serialize());
    }
 catch (    SerializationException e) {
      e.printStackTrace();
    }
  }
}
Program: 94514
Project: 94514
Buggy source:
private void processLocalChange(IDocumentChange localChange){
  if (localChange != null) {
    applyChangeToLocalDocument(true,localChange);
    IModelChangeMessage[] changeMessages=syncStrategy.registerLocalChange(localChange);
    deliverChangeToOther(changeMessages);
  }
}

Fixed version (ground truth):
private void processLocalChange(IDocumentChange localChange){
  if (localChange != null) {
synchronized (this.getClass()) {
      applyChangeToLocalDocument(true,localChange);
      IModelChangeMessage[] changeMessages=syncStrategy.registerLocalChange(localChange);
      deliverChangeToOther(changeMessages);
    }
  }
}
Program: 94515
Project: 94515
Buggy source:
private void processRemoteMessage(byte[] msg){
  if (msg != null) {
    try {
      IModelChange change=syncStrategy.deserializeRemoteChange(msg);
      IDocumentChange[] documentChanges=(IDocumentChange[])syncStrategy.transformRemoteChange(change);
      for (int i=0; i < documentChanges.length; i++) {
        try {
          documentChanges[i].applyToModel(document);
        }
 catch (        ModelUpdateException e) {
          e.printStackTrace();
        }
      }
    }
 catch (    SerializationException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void processRemoteMessage(byte[] msg){
  if (msg != null) {
    try {
synchronized (this.getClass()) {
        IModelChange change=syncStrategy.deserializeRemoteChange(msg);
        System.out.println(name + "String_Node_Str" + change);
        IDocumentChange[] documentChanges=(IDocumentChange[])syncStrategy.transformRemoteChange(change);
        for (int i=0; i < documentChanges.length; i++) {
          applyChangeToLocalDocument(false,documentChanges[i]);
        }
      }
    }
 catch (    SerializationException e) {
      e.printStackTrace();
    }
  }
}
Program: 94516
Project: 94516
Buggy source:
public String toString(){
  final StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str").append(getText()).append("String_Node_Str").append(getOffset());
  buf.append("String_Node_Str").append(getLengthOfReplacedText()).append("String_Node_Str");
  buf.append("String_Node_Str").append(getLocalOperationsCount());
  buf.append("String_Node_Str").append(getRemoteOperationsCount()).append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
public String toString(){
  final StringBuffer buf=new StringBuffer("String_Node_Str");
  String tType="String_Node_Str";
  if (transformType == 0) {
    tType="String_Node_Str";
  }
 else   if (transformType == 1) {
    tType="String_Node_Str";
  }
 else   if (transformType == 2) {
    tType="String_Node_Str";
  }
  buf.append("String_Node_Str" + tType);
  buf.append("String_Node_Str").append(getOffset());
  buf.append("String_Node_Str").append(getLengthOfReplacedText()).append("String_Node_Str").append(getText()).append("String_Node_Str");
  buf.append("String_Node_Str").append(getLocalOperationsCount());
  buf.append("String_Node_Str").append(getRemoteOperationsCount()).append("String_Node_Str");
  return buf.toString();
}
Program: 94517
Project: 94517
Buggy source:
public static ColaSynchronizationStrategy getInstanceFor(ID client,boolean isInitiator){
  if (sessionStrategies.get(client) == null) {
    sessionStrategies.put(client,new ColaSynchronizationStrategy(isInitiator));
  }
  return (ColaSynchronizationStrategy)sessionStrategies.get(client);
}

Fixed version (ground truth):
public static ColaSynchronizationStrategy getInstanceFor(ID client,boolean isInitiator){
  ColaSynchronizationStrategy existingStrategy=(ColaSynchronizationStrategy)sessionStrategies.get(client);
  if (existingStrategy != null) {
    Boolean existingStrategyIsInitiator=new Boolean(existingStrategy.isInitiator);
    if (existingStrategyIsInitiator.equals(new Boolean(isInitiator))) {
      return existingStrategy;
    }
  }
  existingStrategy=new ColaSynchronizationStrategy(isInitiator);
  sessionStrategies.put(client,existingStrategy);
  return existingStrategy;
}