nus-yam/ex-repair huggingface dataset:
Program: 79560
Project: 79560
Buggy source:
public static void main(String... argv) throws Exception {
  Preconditions.checkElementIndex(0,argv.length,"String_Node_Str");
  String url=argv[0];
  System.setProperty(ClientProperties.AMQP_VERSION,"String_Node_Str");
  System.setProperty(ClientProperties.DEST_SYNTAX,"String_Node_Str");
  AMQConnectionFactory factory=new AMQConnectionFactory(url);
  Connection connection=factory.createConnection();
  connection.start();
  Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
  System.out.printf("String_Node_Str",MESSAGE_TIMEOUT_MILLIS,MESSAGE_COUNT);
  try {
    Queue destination=session.createQueue(QUEUE);
    MessageConsumer messageConsumer=session.createConsumer(destination);
    int n=MESSAGE_COUNT;
    do {
      TextMessage msg=(TextMessage)messageConsumer.receive(MESSAGE_TIMEOUT_MILLIS);
      if (msg == null)       break;
      System.out.printf("String_Node_Str",msg.getText());
    }
 while (n-- > 0);
  }
 catch (  Exception e) {
    System.err.printf("String_Node_Str",e.getMessage());
    System.err.printf("String_Node_Str",Throwables.getStackTraceAsString(e));
  }
 finally {
    session.close();
    connection.close();
  }
}

