nus-yam/ex-repair huggingface dataset:
Program: 15205
Project: 15205
Buggy source:
@Override public void fireDisable(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_DISABLED,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  try {
    if (Components.lookup(Eucalyptus.class).isEnabledLocally()) {
      if (Clusters.getInstance().contains(config.getName())) {
        try {
          Cluster newCluster=Clusters.getInstance().lookup(config.getName());
          Clusters.getInstance().disable(newCluster.getName());
          newCluster.disable();
        }
 catch (        NoSuchElementException ex) {
          Cluster newCluster=Clusters.getInstance().lookupDisabled(config.getName());
          newCluster.disable();
        }
      }
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void fireDisable(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_DISABLED,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  try {
    if (Clusters.getInstance().contains(config.getName())) {
      try {
        Cluster newCluster=Clusters.getInstance().lookup(config.getName());
        Clusters.getInstance().disable(newCluster.getName());
        newCluster.disable();
      }
 catch (      NoSuchElementException ex) {
        Cluster newCluster=Clusters.getInstance().lookupDisabled(config.getName());
        newCluster.disable();
      }
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
}
Program: 15206
Project: 15206
Buggy source:
@Override public void fireStart(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_START,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  try {
    if (Components.lookup(Eucalyptus.class).isEnabledLocally()) {
      if (!Clusters.getInstance().contains(config.getName())) {
        Cluster newCluster=new Cluster((ClusterConfiguration)config);
        newCluster.start();
      }
 else {
        try {
          Cluster newCluster=Clusters.getInstance().lookupDisabled(config.getName());
          Clusters.getInstance().deregister(config.getName());
          newCluster.start();
        }
 catch (        NoSuchElementException ex) {
          Cluster newCluster=Clusters.getInstance().lookup(config.getName());
          Clusters.getInstance().deregister(config.getName());
          newCluster.start();
        }
      }
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void fireStart(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_START,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  try {
    if (!Clusters.getInstance().contains(config.getName())) {
      Cluster newCluster=new Cluster((ClusterConfiguration)config);
      newCluster.start();
    }
 else {
      try {
        Cluster newCluster=Clusters.getInstance().lookupDisabled(config.getName());
        Clusters.getInstance().deregister(config.getName());
        newCluster.start();
      }
 catch (      NoSuchElementException ex) {
        Cluster newCluster=Clusters.getInstance().lookup(config.getName());
        Clusters.getInstance().deregister(config.getName());
        newCluster.start();
      }
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
}
Program: 15208
Project: 15208
Buggy source:
public static ServiceKey create(final ComponentId compId,final String partition) throws IllegalArgumentException, NoSuchElementException {
  if (compId.isPartitioned() && partition == null) {
    throw new IllegalArgumentException("String_Node_Str" + compId);
  }
 else   if (compId.isPartitioned()) {
    Partition p=Partitions.lookup(partition);
    return new ServiceKey(compId,p);
  }
 else {
    return new ServiceKey(compId);
  }
}

Fixed version (ground truth):
static ServiceKey create(final ServiceConfiguration config) throws ServiceRegistrationException {
  if (config.getComponentId().isPartitioned()) {
    Partition p=Partitions.lookup(config);
    return new ServiceKey(config.getComponentId(),p);
  }
 else {
    return new ServiceKey(config.getComponentId());
  }
}
Program: 15209
Project: 15209
Buggy source:
/** 
 * operation self-cancelled 
 */
private <T extends Throwable>boolean filterExceptions(final T t){
  Throwable fin=t;
  if (t instanceof ExecutionException) {
    fin=t.getCause() != null ? t.getCause() : t;
  }
  if (t instanceof InterruptedException) {
    Thread.currentThread().interrupt();
    LOG.error(t);
  }
 else   if (fin instanceof FailedRequestException) {
    LOG.error(fin,fin);
    this.pendingErrors.add(fin);
  }
 else   if ((fin instanceof ConnectionException) || (fin instanceof IOException)) {
    LOG.error(this.getName() + "String_Node_Str" + fin.getMessage());
    LOG.trace(fin,fin);
    this.pendingErrors.add(fin);
  }
 else {
    LOG.error(fin,fin);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * operation self-cancelled 
 */
private <T extends Throwable>boolean filterExceptions(final T t){
  Throwable fin=t;
  if (t instanceof ExecutionException) {
    fin=t.getCause() != null ? t.getCause() : t;
  }
  if (t instanceof InterruptedException) {
    Thread.currentThread().interrupt();
    LOG.error(t);
  }
 else   if (fin instanceof FailedRequestException) {
    LOG.error(fin,fin);
    this.pendingErrors.add(fin);
  }
 else   if ((fin instanceof ConnectionException) || (fin instanceof IOException)) {
    LOG.error(this.getName() + "String_Node_Str" + fin.getMessage());
    LOG.trace(fin,fin);
    this.pendingErrors.add(fin);
  }
 else {
    LOG.error(fin,fin);
    this.pendingErrors.add(fin);
  }
  return false;
}
Program: 15210
Project: 15210
Buggy source:
public Request<Q,R> execute(ServiceConfiguration config){
  this.doInitializeCallback(config);
  try {
    Logger.getLogger(this.cb.getClass()).debug("String_Node_Str" + config);
    if (!this.handler.fire(config,this.request)) {
      LOG.error("String_Node_Str" + this.request);
      if (!this.requestResult.isDone()) {
        RequestException ex=new RequestException("String_Node_Str",this.getRequest());
        try {
          this.result.setException(ex);
        }
 catch (        Throwable t) {
        }
      }
    }
 else {
      try {
        this.requestResult.get();
      }
 catch (      ExecutionException ex) {
        LOG.error(ex,ex);
      }
catch (      InterruptedException ex) {
        LOG.error(ex,ex);
      }
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    if (!this.result.isDone()) {
      this.result.setException(ex);
    }
    throw ex;
  }
  return this;
}

Fixed version (ground truth):
public Request<Q,R> execute(ServiceConfiguration config){
  this.doInitializeCallback(config);
  try {
    Logger.getLogger(this.cb.getClass()).debug("String_Node_Str" + config);
    if (!this.handler.fire(config,this.request)) {
      LOG.error("String_Node_Str" + this.request);
      if (!this.requestResult.isDone()) {
        RequestException ex=new RequestException("String_Node_Str",this.getRequest());
        try {
          this.result.setException(ex);
        }
 catch (        Throwable t) {
        }
      }
    }
 else {
      try {
        this.requestResult.get();
      }
 catch (      ExecutionException ex) {
        LOG.error(ex,ex);
      }
catch (      InterruptedException ex) {
        LOG.error(ex,ex);
      }
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    this.result.setException(ex);
  }
catch (  Exception ex) {
    LOG.error(ex,ex);
    this.result.setException(ex);
    throw new RuntimeException(ex);
  }
  return this;
}
Program: 15212
Project: 15212
Buggy source:
public boolean stop(){
  return this.doTransition(EventType.BOOTSTRAPPER_STOP,new CheckedFunction<Bootstrapper,Boolean>(){
    @Override public Boolean apply(    Bootstrapper arg0) throws Exception {
      return arg0.stop();
    }
  }
);
}

Fixed version (ground truth):
public boolean stop(){
  this.doTransition(EventType.BOOTSTRAPPER_STOP,new CheckedFunction<Bootstrapper,Boolean>(){
    @Override public Boolean apply(    Bootstrapper arg0) throws Exception {
      return arg0.stop();
    }
  }
);
  return true;
}
Program: 15213
Project: 15213
Buggy source:
private boolean doTransition(EventType transition,CheckedFunction<Bootstrapper,Boolean> checkedFunction){
  String name=transition.name().replaceAll("String_Node_Str","String_Node_Str").toLowerCase();
  this.updateBootstrapDependencies();
  for (  Stage s : Bootstrap.Stage.values()) {
    for (    Bootstrapper b : this.bootstrappers.get(s)) {
      EventRecord.here(this.component.getClass(),transition,"String_Node_Str",s.name(),b.getClass().getCanonicalName()).debug();
      try {
        boolean result=checkedFunction.apply(b);
        if (!result) {
          Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + name+ "String_Node_Str"+ this.component.getName()));
          return false;
        }
      }
 catch (      Throwable e) {
        throw Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + e.getMessage()+ "String_Node_Str"+ name+ "String_Node_Str"+ this.component.getName(),e));
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean doTransition(EventType transition,CheckedFunction<Bootstrapper,Boolean> checkedFunction){
  String name=transition.name().replaceAll("String_Node_Str","String_Node_Str").toLowerCase();
  this.updateBootstrapDependencies();
  for (  Stage s : Bootstrap.Stage.values()) {
    for (    Bootstrapper b : this.bootstrappers.get(s)) {
      EventRecord.here(this.component.getClass(),transition,"String_Node_Str",s.name(),b.getClass().getCanonicalName()).debug();
      try {
        boolean result=checkedFunction.apply(b);
        if (!result) {
          throw Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + name+ "String_Node_Str"+ this.component.getName()));
        }
      }
 catch (      Throwable e) {
        throw Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + e.getMessage()+ "String_Node_Str"+ name+ "String_Node_Str"+ this.component.getName(),e));
      }
    }
  }
  return true;
}
Program: 15214
Project: 15214
Buggy source:
public void enable() throws ServiceRegistrationException {
  if (!State.ENABLED.equals(this.stateMachine.getState())) {
    try {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
      try {
        CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
        Exception error=null;
        for (int i=0; i < Cluster.CLUSTER_STARTUP_SYNC_RETRIES; i++) {
          try {
            try {
              res.get();
              error=null;
              break;
            }
 catch (            Exception ex) {
              LOG.error(ex);
              error=ex;
            }
            TimeUnit.SECONDS.sleep(1);
          }
 catch (          InterruptedException ex) {
            LOG.error(ex,ex);
          }
        }
        if (error != null) {
          this.configuration.info(error);
        }
      }
 catch (      InterruptedException ex1) {
        LOG.error(ex1,ex1);
      }
catch (      ExecutionException ex1) {
        LOG.error(ex1,ex1);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
  }
}

Fixed version (ground truth):
public void enable() throws ServiceRegistrationException {
  if (!State.ENABLED.equals(this.stateMachine.getState())) {
    try {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
      try {
        CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
        Exception error=null;
        for (int i=0; i < Cluster.CLUSTER_STARTUP_SYNC_RETRIES; i++) {
          try {
            try {
              res.get();
              error=null;
              break;
            }
 catch (            Exception ex) {
              LOG.error(ex);
              error=ex;
            }
            TimeUnit.SECONDS.sleep(1);
          }
 catch (          InterruptedException ex) {
            LOG.error(ex,ex);
          }
        }
        if (error != null) {
          this.configuration.error(error);
        }
      }
 catch (      InterruptedException ex1) {
        LOG.error(ex1,ex1);
      }
catch (      ExecutionException ex1) {
        LOG.error(ex1,ex1);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
  }
}
Program: 15215
Project: 15215
Buggy source:
public void start() throws ServiceRegistrationException {
  Clusters.getInstance().registerDisabled(this);
  try {
    ListenerRegistry.getInstance().register(ClockTick.class,Cluster.this);
    ListenerRegistry.getInstance().register(Hertz.class,Cluster.this);
  }
 catch (  Exception ex1) {
    LOG.error(ex1,ex1);
  }
  if (!State.DISABLED.equals(this.stateMachine.getState())) {
    final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(Cluster.this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
    Exception error=null;
    for (int i=0; i < Cluster.CLUSTER_STARTUP_SYNC_RETRIES; i++) {
      try {
        try {
          transition.call().get();
          error=null;
          break;
        }
 catch (        Exception ex) {
          LOG.error(ex);
          error=ex;
        }
        TimeUnit.SECONDS.sleep(1);
      }
 catch (      InterruptedException ex) {
        LOG.error(ex,ex);
      }
    }
    if (error != null) {
      this.configuration.info(error);
    }
  }
}

Fixed version (ground truth):
public void start() throws ServiceRegistrationException {
  Clusters.getInstance().registerDisabled(this);
  try {
    ListenerRegistry.getInstance().register(ClockTick.class,Cluster.this);
    ListenerRegistry.getInstance().register(Hertz.class,Cluster.this);
  }
 catch (  Exception ex1) {
    LOG.error(ex1,ex1);
  }
  if (!State.DISABLED.equals(this.stateMachine.getState())) {
    final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(Cluster.this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
    Exception error=null;
    for (int i=0; i < Cluster.CLUSTER_STARTUP_SYNC_RETRIES; i++) {
      try {
        try {
          transition.call().get();
          error=null;
          break;
        }
 catch (        Exception ex) {
          LOG.error(ex);
          error=ex;
        }
        TimeUnit.SECONDS.sleep(1);
      }
 catch (      InterruptedException ex) {
        LOG.error(ex,ex);
      }
    }
    if (error != null) {
      this.configuration.error(error);
    }
  }
}
Program: 15216
Project: 15216
Buggy source:
private static boolean checkDepends(Bootstrapper bootstrap){
  String bc=bootstrap.getClass().getCanonicalName();
  if (bootstrap.checkLocal() && bootstrap.checkRemote()) {
    return true;
  }
 else   if (!bootstrap.checkLocal()) {
    EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsLocal().toString()).info();
  }
 else   if (!bootstrap.checkRemote()) {
    EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsRemote().toString()).info();
  }
  return false;
}

Fixed version (ground truth):
private static boolean checkDepends(Bootstrapper bootstrap){
  String bc=bootstrap.getClass().getCanonicalName();
  if (bootstrap.checkLocal() && bootstrap.checkRemote()) {
    return true;
  }
 else {
    if (!bootstrap.checkLocal()) {
      EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsLocal().toString()).info();
    }
 else     if (!bootstrap.checkRemote()) {
      EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsRemote().toString()).info();
    }
    return false;
  }
}
Program: 15217
Project: 15217
Buggy source:
private void updateBootstrapDependencies(){
  try {
    for (    Entry<Stage,Bootstrapper> entry : Iterables.concat(Lists.newArrayList(this.bootstrappers.entries()),Lists.newArrayList(this.disabledBootstrappers.entries()))) {
      Bootstrap.Stage stage=entry.getKey();
      Bootstrapper bootstrapper=entry.getValue();
      if (entry.getValue().checkLocal() && entry.getValue().checkRemote()) {
        this.enableBootstrapper(stage,bootstrapper);
      }
 else {
        this.disableBootstrapper(stage,bootstrapper);
      }
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
private void updateBootstrapDependencies(){
  try {
    Iterable<Bootstrapper> currBootstrappers=Iterables.concat(Lists.newArrayList(this.bootstrappers.values()),Lists.newArrayList(this.disabledBootstrappers.values()));
    this.bootstrappers.clear();
    this.disabledBootstrappers.clear();
    for (    Bootstrapper bootstrapper : currBootstrappers) {
      Bootstrap.Stage stage=bootstrapper.getBootstrapStage();
      if (bootstrapper.checkLocal() && bootstrapper.checkRemote()) {
        this.enableBootstrapper(stage,bootstrapper);
      }
 else {
        this.disableBootstrapper(stage,bootstrapper);
      }
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}
Program: 15218
Project: 15218
Buggy source:
/** 
 * TODO: DOCUMENT Bootstrap.java
 */
@SuppressWarnings("String_Node_Str") public static void initBootstrappers(){
  for (  Bootstrapper bootstrap : BootstrapperDiscovery.getBootstrappers()) {
    Class<ComponentId> compType;
    String bc=bootstrap.getClass().getCanonicalName();
    Bootstrap.Stage stage=bootstrap.getBootstrapStage();
    compType=bootstrap.getProvides();
    if (Bootstrap.checkDepends(bootstrap)) {
      if (ComponentId.class.equals(compType)) {
        for (        Component c : Components.list()) {
          EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_ADDED,stage.name(),bc,"String_Node_Str" + c.getName()).info();
          c.getBootstrapper().addBootstrapper(bootstrap);
        }
      }
 else       if (Empyrean.class.equals(compType)) {
        EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_ADDED,stage.name(),bc,"String_Node_Str" + compType.getSimpleName()).info();
        stage.addBootstrapper(bootstrap);
      }
    }
 else     if (ComponentId.class.isAssignableFrom(compType)) {
      ComponentId comp;
      try {
        comp=compType.newInstance();
        Components.lookup(comp).getBootstrapper().addBootstrapper(bootstrap);
      }
 catch (      InstantiationException ex) {
        LOG.error(ex,ex);
      }
catch (      IllegalAccessException ex) {
        LOG.error(ex,ex);
      }
    }
 else {
      LOG.error(new ClassCastException("String_Node_Str" + bootstrap.getClass().getCanonicalName() + "String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
/** 
 * TODO: DOCUMENT Bootstrap.java
 */
@SuppressWarnings("String_Node_Str") public static void initBootstrappers(){
  for (  Bootstrapper bootstrap : BootstrapperDiscovery.getBootstrappers()) {
    Class<ComponentId> compType;
    String bc=bootstrap.getClass().getCanonicalName();
    Bootstrap.Stage stage=bootstrap.getBootstrapStage();
    compType=bootstrap.getProvides();
    if (Bootstrap.checkDepends(bootstrap)) {
      if (ComponentId.class.equals(compType)) {
        for (        Component c : Components.list()) {
          EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_ADDED,stage.name(),bc,"String_Node_Str" + c.getName()).info();
          c.getBootstrapper().addBootstrapper(bootstrap);
        }
      }
 else       if (Empyrean.class.equals(compType)) {
        EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_ADDED,stage.name(),bc,"String_Node_Str" + compType.getSimpleName()).info();
        stage.addBootstrapper(bootstrap);
      }
    }
 else     if (ComponentId.class.isAssignableFrom(compType) && !Empyrean.class.equals(compType)) {
      ComponentId comp;
      try {
        comp=compType.newInstance();
        Components.lookup(comp).getBootstrapper().addBootstrapper(bootstrap);
      }
 catch (      InstantiationException ex) {
        LOG.error(ex,ex);
      }
catch (      IllegalAccessException ex) {
        LOG.error(ex,ex);
      }
    }
 else {
      LOG.error(new ClassCastException("String_Node_Str" + bootstrap.getClass().getCanonicalName() + "String_Node_Str"));
    }
  }
}
Program: 15221
Project: 15221
Buggy source:
public boolean stop(){
  this.doTransition(EventType.BOOTSTRAPPER_STOP,new CheckedFunction<Bootstrapper,Boolean>(){
    @Override public Boolean apply(    Bootstrapper arg0) throws Exception {
      return arg0.stop();
    }
  }
);
  return true;
}

Fixed version (ground truth):
public boolean stop(){
  return this.doTransition(EventType.BOOTSTRAPPER_STOP,new CheckedFunction<Bootstrapper,Boolean>(){
    @Override public Boolean apply(    Bootstrapper arg0) throws Exception {
      return arg0.stop();
    }
  }
);
}
Program: 15222
Project: 15222
Buggy source:
private boolean doTransition(EventType transition,CheckedFunction<Bootstrapper,Boolean> checkedFunction){
  String name=transition.name().replaceAll("String_Node_Str","String_Node_Str").toLowerCase();
  this.updateBootstrapDependencies();
  for (  Stage s : Bootstrap.Stage.values()) {
    for (    Bootstrapper b : this.bootstrappers.get(s)) {
      EventRecord.here(Bootstrap.class,transition,this.component.getName(),"String_Node_Str",s.name(),b.getClass().getCanonicalName()).debug();
      try {
        boolean result=checkedFunction.apply(b);
        if (!result) {
          throw Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + name+ "String_Node_Str"+ this.component.getName()));
        }
      }
 catch (      Throwable e) {
        throw Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + e.getMessage()+ "String_Node_Str"+ name+ "String_Node_Str"+ this.component.getName(),e));
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean doTransition(EventType transition,CheckedFunction<Bootstrapper,Boolean> checkedFunction){
  String name=transition.name().replaceAll("String_Node_Str","String_Node_Str").toLowerCase();
  this.updateBootstrapDependencies();
  for (  Stage s : Bootstrap.Stage.values()) {
    for (    Bootstrapper b : this.bootstrappers.get(s)) {
      EventRecord.here(this.component.getClass(),transition,"String_Node_Str",s.name(),b.getClass().getCanonicalName()).debug();
      try {
        boolean result=checkedFunction.apply(b);
        if (!result) {
          Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + name+ "String_Node_Str"+ this.component.getName()));
          return false;
        }
      }
 catch (      Throwable e) {
        throw Exceptions.error(new TransitionException(b.getClass().getSimpleName() + "String_Node_Str" + e.getMessage()+ "String_Node_Str"+ name+ "String_Node_Str"+ this.component.getName(),e));
      }
    }
  }
  return true;
}
Program: 15223
Project: 15223
Buggy source:
@Override public void fireCheck(ServiceConfiguration config) throws ServiceRegistrationException, CheckException {
  try {
    Clusters.lookup(config).check();
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
    throw ex;
  }
catch (  IllegalStateException ex) {
    LOG.error(ex,ex);
    throw ServiceChecks.Severity.ERROR.transform(config,ex);
  }
}

Fixed version (ground truth):
@Override public void fireCheck(ServiceConfiguration config) throws ServiceRegistrationException, CheckException {
  try {
    Clusters.lookup(config).check();
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
    throw ex;
  }
catch (  IllegalStateException ex) {
    LOG.error(ex,ex);
    throw ServiceChecks.Severity.ERROR.transform(config,ex);
  }
catch (  Throwable ex) {
    LOG.error(ex,ex);
    throw ServiceChecks.Severity.FATAL.transform(config,ex);
  }
}
Program: 15227
Project: 15227
Buggy source:
public Request<Q,R> execute(ServiceConfiguration config){
  this.doInitializeCallback(config);
  try {
    Logger.getLogger(this.cb.getClass()).debug("String_Node_Str" + config);
    if (!this.handler.fire(config,this.request)) {
      LOG.error("String_Node_Str" + this.request);
      if (!this.requestResult.isDone()) {
        RequestException ex=new RequestException("String_Node_Str",this.getRequest());
        try {
          this.result.setException(ex);
        }
 catch (        Throwable t) {
        }
      }
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    if (!this.result.isDone()) {
      this.result.setException(ex);
    }
  }
  return this;
}

Fixed version (ground truth):
public Request<Q,R> execute(ServiceConfiguration config){
  this.doInitializeCallback(config);
  try {
    Logger.getLogger(this.cb.getClass()).debug("String_Node_Str" + config);
    if (!this.handler.fire(config,this.request)) {
      LOG.error("String_Node_Str" + this.request);
      if (!this.requestResult.isDone()) {
        RequestException ex=new RequestException("String_Node_Str",this.getRequest());
        try {
          this.result.setException(ex);
        }
 catch (        Throwable t) {
        }
      }
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    if (!this.result.isDone()) {
      this.result.setException(ex);
    }
    throw ex;
  }
  return this;
}
Program: 15228
Project: 15228
Buggy source:
@Override public void fire(R r){
  try {
    if (Logs.EXTREME) {
      Logs.extreme().debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    AsyncRequest.this.result.set(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Throwable ex) {
      AsyncRequest.this.result.setException(ex);
      LOG.error(ex,ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}

Fixed version (ground truth):
@Override public void fire(R r){
  try {
    if (Logs.EXTREME) {
      Logs.extreme().debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    AsyncRequest.this.result.set(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Throwable ex) {
      LOG.error(ex,ex);
      AsyncRequest.this.result.setException(ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}
Program: 15229
Project: 15229
Buggy source:
private Future<ServiceConfiguration> submitExternal(final ServiceConfiguration config,final Function<ServiceConfiguration,ServiceConfiguration> function){
  EventRecord.here(Topology.class,EventType.ENQUEUE,Topology.this.toString(),function.toString(),config.toString()).info();
  final Long queueStart=System.currentTimeMillis();
  return Threads.lookup(Empyrean.class,Topology.class,"String_Node_Str").submit(new Callable<ServiceConfiguration>(){
    @Override public ServiceConfiguration call() throws Exception {
      Long serviceStart=System.currentTimeMillis();
      EventRecord.here(Topology.class,EventType.DEQUEUE,Topology.this.toString(),function.toString(),config.toString()).append(EventType.QUEUE_TIME.name(),Long.toString(serviceStart - queueStart)).info();
      ServiceConfiguration result=function.apply(config);
      Long finish=System.currentTimeMillis();
      EventRecord.here(Topology.class,EventType.QUEUE,Topology.this.toString(),function.toString(),config.toString()).append(EventType.SERVICE_TIME.name(),Long.toString(finish - serviceStart)).info();
      return result;
    }
  }
);
}

Fixed version (ground truth):
private Future<ServiceConfiguration> submitExternal(final ServiceConfiguration config,final Function<ServiceConfiguration,ServiceConfiguration> function){
  Logs.exhaust().debug(EventRecord.here(Topology.class,EventType.ENQUEUE,Topology.this.toString(),function.toString(),config.toString()));
  final Long queueStart=System.currentTimeMillis();
  return Threads.lookup(Empyrean.class,Topology.class,"String_Node_Str").submit(new Callable<ServiceConfiguration>(){
    @Override public ServiceConfiguration call() throws Exception {
      Long serviceStart=System.currentTimeMillis();
      Logs.exhaust().debug(EventRecord.here(Topology.class,EventType.DEQUEUE,Topology.this.toString(),function.toString(),config.toString()).append(EventType.QUEUE_TIME.name(),Long.toString(serviceStart - queueStart)));
      ServiceConfiguration result=function.apply(config);
      Long finish=System.currentTimeMillis();
      Logs.exhaust().debug(EventRecord.here(Topology.class,EventType.QUEUE,Topology.this.toString(),function.toString(),config.toString()).append(EventType.SERVICE_TIME.name(),Long.toString(finish - serviceStart)));
      return result;
    }
  }
);
}
Program: 15231
Project: 15231
Buggy source:
public static boolean shouldBootstrapLocally(ComponentId c){
  boolean cloudLocal=Bootstrap.isCloudController() && c.isCloudLocal();
  boolean alwaysLocal=c.isAlwaysLocal();
  boolean isBootrapperItself=Empyrean.class.equals(c);
  return cloudLocal || alwaysLocal || isBootrapperItself;
}

Fixed version (ground truth):
public static boolean shouldBootstrapLocally(ComponentId c){
  boolean cloudLocal=Bootstrap.isCloudController() && c.isCloudLocal() && !c.isRegisterable();
  boolean alwaysLocal=c.isAlwaysLocal();
  boolean isBootrapperItself=Empyrean.class.equals(c);
  return cloudLocal || alwaysLocal || isBootrapperItself;
}
Program: 15232
Project: 15232
Buggy source:
public Request<Q,R> execute(ServiceConfiguration config){
  this.doInitializeCallback(config);
  try {
    Logger.getLogger(this.cb.getClass()).debug("String_Node_Str" + config);
    if (!this.handler.fire(config,this.request)) {
      LOG.error("String_Node_Str" + this.request);
      if (!this.requestResult.isDone()) {
        RequestException ex=new RequestException("String_Node_Str",this.getRequest());
        try {
          this.result.setException(ex);
        }
 catch (        Throwable t) {
        }
      }
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    if (!this.result.isDone()) {
      this.result.setException(ex);
    }
    throw ex;
  }
  return this;
}

Fixed version (ground truth):
public Request<Q,R> execute(ServiceConfiguration config){
  this.doInitializeCallback(config);
  try {
    Logger.getLogger(this.cb.getClass()).debug("String_Node_Str" + config);
    if (!this.handler.fire(config,this.request)) {
      LOG.error("String_Node_Str" + this.request);
      if (!this.requestResult.isDone()) {
        RequestException ex=new RequestException("String_Node_Str",this.getRequest());
        try {
          this.result.setException(ex);
        }
 catch (        Throwable t) {
        }
      }
    }
 else {
      try {
        this.requestResult.get();
      }
 catch (      ExecutionException ex) {
        LOG.error(ex,ex);
      }
catch (      InterruptedException ex) {
        LOG.error(ex,ex);
      }
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    if (!this.result.isDone()) {
      this.result.setException(ex);
    }
    throw ex;
  }
  return this;
}
Program: 15233
Project: 15233
Buggy source:
@Override public boolean apply(final ServiceConfiguration config){
  final Component comp=config.lookupComponent();
  try {
    final CheckedListenableFuture<ServiceConfiguration> future=ServiceTransitions.transitionChain(config,Component.State.NOTREADY);
    Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future));
    return true;
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean apply(final ServiceConfiguration config){
  final Component comp=config.lookupComponent();
  try {
    final CheckedListenableFuture<ServiceConfiguration> future=ServiceTransitions.transitionChain(config,Component.State.NOTREADY);
    Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future)).get();
    return true;
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return false;
  }
}
Program: 15234
Project: 15234
Buggy source:
@Override public boolean start() throws Exception {
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      final Component comp=config.lookupComponent();
      try {
        final CheckedListenableFuture<ServiceConfiguration> future=ServiceTransitions.transitionChain(config,Component.State.NOTREADY);
        Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future));
        return true;
      }
 catch (      Exception e) {
        LOG.error(e,e);
        return false;
      }
    }
    private Runnable getTransitionRunnable(    final ServiceConfiguration config,    final Component comp,    final CheckedListenableFuture<ServiceConfiguration> future){
      Runnable followRunner=new Runnable(){
        @Override public void run(){
          try {
            future.get();
            try {
              ServiceTransitions.transitionChain(config,Component.State.ENABLED).get();
            }
 catch (            IllegalStateException ex) {
              LOG.error(ex,ex);
            }
catch (            InterruptedException ex) {
              LOG.error(ex,ex);
            }
catch (            ExecutionException ex) {
              LOG.error(ex,ex);
            }
          }
 catch (          Exception ex) {
            LOG.error(ex,ex);
          }
        }
      }
;
      return followRunner;
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean start() throws Exception {
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      final Component comp=config.lookupComponent();
      try {
        final CheckedListenableFuture<ServiceConfiguration> future=ServiceTransitions.transitionChain(config,Component.State.NOTREADY);
        Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future)).get();
        return true;
      }
 catch (      Exception e) {
        LOG.error(e,e);
        return false;
      }
    }
    private Runnable getTransitionRunnable(    final ServiceConfiguration config,    final Component comp,    final CheckedListenableFuture<ServiceConfiguration> future){
      Runnable followRunner=new Runnable(){
        @Override public void run(){
          try {
            future.get();
            try {
              ServiceTransitions.transitionChain(config,Component.State.ENABLED).get();
            }
 catch (            IllegalStateException ex) {
              LOG.error(ex,ex);
            }
catch (            InterruptedException ex) {
              LOG.error(ex,ex);
            }
catch (            ExecutionException ex) {
              LOG.error(ex,ex);
            }
          }
 catch (          Exception ex) {
            LOG.error(ex,ex);
          }
        }
      }
;
      return followRunner;
    }
  }
);
  return true;
}
Program: 15235
Project: 15235
Buggy source:
private static boolean checkDepends(Bootstrapper bootstrap){
  String bc=bootstrap.getClass().getCanonicalName();
  if (!bootstrap.checkLocal()) {
    EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsLocal().toString()).info();
    return false;
  }
 else   if (!bootstrap.checkRemote()) {
    EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsRemote().toString()).info();
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
private static boolean checkDepends(Bootstrapper bootstrap){
  String bc=bootstrap.getClass().getCanonicalName();
  if (bootstrap.checkLocal() && bootstrap.checkRemote()) {
    return true;
  }
 else   if (!bootstrap.checkLocal()) {
    EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsLocal().toString()).info();
  }
 else   if (!bootstrap.checkRemote()) {
    EventRecord.here(Bootstrap.class,EventType.BOOTSTRAPPER_SKIPPED,currentStage.name(),bc,"String_Node_Str",bootstrap.getDependsRemote().toString()).info();
  }
  return false;
}
Program: 15236
Project: 15236
Buggy source:
@Override public boolean apply(final ServiceConfiguration config){
  final Component comp=config.lookupComponent();
  try {
    final CheckedListenableFuture<ServiceConfiguration> future=comp.startTransition(config);
    Future<?> runResult=Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future));
    try {
      runResult.get(100,TimeUnit.MILLISECONDS);
    }
 catch (    InterruptedException ex) {
      LOG.error(ex,ex);
      Thread.currentThread().interrupt();
    }
    return true;
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean apply(final ServiceConfiguration config){
  final Component comp=config.lookupComponent();
  try {
    final CheckedListenableFuture<ServiceConfiguration> future=comp.startTransition(config);
    Future<?> runResult=Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future));
    try {
      runResult.get(100,TimeUnit.MILLISECONDS);
    }
 catch (    TimeoutException ex) {
      LOG.error(ex);
    }
catch (    InterruptedException ex) {
      LOG.error(ex,ex);
      Thread.currentThread().interrupt();
    }
    return true;
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return false;
  }
}
Program: 15237
Project: 15237
Buggy source:
private Runnable getTransitionRunnable(final ServiceConfiguration config,final Component comp,final CheckedListenableFuture<ServiceConfiguration> future){
  Runnable followRunner=new Runnable(){
    @Override public void run(){
      try {
        future.get();
        try {
          comp.enableTransition(config).get(100,TimeUnit.MILLISECONDS);
        }
 catch (        ServiceRegistrationException ex) {
          LOG.error(ex,ex);
        }
catch (        IllegalStateException ex) {
          LOG.error(ex,ex);
        }
catch (        InterruptedException ex) {
          LOG.error(ex,ex);
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
;
  return followRunner;
}

Fixed version (ground truth):
private Runnable getTransitionRunnable(final ServiceConfiguration config,final Component comp,final CheckedListenableFuture<ServiceConfiguration> future){
  Runnable followRunner=new Runnable(){
    @Override public void run(){
      try {
        future.get();
        try {
          comp.enableTransition(config).get(100,TimeUnit.MILLISECONDS);
        }
 catch (        ServiceRegistrationException ex) {
          LOG.error(ex,ex);
        }
catch (        IllegalStateException ex) {
          LOG.error(ex,ex);
        }
catch (        InterruptedException ex) {
          LOG.error(ex,ex);
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
catch (        TimeoutException ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
;
  return followRunner;
}
Program: 15239
Project: 15239
Buggy source:
@Override public void run(){
  try {
    future.get();
    try {
      comp.enableTransition(config).get(100,TimeUnit.MILLISECONDS);
    }
 catch (    ServiceRegistrationException ex) {
      LOG.error(ex,ex);
    }
catch (    IllegalStateException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      LOG.error(ex,ex);
    }
catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    future.get();
    try {
      comp.enableTransition(config).get(100,TimeUnit.MILLISECONDS);
    }
 catch (    ServiceRegistrationException ex) {
      LOG.error(ex,ex);
    }
catch (    IllegalStateException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      LOG.error(ex,ex);
    }
catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
catch (    TimeoutException ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}
Program: 15240
Project: 15240
Buggy source:
@Override public boolean apply(final ServiceConfiguration config){
  final Component comp=config.lookupComponent();
  try {
    final CheckedListenableFuture<ServiceConfiguration> future=comp.startTransition(config);
    Future<?> runResult=Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future));
    try {
      runResult.get(100,TimeUnit.MILLISECONDS);
    }
 catch (    TimeoutException ex) {
      LOG.error(ex);
    }
catch (    InterruptedException ex) {
      LOG.error(ex,ex);
      Thread.currentThread().interrupt();
    }
    return true;
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean apply(final ServiceConfiguration config){
  final Component comp=config.lookupComponent();
  try {
    final CheckedListenableFuture<ServiceConfiguration> future=ServiceTransitions.transitionChain(config,Component.State.NOTREADY);
    Threads.lookup(ConfigurationService.class,ServiceBootstrapper.class).submit(getTransitionRunnable(config,comp,future));
    return true;
  }
 catch (  Exception e) {
    LOG.error(e,e);
    return false;
  }
}
Program: 15241
Project: 15241
Buggy source:
private Runnable getTransitionRunnable(final ServiceConfiguration config,final Component comp,final CheckedListenableFuture<ServiceConfiguration> future){
  Runnable followRunner=new Runnable(){
    @Override public void run(){
      try {
        future.get();
        try {
          comp.enableTransition(config).get(100,TimeUnit.MILLISECONDS);
        }
 catch (        ServiceRegistrationException ex) {
          LOG.error(ex,ex);
        }
catch (        IllegalStateException ex) {
          LOG.error(ex,ex);
        }
catch (        InterruptedException ex) {
          LOG.error(ex,ex);
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
catch (        TimeoutException ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
;
  return followRunner;
}

Fixed version (ground truth):
private Runnable getTransitionRunnable(final ServiceConfiguration config,final Component comp,final CheckedListenableFuture<ServiceConfiguration> future){
  Runnable followRunner=new Runnable(){
    @Override public void run(){
      try {
        future.get();
        try {
          ServiceTransitions.transitionChain(config,Component.State.ENABLED).get();
        }
 catch (        IllegalStateException ex) {
          LOG.error(ex,ex);
        }
catch (        InterruptedException ex) {
          LOG.error(ex,ex);
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
;
  return followRunner;
}
Program: 15243
Project: 15243
Buggy source:
@Override public void run(){
  try {
    future.get();
    try {
      comp.enableTransition(config).get(100,TimeUnit.MILLISECONDS);
    }
 catch (    ServiceRegistrationException ex) {
      LOG.error(ex,ex);
    }
catch (    IllegalStateException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      LOG.error(ex,ex);
    }
catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
catch (    TimeoutException ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    future.get();
    try {
      ServiceTransitions.transitionChain(config,Component.State.ENABLED).get();
    }
 catch (    IllegalStateException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      LOG.error(ex,ex);
    }
catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}
Program: 15248
Project: 15248
Buggy source:
public static final boolean filterExceptions(final ServiceConfiguration parent,final Throwable ex){
  if (ex instanceof InterruptedException) {
    Thread.currentThread().interrupt();
  }
  return filterExceptions(parent,ex,NoopErrorFilter.INSTANCE);
}

Fixed version (ground truth):
public static final boolean filterExceptions(final ServiceConfiguration parent,final Throwable ex){
  return filterExceptions(parent,ex,NoopErrorFilter.INSTANCE);
}