Fixed version (ground truth):
public static void main(String... argv) throws Exception {
  Preconditions.checkElementIndex(0,argv.length,"String_Node_Str");
  String url=argv[0];
  System.setProperty(ClientProperties.AMQP_VERSION,"String_Node_Str");
  System.setProperty(ClientProperties.DEST_SYNTAX,"String_Node_Str");
  AMQConnectionFactory factory=new AMQConnectionFactory(url);
  Connection connection=factory.createConnection();
  connection.start();
  Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
  System.out.printf("String_Node_Str",MESSAGE_TIMEOUT_MILLIS,MESSAGE_COUNT);
  try {
    Queue destination=session.createQueue(QUEUE);
    MessageConsumer messageConsumer=session.createConsumer(destination);
    int n=MESSAGE_COUNT;
    do {
      TextMessage msg=(TextMessage)messageConsumer.receive(MESSAGE_TIMEOUT_MILLIS);
      if (msg == null)       break;
      System.out.printf("String_Node_Str",msg.getText());
    }
 while (--n > 0);
  }
 catch (  Exception e) {
    System.err.printf("String_Node_Str",e.getMessage());
    System.err.printf("String_Node_Str",Throwables.getStackTraceAsString(e));
  }
 finally {
    session.close();
    connection.close();
  }
}
Program: 79561
Project: 79561
Buggy source:
@Override public Void call(ConfigBag parameters){
  String cassandraHostname=cassandra.getAttribute(CassandraCluster.HOSTNAME);
  Integer cassandraThriftPort=cassandra.getAttribute(CassandraCluster.THRIFT_PORT);
  HostAndPort current=HostAndPort.fromParts(cassandraHostname,cassandraThriftPort);
  if (!current.equals(cassandraCluster)) {
    cassandraCluster=current;
    Map<String,Object> config=MutableMap.<String,Object>of("String_Node_Str",cassandraHostname,"String_Node_Str",cassandraThriftPort);
    String cumulusYaml=TemplateProcessor.processTemplateContents(new ResourceUtils(this).getResourceAsString("String_Node_Str"),config);
    DynamicTasks.queue(SshEffectorTasks.put("String_Node_Str").contents(cumulusYaml));
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call(ConfigBag parameters){
  String hostname=cassandra.getAttribute(CassandraCluster.HOSTNAME);
  Integer thriftPort=cassandra.getAttribute(CassandraCluster.THRIFT_PORT);
  HostAndPort currentEndpoint=HostAndPort.fromParts(hostname,thriftPort);
  if (!currentEndpoint.equals(clusterEndpoint)) {
    log.info("String_Node_Str",currentEndpoint.toString());
    clusterEndpoint=currentEndpoint;
    String url=Entities.getRequiredUrlConfig(CumulusRDFApplication.this,CUMULUS_RDF_CONFIG_URL);
    Map<String,Object> config=MutableMap.<String,Object>of("String_Node_Str",clusterEndpoint.getHostText(),"String_Node_Str",clusterEndpoint.getPort());
    String contents=TemplateProcessor.processTemplateContents(new ResourceUtils(this).getResourceAsString(url),config);
    DynamicTasks.queue(SshEffectorTasks.put("String_Node_Str").contents(contents));
  }
  return null;
}
Program: 79563
Project: 79563
Buggy source:
@Override public void onEvent(SensorEvent<String> event){
  tomcat.invoke(configure,MutableMap.<String,Object>of());
  if (tomcat.getAttribute(Startable.SERVICE_UP)) {
    tomcat.restart();
  }
}

Fixed version (ground truth):
@Override public void onEvent(SensorEvent<String> event){
  tomcat.invoke(cumulusConfig,MutableMap.<String,Object>of());
  if (tomcat.getAttribute(Startable.SERVICE_UP)) {
    tomcat.restart();
  }
}
Program: 79564
Project: 79564
Buggy source:
@SuppressWarnings("String_Node_Str") @Test(groups="String_Node_Str") public void testJCloudsNamedSingle() throws Exception {
  location=(SingleMachineProvisioningLocation<SshMachineLocation>)managementContext.getLocationRegistry().resolve("String_Node_Str");
  location.setManagementContext(managementContext);
  SshMachineLocation m1=(SshMachineLocation)location.obtain();
  machinesToTearDown.add(m1);
  location.release(m1);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test(groups="String_Node_Str") public void testJCloudsNamedSingle() throws Exception {
  location=(SingleMachineProvisioningLocation<SshMachineLocation>)managementContext.getLocationRegistry().resolve("String_Node_Str");
  location.setManagementContext(managementContext);
  SshMachineLocation m1=(SshMachineLocation)location.obtain();
  machinesToTearDown.add(m1);
}
Program: 79565
Project: 79565
Buggy source:
@SuppressWarnings("String_Node_Str") @AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  Set<Exception> exceptions=Sets.newHashSet();
  for (  MachineLocation machineLocation : machinesToTearDown) {
    try {
      location.release(machineLocation);
    }
 catch (    Exception e) {
      exceptions.add(e);
    }
  }
  if (managementContext != null)   managementContext.terminate();
  if (!exceptions.isEmpty()) {
    throw new CompoundRuntimeException("String_Node_Str",exceptions);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  Set<Exception> exceptions=Sets.newHashSet();
  for (  MachineLocation machineLocation : machinesToTearDown) {
    try {
      if (location.getChildren().contains(machineLocation))       location.release(machineLocation);
    }
 catch (    Exception e) {
      exceptions.add(e);
    }
  }
  if (managementContext != null)   managementContext.terminate();
  if (!exceptions.isEmpty()) {
    throw new CompoundRuntimeException("String_Node_Str",exceptions);
  }
}
Program: 79566
Project: 79566
Buggy source:
@SuppressWarnings("String_Node_Str") @Test(groups="String_Node_Str") public void testJcloudsSingle() throws Exception {
  location=(SingleMachineProvisioningLocation<MachineLocation>)managementContext.getLocationRegistry().resolve("String_Node_Str");
  location.setManagementContext(managementContext);
  MachineLocation m1=location.obtain();
  assertNotNull(m1);
  log.info("String_Node_Str" + m1);
  location.release(m1);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test(groups="String_Node_Str") public void testJcloudsSingle() throws Exception {
  location=(SingleMachineProvisioningLocation<MachineLocation>)managementContext.getLocationRegistry().resolve("String_Node_Str");
  location.setManagementContext(managementContext);
  MachineLocation m1=location.obtain();
  machinesToTearDown.add(m1);
  assertNotNull(m1);
  log.info("String_Node_Str" + m1);
}
Program: 79567
Project: 79567
Buggy source:
@Override public Class getDriverInterface(){
  return EmptySoftwareProcessDriver.class;
}

Fixed version (ground truth):
@Override public Class<?> getDriverInterface(){
  return EmptySoftwareProcessDriver.class;
}
Program: 79568
Project: 79568
Buggy source:
public void onServiceUpChanged(Entity member,Boolean serviceUp){
  Set<Entity> seeds=getSeeds();
  int quorum=getQuorumSize();
  boolean isViable=isViableSeed(member);
  boolean maybeAdd=isViable && seeds.size() < quorum;
  boolean maybeRemove=seeds.contains(member) && !isViable;
  if (maybeAdd || maybeRemove) {
    refreshSeeds();
  }
 else {
    if (log.isTraceEnabled())     log.trace("String_Node_Str",new Object[]{CassandraClusterImpl.this,member,serviceUp});
    return;
  }
  Supplier<Set<Entity>> seedSupplier=getSeedSupplier();
  setAttribute(CURRENT_SEEDS,seedSupplier.get());
}

Fixed version (ground truth):
public void onServiceUpChanged(Entity member,Boolean serviceUp){
  Set<Entity> seeds=getSeeds();
  int quorum=getQuorumSize();
  boolean isViable=isViableSeed(member);
  boolean maybeAdd=isViable && seeds.size() < quorum;
  boolean maybeRemove=seeds.contains(member) && !isViable;
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + CassandraClusterImpl.this + "String_Node_Str"+ member+ "String_Node_Str"+ serviceUp+ "String_Node_Str"+ isViable+ "String_Node_Str"+ maybeAdd+ "String_Node_Str"+ maybeRemove+ "String_Node_Str");
  if (maybeAdd || maybeRemove) {
    refreshSeeds();
  }
 else {
    if (log.isTraceEnabled())     log.trace("String_Node_Str",new Object[]{CassandraClusterImpl.this,member,serviceUp});
    return;
  }
  Supplier<Set<Entity>> seedSupplier=getSeedSupplier();
  Set<Entity> newSeeds=seedSupplier.get();
  setAttribute(CURRENT_SEEDS,newSeeds);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + CassandraClusterImpl.this + "String_Node_Str"+ newSeeds);
}
Program: 79569
Project: 79569
Buggy source:
@Test public void testUpdatesSeedsOnFailuresAndAdditions() throws Exception {
  cluster=app.createAndManageChild(EntitySpec.create(CassandraCluster.class).configure(CassandraCluster.INITIAL_SIZE,2).configure(CassandraCluster.DELAY_BEFORE_ADVERTISING_CLUSTER,Duration.ZERO).configure(CassandraCluster.MEMBER_SPEC,EntitySpec.create(EmptySoftwareProcess.class)));
  app.start(ImmutableList.of(loc));
  EmptySoftwareProcess e1=(EmptySoftwareProcess)Iterables.get(cluster.getMembers(),0);
  EmptySoftwareProcess e2=(EmptySoftwareProcess)Iterables.get(cluster.getMembers(),1);
  EntityTestUtils.assertAttributeEqualsEventually(cluster,CassandraCluster.CURRENT_SEEDS,ImmutableSet.<Entity>of(e1,e2));
  ((EntityInternal)e1).setAttribute(Attributes.SERVICE_UP,false);
  EntityTestUtils.assertAttributeEqualsEventually(cluster,CassandraCluster.CURRENT_SEEDS,ImmutableSet.<Entity>of(e2));
  cluster.resize(3);
  EmptySoftwareProcess e3=(EmptySoftwareProcess)Iterables.getOnlyElement(Sets.difference(ImmutableSet.copyOf(cluster.getMembers()),ImmutableSet.of(e1,e2)));
  EntityTestUtils.assertAttributeEqualsEventually(cluster,CassandraCluster.CURRENT_SEEDS,ImmutableSet.<Entity>of(e2,e3));
}

Fixed version (ground truth):
@Test public void testUpdatesSeedsOnFailuresAndAdditions() throws Exception {
  doTestUpdatesSeedsOnFailuresAndAdditions(true,false);
}
Program: 79570
Project: 79570
Buggy source:
@AfterClass public void tearDown() throws Exception {
  super.tearDownJersey();
  stopManager();
}

Fixed version (ground truth):
@AfterClass public void tearDown() throws Exception {
  super.tearDownJersey();
}
Program: 79571
Project: 79571
Buggy source:
@AfterClass public void tearDown() throws Exception {
  super.tearDownJersey();
  stopManager();
}

Fixed version (ground truth):
@AfterClass public void tearDown() throws Exception {
  super.tearDownJersey();
}
Program: 79572
Project: 79572
Buggy source:
@Override protected void connectSensors(){
  super.connectSensors();
  FunctionSensorAdapter serviceUpAdapter=sensorRegistry.register(new FunctionSensorAdapter(MutableMap.of("String_Node_Str",10 * 1000),new Callable<Boolean>(){
    @Override public Boolean call(){
      return getDriver().isRunning();
    }
  }
));
}

Fixed version (ground truth):
@Override protected void connectSensors(){
  super.connectSensors();
  super.connectServiceUpIsRunning();
}
Program: 79573
Project: 79573
Buggy source:
public JMXConnectorServer startServer(Properties properties){
  try {
    System.setProperty("String_Node_Str","String_Node_Str");
    final int rmiPort=Integer.parseInt(System.getProperty(RMI_REGISTRY_PORT_PROPERTY,RMI_REGISTRY_DEFAULT_PORT));
    final int jmxPort=Integer.parseInt(System.getProperty(JMX_SERVER_PORT_PROPERTY,JMX_SERVER_DEFAULT_PORT));
    LocateRegistry.createRegistry(jmxPort);
    MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
    Map<String,Object> env=new LinkedHashMap<String,Object>();
    propagate(properties,env,JMX_SERVER_ADDRESS_WILDCARD_PROPERTY,"String_Node_Str");
    final String hostname=getLocalhostHostname(properties);
    JMXServiceURL url=new JMXServiceURL("String_Node_Str" + hostname + "String_Node_Str"+ jmxPort+ "String_Node_Str"+ hostname+ "String_Node_Str"+ jmxPort+ "String_Node_Str");
    JMXConnectorServer connector=JMXConnectorServerFactory.newJMXConnectorServer(url,env,mbs);
    connector.start();
    System.out.println("String_Node_Str" + url);
    return connector;
  }
 catch (  RuntimeException e) {
    System.err.println("String_Node_Str" + e);
    throw e;
  }
catch (  Exception e) {
    System.err.println("String_Node_Str" + e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public JMXConnectorServer startServer(Properties properties){
  try {
    System.setProperty("String_Node_Str","String_Node_Str");
    final int rmiPort=Integer.parseInt(System.getProperty(RMI_REGISTRY_PORT_PROPERTY,RMI_REGISTRY_DEFAULT_PORT));
    final int jmxPort=Integer.parseInt(System.getProperty(JMX_SERVER_PORT_PROPERTY,JMX_SERVER_DEFAULT_PORT));
    final String hostname=getLocalhostHostname(properties);
    System.out.println("String_Node_Str" + hostname + "String_Node_Str"+ rmiPort+ "String_Node_Str"+ jmxPort);
    LocateRegistry.createRegistry(rmiPort);
    MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
    Map<String,Object> env=new LinkedHashMap<String,Object>();
    propagate(properties,env,JMX_SERVER_ADDRESS_WILDCARD_PROPERTY,"String_Node_Str");
    JMXServiceURL url=new JMXServiceURL("String_Node_Str" + hostname + "String_Node_Str"+ jmxPort+ "String_Node_Str"+ hostname+ "String_Node_Str"+ rmiPort+ "String_Node_Str");
    JMXConnectorServer connector=JMXConnectorServerFactory.newJMXConnectorServer(url,env,mbs);
    connector.start();
    System.out.println("String_Node_Str" + url);
    return connector;
  }
 catch (  RuntimeException e) {
    System.err.println("String_Node_Str" + e);
    throw e;
  }
catch (  Exception e) {
    System.err.println("String_Node_Str" + e);
    throw new RuntimeException(e);
  }
}
Program: 79574
Project: 79574
Buggy source:
private String getLocalhostHostname(Properties properties) throws UnknownHostException {
  String hostname=properties == null ? null : properties.getProperty(RMI_HOSTNAME_PROPERTY);
  if (hostname == null || hostname.isEmpty()) {
    hostname=InetAddress.getLocalHost().getHostName();
  }
  return hostname;
}

Fixed version (ground truth):
private String getLocalhostHostname(Properties properties) throws UnknownHostException {
  String hostname=properties == null ? null : properties.getProperty(RMI_HOSTNAME_PROPERTY);
  if ("String_Node_Str".equals(hostname)) {
    System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  if (hostname == null || hostname.isEmpty()) {
    hostname=InetAddress.getLocalHost().getHostName();
  }
  return hostname;
}
Program: 79576
Project: 79576
Buggy source:
/** 
 * scanner which will look in given "search" classloader for classes starting with given prefix,  loading the class with the given "load" classloader, selecting for the given scanners. any or all arguments can be null to accept all.
 */
public ReflectionScanner(final ClassLoader classLoaderToSearch,final ClassLoader classLoaderForLoading,final Iterable<URL> urlsToScan,final String prefix,final Scanner... scanners){
  super(new ConfigurationBuilder(){
{
      final Predicate<String> filter=Strings.isNonEmpty(prefix) ? new FilterBuilder.Include(FilterBuilder.prefix(prefix)) : null;
      setUrls(urlsToScan != null ? ImmutableSet.copyOf(urlsToScan) : ClasspathHelper.forPackage(prefix != null && prefix.length() > 0 ? prefix : "String_Node_Str",asClassLoaderVarArgs(classLoaderToSearch)));
      if (filter != null)       filterInputsBy(filter);
      if (scanners != null && scanners.length != 0) {
        for (        Scanner scanner : scanners) {
          if (filter != null)           scanner.filterResultsBy(filter);
        }
        setScanners(scanners);
      }
 else {
        Scanner typeScanner=new TypeAnnotationsScanner();
        if (filter != null)         typeScanner=typeScanner.filterResultsBy(filter);
        Scanner subTypeScanner=new SubTypesScanner();
        if (filter != null)         subTypeScanner=subTypeScanner.filterResultsBy(filter);
        setScanners(typeScanner,subTypeScanner);
      }
    }
  }
);
  this.classLoaderForLoading=classLoaderForLoading;
}

Fixed version (ground truth):
/** 
 * scanner which will look in the given urls  (or if those are null attempt to infer from the first entry in the classloaders, although currently that seems to only pick up directories, not JAR's), optionally filtering for the given prefix; any or all arguments can be null to accept all (and use default classpath for classloading).
 */
public ReflectionScanner(final Iterable<URL> urlsToScan,final String optionalPrefix,final ClassLoader... classLoaders){
  reflections=new Reflections(new ConfigurationBuilder(){
{
      final Predicate<String> filter=Strings.isNonEmpty(optionalPrefix) ? new FilterBuilder.Include(FilterBuilder.prefix(optionalPrefix)) : null;
      if (urlsToScan != null)       setUrls(ImmutableSet.copyOf(urlsToScan));
 else       if (classLoaders.length > 0 && classLoaders[0] != null)       setUrls(ClasspathHelper.forPackage(Strings.isNonEmpty(optionalPrefix) ? optionalPrefix : "String_Node_Str",asClassLoaderVarArgs(classLoaders[0])));
      if (filter != null)       filterInputsBy(filter);
      Scanner typeScanner=new TypeAnnotationsScanner();
      if (filter != null)       typeScanner=typeScanner.filterResultsBy(filter);
      Scanner subTypeScanner=new SubTypesScanner();
      if (filter != null)       subTypeScanner=subTypeScanner.filterResultsBy(filter);
      setScanners(typeScanner,subTypeScanner);
      for (      ClassLoader cl : classLoaders)       if (cl != null)       addClassLoader(cl);
    }
  }
);
  this.classLoaders=Iterables.toArray(Iterables.filter(Arrays.asList(classLoaders),Predicates.notNull()),ClassLoader.class);
}
Program: 79577
Project: 79577
Buggy source:
protected Class<?> loadClass(String className){
  return ReflectionUtils.forName(className,asClassLoaderVarArgs(classLoaderForLoading));
}

Fixed version (ground truth):
protected Class<?> loadClass(String className){
  return ReflectionUtils.forName(className,classLoaders);
}
Program: 79578
Project: 79578
Buggy source:
/** 
 * overrides super so as to log rather than throw exception if a class cannot be loaded 
 */
@Override @SuppressWarnings("String_Node_Str") public <T>Set<Class<? extends T>> getSubTypesOf(final Class<T> type){
  Set<String> subTypes=getStore().getSubTypesOf(type.getName());
  List<Class<? extends T>> result=new ArrayList<Class<? extends T>>();
  for (  String className : subTypes) {
    try {
      Class<? extends T> subClazz=(Class<? extends T>)loadClass(className);
      if (subClazz != null) {
        result.add(subClazz);
      }
 else {
        log.warn("String_Node_Str" + className + "String_Node_Str"+ type+ "String_Node_Str");
      }
    }
 catch (    Throwable e) {
      log.warn("String_Node_Str" + className + "String_Node_Str"+ type+ "String_Node_Str"+ e);
    }
  }
  return ImmutableSet.copyOf(result);
}

Fixed version (ground truth):
/** 
 * overrides delegate so as to log rather than throw exception if a class cannot be loaded 
 */
public <T>Set<Class<? extends T>> getSubTypesOf(final Class<T> type){
  Set<String> subTypes=getStore().getSubTypesOf(type.getName());
  return ImmutableSet.copyOf(this.<T>forNames(subTypes,"String_Node_Str" + type));
}
Program: 79579
Project: 79579
Buggy source:
private synchronized void loadFullCatalog(){
  if (fullCatalog != null)   return;
  BrooklynProperties props=BrooklynProperties.Factory.newEmpty();
  props.put(LocalManagementContext.BROOKLYN_CATALOG_URL.getName(),"String_Node_Str" + URLEncoder.encode("String_Node_Str"));
  fullCatalog=newManagementContext(props).getCatalog();
  log.info("String_Node_Str" + fullCatalog.getCatalogItems(Predicates.alwaysTrue()));
}

Fixed version (ground truth):
private synchronized void loadFullCatalog(){
  if (fullCatalog != null)   return;
  BrooklynProperties props=BrooklynProperties.Factory.newEmpty();
  props.put(LocalManagementContext.BROOKLYN_CATALOG_URL.getName(),"String_Node_Str" + Urls.encode("String_Node_Str"));
  fullCatalog=newManagementContext(props).getCatalog();
  log.info("String_Node_Str" + fullCatalog.getCatalogItems(Predicates.alwaysTrue()));
}
Program: 79580
Project: 79580
Buggy source:
@Override public synchronized boolean cancel(boolean mayInterruptIfRunning){
  if (isDone())   return false;
  log.trace("String_Node_Str",this);
  boolean cancel=super.cancel(mayInterruptIfRunning);
  for (  Task<?> t : secondaryJobsAll)   cancel|=t.cancel(mayInterruptIfRunning);
  if (primaryThread != null) {
    log.trace("String_Node_Str",this);
    primaryThread.interrupt();
    cancel=true;
  }
  return cancel;
}

Fixed version (ground truth):
@Override public boolean cancel(boolean mayInterruptIfRunning){
  if (isDone())   return false;
  log.trace("String_Node_Str",this);
  boolean cancel=super.cancel(mayInterruptIfRunning);
  for (  Task<?> t : secondaryJobsAll)   cancel|=t.cancel(mayInterruptIfRunning);
synchronized (jobTransitionLock) {
    if (primaryThread != null) {
      log.trace("String_Node_Str",this);
      primaryThread.interrupt();
      cancel=true;
    }
  }
  return cancel;
}
Program: 79581
Project: 79581
Buggy source:
/** 
 * Default start will start all Startable children (child.start(Collection<? extends Location>)), calling preStart(locations) first and postStart(locations) afterwards.
 */
public void start(Collection<? extends Location> locations){
  this.addLocations(locations);
  setAttribute(Attributes.SERVICE_STATE,Lifecycle.STARTING);
  try {
    preStart(locations);
    StartableMethods.start(this,locations);
    postStart(locations);
  }
 catch (  Exception e) {
    setAttribute(Attributes.SERVICE_STATE,Lifecycle.ON_FIRE);
    log.warn("String_Node_Str" + this + "String_Node_Str"+ e);
    throw Exceptions.propagate(e);
  }
  setAttribute(SERVICE_UP,true);
  setAttribute(Attributes.SERVICE_STATE,Lifecycle.RUNNING);
  deployed=true;
  log.info("String_Node_Str" + this);
}

Fixed version (ground truth):
/** 
 * Default start will start all Startable children (child.start(Collection<? extends Location>)), calling preStart(locations) first and postStart(locations) afterwards.
 */
public void start(Collection<? extends Location> locations){
  this.addLocations(locations);
  setAttribute(Attributes.SERVICE_STATE,Lifecycle.STARTING);
  try {
    preStart(locations);
    StartableMethods.start(this,locations);
    postStart(locations);
  }
 catch (  Exception e) {
    setAttribute(Attributes.SERVICE_STATE,Lifecycle.ON_FIRE);
    throw Exceptions.propagate(e);
  }
  setAttribute(SERVICE_UP,true);
  setAttribute(Attributes.SERVICE_STATE,Lifecycle.RUNNING);
  deployed=true;
  log.info("String_Node_Str" + this);
}
Program: 79582
Project: 79582
Buggy source:
@Override public void start(Collection<? extends Location> locations){
  log.info("String_Node_Str" + this + "String_Node_Str"+ locations);
  LocationsFilter filter=getConfig(LOCATIONS_FILTER);
  Iterable<Entity> startables=filterStartableManagedEntities(getChildren());
  if (startables == null || Iterables.isEmpty(startables))   return;
  List<Task<?>> tasks=Lists.newArrayList();
  for (  final Entity entity : startables) {
    Collection<? extends Location> l2=locations;
    if (filter != null) {
      l2=filter.filterForContext(new ArrayList<Location>(locations),entity);
      log.debug("String_Node_Str" + entity + "String_Node_Str"+ this+ "String_Node_Str"+ l2);
    }
    tasks.add(getManagementSupport().getExecutionContext().submit(Entities.invokeEffectorWithArgs(this,entity,Startable.START,l2)));
  }
  for (  Task<?> t : tasks)   t.getUnchecked();
}

Fixed version (ground truth):
@Override public void start(Collection<? extends Location> locations){
  log.info("String_Node_Str" + this + "String_Node_Str"+ locations);
  LocationsFilter filter=getConfig(LOCATIONS_FILTER);
  Iterable<Entity> startables=filterStartableManagedEntities(getChildren());
  if (startables == null || Iterables.isEmpty(startables))   return;
  List<Task<?>> tasks=Lists.newArrayList();
  for (  final Entity entity : startables) {
    Collection<? extends Location> l2=locations;
    if (filter != null) {
      l2=filter.filterForContext(new ArrayList<Location>(locations),entity);
      log.debug("String_Node_Str" + entity + "String_Node_Str"+ this+ "String_Node_Str"+ l2);
    }
    tasks.add(Entities.invokeEffectorWithArgs(this,entity,Startable.START,l2));
  }
  for (  Task<?> t : tasks)   t.getUnchecked();
}
Program: 79583
Project: 79583
Buggy source:
/** 
 * returns an unsubmitted task which invokes the given effector 
 */
public static <T>Task<T> invocation(Entity entity,Effector<T> eff,@SuppressWarnings("String_Node_Str") Map parameters){
  @SuppressWarnings("String_Node_Str") Effector<T> eff2=(Effector<T>)((EntityInternal)entity).getEffector(eff.getName());
  if (log.isTraceEnabled())   log.trace("String_Node_Str" + eff + "String_Node_Str"+ (eff instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>)eff).getBody() : "String_Node_Str")+ "String_Node_Str"+ entity+ "String_Node_Str"+ (eff2 == eff ? "String_Node_Str" : "String_Node_Str" + eff2 + "String_Node_Str"+ (eff2 instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>)eff2).getBody() : "String_Node_Str")+ "String_Node_Str"));
  if (eff2 != null) {
    if (eff2 != eff) {
      if (eff2 instanceof EffectorWithBody) {
        log.debug("String_Node_Str",new Object[]{eff,entity,eff2});
        return ((EffectorWithBody<T>)eff2).getBody().newTask(entity,eff2,ConfigBag.newInstance().putAll(parameters));
      }
 else {
        log.warn("String_Node_Str",new Object[]{eff2,entity,eff});
      }
    }
 else {
      log.debug("String_Node_Str",new Object[]{eff,entity});
    }
  }
  if (eff instanceof EffectorWithBody) {
    return ((EffectorWithBody<T>)eff).getBody().newTask(entity,eff,ConfigBag.newInstance().putAll(parameters));
  }
  throw new UnsupportedOperationException("String_Node_Str" + eff + "String_Node_Str"+ entity);
}

Fixed version (ground truth):
/** 
 * returns an unsubmitted task which invokes the given effector; use   {@link Entities#invokeEffector(EntityLocal,Entity,Effector,Map)} for a submitted variant 
 */
public static <T>Task<T> invocation(Entity entity,Effector<T> eff,@SuppressWarnings("String_Node_Str") Map parameters){
  @SuppressWarnings("String_Node_Str") Effector<T> eff2=(Effector<T>)((EntityInternal)entity).getEffector(eff.getName());
  if (log.isTraceEnabled())   log.trace("String_Node_Str" + eff + "String_Node_Str"+ (eff instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>)eff).getBody() : "String_Node_Str")+ "String_Node_Str"+ entity+ "String_Node_Str"+ (eff2 == eff ? "String_Node_Str" : "String_Node_Str" + eff2 + "String_Node_Str"+ (eff2 instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>)eff2).getBody() : "String_Node_Str")+ "String_Node_Str"));
  if (eff2 != null) {
    if (eff2 != eff) {
      if (eff2 instanceof EffectorWithBody) {
        log.debug("String_Node_Str",new Object[]{eff,entity,eff2});
        return ((EffectorWithBody<T>)eff2).getBody().newTask(entity,eff2,ConfigBag.newInstance().putAll(parameters));
      }
 else {
        log.warn("String_Node_Str",new Object[]{eff2,entity,eff});
      }
    }
 else {
      log.debug("String_Node_Str",new Object[]{eff,entity});
    }
  }
  if (eff instanceof EffectorWithBody) {
    return ((EffectorWithBody<T>)eff).getBody().newTask(entity,eff,ConfigBag.newInstance().putAll(parameters));
  }
  throw new UnsupportedOperationException("String_Node_Str" + eff + "String_Node_Str"+ entity);
}
Program: 79584
Project: 79584
Buggy source:
public T call(Entity entity,Map parameters){
  Object[] parametersArray=EffectorUtils.prepareArgsForEffector(this,parameters);
  if (entity instanceof AbstractEntity) {
    return EffectorUtils.invokeEffector(entity,this,parametersArray);
  }
 else {
    Method[] methods=entity.getClass().getMethods();
    for (    Method method : methods) {
      if (method.getName().equals(getName())) {
        if (parametersArray.length == method.getParameterTypes().length) {
          try {
            return (T)method.invoke(entity,parametersArray);
          }
 catch (          Exception e) {
            throw new RuntimeException("String_Node_Str" + this + "String_Node_Str"+ entity,e);
          }
        }
      }
    }
    String msg="String_Node_Str" + getName() + "String_Node_Str"+ parametersArray.length+ "String_Node_Str"+ entity;
    log.warn(msg + "String_Node_Str" + Arrays.toString(methods));
    throw new IllegalStateException(msg);
  }
}

Fixed version (ground truth):
public T call(Entity entity,Map parameters){
  Object[] parametersArray=EffectorUtils.prepareArgsForEffector(this,parameters);
  if (entity instanceof AbstractEntity) {
    return EffectorUtils.invokeMethodEffector(entity,this,parametersArray);
  }
 else {
    Method[] methods=entity.getClass().getMethods();
    for (    Method method : methods) {
      if (method.getName().equals(getName())) {
        if (parametersArray.length == method.getParameterTypes().length) {
          try {
            return (T)method.invoke(entity,parametersArray);
          }
 catch (          Exception e) {
            throw Exceptions.propagate(e);
          }
        }
      }
    }
    String msg="String_Node_Str" + getName() + "String_Node_Str"+ parametersArray.length+ "String_Node_Str"+ entity;
    log.warn(msg + "String_Node_Str" + Arrays.toString(methods));
    throw new IllegalStateException(msg);
  }
}
Program: 79585
Project: 79585
Buggy source:
protected Map<Entity,Throwable> waitForTasksOnEntityStart(Map<Entity,Task<?>> tasks){
  Map<Entity,Throwable> errors=Maps.newLinkedHashMap();
  for (  Map.Entry<Entity,Task<?>> entry : tasks.entrySet()) {
    Entity entity=entry.getKey();
    Task<?> task=entry.getValue();
    try {
      task.get();
    }
 catch (    InterruptedException e) {
      throw Exceptions.propagate(e);
    }
catch (    Throwable t) {
      logger.error("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ t);
      logger.debug("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ t,t);
      errors.put(entity,unwrapException(t));
    }
  }
  return errors;
}

Fixed version (ground truth):
protected Map<Entity,Throwable> waitForTasksOnEntityStart(Map<Entity,Task<?>> tasks){
  Map<Entity,Throwable> errors=Maps.newLinkedHashMap();
  for (  Map.Entry<Entity,Task<?>> entry : tasks.entrySet()) {
    Entity entity=entry.getKey();
    Task<?> task=entry.getValue();
    try {
      task.get();
    }
 catch (    InterruptedException e) {
      throw Exceptions.propagate(e);
    }
catch (    Throwable t) {
      Throwable interesting=Exceptions.getFirstInteresting(t);
      logger.error("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ interesting,interesting);
      logger.debug("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ t,t);
      errors.put(entity,unwrapException(t));
    }
  }
  return errors;
}
Program: 79586
Project: 79586
Buggy source:
public Object invoke(Object proxy,final Method m,final Object[] args) throws Throwable {
  if (proxy == null) {
    throw new IllegalArgumentException("String_Node_Str" + delegate);
  }
  MethodSignature sig=new MethodSignature(m);
  Object result;
  if (OBJECT_METHODS.contains(sig)) {
    result=m.invoke(this,args);
  }
 else   if (ENTITY_NON_EFFECTOR_METHODS.contains(sig)) {
    result=m.invoke(delegate,args);
  }
 else {
    Object[] nonNullArgs=(args == null) ? new Object[0] : args;
    Effector<?> eff=findEffector(m,nonNullArgs);
    if (eff != null) {
      result=EffectorUtils.invokeEffector(delegate,eff,nonNullArgs);
    }
 else {
      result=m.invoke(delegate,nonNullArgs);
    }
  }
  return (result == delegate && delegate instanceof AbstractEntity) ? ((AbstractEntity)result).getProxy() : result;
}

Fixed version (ground truth):
public Object invoke(Object proxy,final Method m,final Object[] args) throws Throwable {
  if (proxy == null) {
    throw new IllegalArgumentException("String_Node_Str" + delegate);
  }
  MethodSignature sig=new MethodSignature(m);
  Object result;
  if (OBJECT_METHODS.contains(sig)) {
    result=m.invoke(this,args);
  }
 else   if (ENTITY_NON_EFFECTOR_METHODS.contains(sig)) {
    result=m.invoke(delegate,args);
  }
 else {
    Object[] nonNullArgs=(args == null) ? new Object[0] : args;
    Effector<?> eff=findEffector(m,nonNullArgs);
    if (eff != null) {
      result=EffectorUtils.invokeMethodEffector(delegate,eff,nonNullArgs);
    }
 else {
      result=m.invoke(delegate,nonNullArgs);
    }
  }
  return (result == delegate && delegate instanceof AbstractEntity) ? ((AbstractEntity)result).getProxy() : result;
}
Program: 79587
Project: 79587
Buggy source:
/** 
 * Method which returns a Future containing a string formatted using String.format, where the arguments can be normal objects or tasks; tasks will be waited on (submitted if necessary) and their results substituted in the call to String.format. <p> Example: <pre>  {@code setConfig(URL, DependentConfiguration.formatString("%s:%s",  DependentConfiguration.attributeWhenReady(target, Target.HOSTNAME), DependentConfiguration.attributeWhenReady(target, Target.PORT) ) );}</pre>
 */
public static Task<String> formatString(final String spec,final Object... args){
  List<Object> taskArgs=Lists.newArrayList();
  for (  Object arg : args)   if (arg instanceof Task)   taskArgs.add(arg);
  return transformMultiple(new Function<List<Object>,String>(){
    @Override public String apply(    List<Object> input){
      Iterator<Object> tri=input.iterator();
      Object[] vv=new Object[args.length];
      int i=0;
      for (      Object arg : args) {
        if (arg instanceof Task)         vv[i]=tri.next();
 else         vv[i]=arg;
        i++;
      }
      return String.format(spec,vv);
    }
  }
,(Task[])taskArgs.toArray(new Task[taskArgs.size()]));
}

Fixed version (ground truth):
/** 
 * Method which returns a Future containing a string formatted using String.format, where the arguments can be normal objects or tasks; tasks will be waited on (submitted if necessary) and their results substituted in the call to String.format. <p> Example: <pre>  {@code setConfig(URL, DependentConfiguration.formatString("%s:%s",  DependentConfiguration.attributeWhenReady(target, Target.HOSTNAME), DependentConfiguration.attributeWhenReady(target, Target.PORT) ) );}</pre>
 */
@SuppressWarnings("String_Node_Str") public static Task<String> formatString(final String spec,final Object... args){
  List<Task<Object>> taskArgs=Lists.newArrayList();
  for (  Object arg : args) {
    if (arg instanceof Task)     taskArgs.add((Task<Object>)arg);
  }
  return transformMultiple(MutableMap.<String,String>of("String_Node_Str","String_Node_Str" + spec + "String_Node_Str"+ taskArgs.size()+ "String_Node_Str"+ (taskArgs.size() != 1 ? "String_Node_Str" : "String_Node_Str")),new Function<List<Object>,String>(){
    @Override public String apply(    List<Object> input){
      Iterator<?> tri=input.iterator();
      Object[] vv=new Object[args.length];
      int i=0;
      for (      Object arg : args) {
        if (arg instanceof Task)         vv[i]=tri.next();
 else         vv[i]=arg;
        i++;
      }
      return String.format(spec,vv);
    }
  }
,taskArgs);
}
Program: 79588
Project: 79588
Buggy source:
/** 
 * @see #transformMultiple(Function,Task) 
 */
public static <U,T>Task<T> transformMultiple(Map flags,final Function<List<U>,T> transformer,Task<U>... tasks){
  if (tasks.length == 1) {
    return transform(flags,tasks[0],new Function<U,T>(){
      @Override @Nullable public T apply(      @Nullable U input){
        return transformer.apply(Arrays.asList(input));
      }
    }
);
  }
  return transform(flags,new ParallelTask(tasks),transformer);
}

Fixed version (ground truth):
public static <U,T>Task<T> transformMultiple(Map flags,final Function<List<U>,T> transformer,List<Task<U>> tasks){
  if (tasks.size() == 1) {
    return transform(flags,tasks.get(0),new Function<U,T>(){
      @Override @Nullable public T apply(      @Nullable U input){
        return transformer.apply(ImmutableList.of(input));
      }
    }
);
  }
  return transform(flags,new ParallelTask<U>(tasks),transformer);
}
Program: 79589
Project: 79589
Buggy source:
/** 
 * Method for entity to make effector happen with correct semantics (right place, right task context), when a method is called on that entity.
 * @throws ExecutionException 
 */
public <T>T invokeEffectorMethodSync(final Entity entity,final Effector<T> eff,final Object args) throws ExecutionException {
  try {
    Task<?> current=Tasks.current();
    if (current == null || !entity.equals(BrooklynTasks.getContextEntity(current)) || !isManagedLocally(entity)) {
      manageIfNecessary(entity,eff.getName());
      Task<T> task=runAtEntity(EffectorUtils.getTaskFlagsForEffectorInvocation(entity,eff),entity,new Callable<T>(){
        public T call(){
          return invokeEffectorMethodLocal(entity,eff,args);
        }
      }
);
      return task.get();
    }
 else {
      return invokeEffectorMethodLocal(entity,eff,args);
    }
  }
 catch (  Exception e) {
    throw new ExecutionException("String_Node_Str" + eff + "String_Node_Str"+ entity,e);
  }
}

Fixed version (ground truth):
/** 
 * Method for entity to make effector happen with correct semantics (right place, right task context), when a method is called on that entity.
 * @throws ExecutionException 
 */
public <T>T invokeEffectorMethodSync(final Entity entity,final Effector<T> eff,final Object args) throws ExecutionException {
  try {
    Task<?> current=Tasks.current();
    if (current == null || !entity.equals(BrooklynTasks.getContextEntity(current)) || !isManagedLocally(entity)) {
      manageIfNecessary(entity,eff.getName());
      Task<T> task=runAtEntity(EffectorUtils.getTaskFlagsForEffectorInvocation(entity,eff),entity,new Callable<T>(){
        public T call(){
          return invokeEffectorMethodLocal(entity,eff,args);
        }
      }
);
      return task.get();
    }
 else {
      return invokeEffectorMethodLocal(entity,eff,args);
    }
  }
 catch (  Exception e) {
    throw new ExecutionException(e);
  }
}
Program: 79590
Project: 79590
Buggy source:
/** 
 * Invokes the effector so that its progress is tracked. If the given method is not defined as an effector, then a warning will be logged and the method will be invoked directly.
 */
public static Object invokeEffector(AbstractEntity entity,Method method,Object[] args){
  Effector<?> effector=findEffectorMatching(entity,method);
  if (effector == null) {
    log.warn("String_Node_Str",method,entity);
    try {
      return method.invoke(entity,args);
    }
 catch (    Exception e) {
      log.info("String_Node_Str",new Object[]{method,entity.getId(),e});
      throw Exceptions.propagate(e);
    }
  }
 else {
    return invokeEffector(entity,effector,args);
  }
}

Fixed version (ground truth):
/** 
 * Invokes the effector so that its progress is tracked. If the given method is not defined as an effector, then a warning will be logged and the method will be invoked directly.
 * @deprecated since 0.6.0; not used, prefer passing an effector and a map of arguments
 */
public static Object invokeEffector(AbstractEntity entity,Method method,Object[] args){
  Effector<?> effector=findEffectorMatching(entity,method);
  if (effector == null) {
    log.warn("String_Node_Str",method,entity);
    try {
      return method.invoke(entity,args);
    }
 catch (    Exception e) {
      log.info("String_Node_Str",new Object[]{method,entity.getId(),e});
      throw Exceptions.propagate(e);
    }
  }
 else {
    return invokeMethodEffector(entity,effector,args);
  }
}
Program: 79591
Project: 79591
Buggy source:
@Override protected <T>Task<T> runAtEntity(final Entity entity,final Effector<T> eff,@SuppressWarnings("String_Node_Str") final Map parameters){
  manageIfNecessary(entity,eff);
  return getExecutionContext(entity).submit(Effectors.invocation(entity,eff,parameters));
}

Fixed version (ground truth):
@Override protected <T>Task<T> runAtEntity(final Entity entity,final Effector<T> eff,@SuppressWarnings("String_Node_Str") final Map parameters){
  manageIfNecessary(entity,eff);
  ExecutionContext ec=BasicExecutionContext.getCurrentExecutionContext();
  if (ec == null) {
    log.debug("String_Node_Str",eff,entity);
    ec=getExecutionContext(entity);
  }
  return ec.submit(Effectors.invocation(entity,eff,parameters));
}
Program: 79592
Project: 79592
Buggy source:
/** 
 * Finds the entity where this task is running, throwing NPE if there is none, and throwing IAE if it is not of the indicated type 
 */
public static <T extends Entity>T findEntity(Class<T> type){
  Entity t=findEntity();
  return Reflections.cast(t,type);
}

Fixed version (ground truth):
/** 
 * Finds the entity where this task is running
 * @throws NullPointerException if there is none
 * @throws IllegalArgumentException if it is not of the indicated type 
 */
public static <T extends Entity>T findEntity(Class<T> type){
  Entity t=findEntity();
  return Reflections.cast(t,type);
}
Program: 79593
Project: 79593
Buggy source:
protected Map<Entity,Throwable> waitForTasksOnEntityStart(Map<Entity,Task<?>> tasks){
  Map<Entity,Throwable> errors=Maps.newLinkedHashMap();
  for (  Map.Entry<Entity,Task<?>> entry : tasks.entrySet()) {
    Entity entity=entry.getKey();
    Task<?> task=entry.getValue();
    try {
      task.get();
    }
 catch (    InterruptedException e) {
      throw Exceptions.propagate(e);
    }
catch (    Throwable t) {
      Throwable interesting=Exceptions.getFirstInteresting(t);
      logger.error("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ interesting,interesting);
      logger.debug("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ t,t);
      errors.put(entity,unwrapException(t));
    }
  }
  return errors;
}

Fixed version (ground truth):
protected Map<Entity,Throwable> waitForTasksOnEntityStart(Map<Entity,Task<?>> tasks){
  Map<Entity,Throwable> errors=Maps.newLinkedHashMap();
  for (  Map.Entry<Entity,Task<?>> entry : tasks.entrySet()) {
    Entity entity=entry.getKey();
    Task<?> task=entry.getValue();
    try {
      task.get();
    }
 catch (    InterruptedException e) {
      throw Exceptions.propagate(e);
    }
catch (    Throwable t) {
      Throwable interesting=Exceptions.getFirstInteresting(t);
      logger.error("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ interesting,interesting);
      logger.debug("String_Node_Str" + this + "String_Node_Str"+ entity+ "String_Node_Str"+ t,t);
      errors.put(entity,t);
    }
  }
  return errors;
}
Program: 79594
Project: 79594
Buggy source:
public void handleException(Throwable throwable) throws Exception {
  if (throwable instanceof Exception) {
    if (throwable instanceof InterruptedException)     throw new RuntimeInterruptedException((InterruptedException)throwable);
    throw (Exception)throwable;
  }
  throw new PropagatedRuntimeException(throwable);
}

Fixed version (ground truth):
public void handleException(Throwable throwable) throws Exception {
  if (throwable instanceof Exception) {
    if (throwable instanceof InterruptedException)     throw new RuntimeInterruptedException((InterruptedException)throwable);
    throw (Exception)throwable;
  }
  throw Exceptions.propagate(throwable);
}
Program: 79595
Project: 79595
Buggy source:
/** 
 * Waits for the last task queued in this context to complete; it does throw if there is a problem. <p> Preferred over   {@link #last()}.get() because this waits on all tasks,  in sequentially (so that blocking information is always accurate) 
 */
public static Task<?> waitForLast(){
  TaskQueueingContext qc=DynamicTasks.getTaskQueuingContext();
  Preconditions.checkNotNull(qc,"String_Node_Str");
  List<Task<?>> q=qc.getQueue();
  Task<?> last=null;
  do {
    for (    Task<?> t : q) {
      last=t;
      last.getUnchecked();
    }
  }
 while (last != qc.last());
  return last;
}

Fixed version (ground truth):
/** 
 * Waits for the last task queued in this context to complete; it throws if there is a problem, but happily returns null if there is no last task. <p> Preferred over   {@link #last()}.get() because this waits on all tasks,  in sequentially (so that blocking information is always accurate) 
 */
public static Task<?> waitForLast(){
  TaskQueueingContext qc=DynamicTasks.getTaskQueuingContext();
  Preconditions.checkNotNull(qc,"String_Node_Str");
  List<Task<?>> q=qc.getQueue();
  Task<?> last=null;
  do {
    for (    Task<?> t : q) {
      last=t;
      last.getUnchecked();
    }
  }
 while (last != qc.last());
  return last;
}
Program: 79596
Project: 79596
Buggy source:
@Override public void restart(){
  new DynamicTasks.AutoQueueVoid("String_Node_Str"){
    protected void main(){
      boolean previouslyRunning=isRunning();
      try {
        getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.STOPPING);
        stop();
      }
 catch (      Exception e) {
        if (previouslyRunning) {
          log.debug(getEntity() + "String_Node_Str",e);
        }
 else {
          log.debug(getEntity() + "String_Node_Str",e);
        }
      }
    }
  }
;
  new DynamicTasks.AutoQueueVoid("String_Node_Str"){
    protected void main(){
      getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.STARTING);
      launch();
      getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.RUNNING);
    }
  }
;
}

Fixed version (ground truth):
@Override public void restart(){
  new DynamicTasks.AutoQueueVoid("String_Node_Str"){
    protected void main(){
      boolean previouslyRunning=isRunning();
      try {
        getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.STOPPING);
        stop();
      }
 catch (      Exception e) {
        if (previouslyRunning) {
          log.debug(getEntity() + "String_Node_Str",e);
        }
 else {
          log.debug(getEntity() + "String_Node_Str",e);
        }
      }
    }
  }
;
  new DynamicTasks.AutoQueueVoid("String_Node_Str"){
    protected void main(){
      getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.STARTING);
      launch();
    }
  }
;
}
Program: 79597
Project: 79597
Buggy source:
protected void main(){
  getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.STARTING);
  launch();
  getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.RUNNING);
}

Fixed version (ground truth):
protected void main(){
  getEntity().setAttribute(Attributes.SERVICE_STATE,Lifecycle.STARTING);
  launch();
}
Program: 79598
Project: 79598
Buggy source:
/** 
 * @see Startable#stop()
 */
void stop();

Fixed version (ground truth):
/** 
 * Performs software stop (or queues tasks to do this) 
 * @see Startable#stop()
 */
void stop();
Program: 79599
Project: 79599
Buggy source:
/** 
 * Queues tasks for restart
 * @see Startable#restart() Unlike the other methods, the driver here is responsible for queueing a task to update the SERVICE_STATE sensor.
 */
void restart();

Fixed version (ground truth):
/** 
 * Performs software restart (or queues tasks to do this); implementations should update SERVICE_STATE for STOPPING and STARTING as appropriate (but framework will set RUNNING afterwards)
 * @see Startable#restart()
 */
void restart();
Program: 79600
Project: 79600
Buggy source:
/** 
 * Queues tasks for starting
 */
void start();

Fixed version (ground truth):
/** 
 * Performs software start (or queues tasks to do this)
 */
void start();