nus-yam/ex-repair huggingface dataset:
Program: 15159
Project: 15159
Buggy source:
public void enable() throws ServiceRegistrationException {
  if (State.ENABLED.ordinal() > this.stateMachine.getState().ordinal()) {
    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);
      ServiceRegistrationException fail=null;
      for (int i=0; i < CLUSTER_STARTUP_SYNC_RETRIES; i++) {
        CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
        try {
          res.get();
          fail=null;
          break;
        }
 catch (        Exception ex) {
          Logs.exhaust().error(ex,ex);
          fail=new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
        }
      }
      if (fail == null) {
        throw fail;
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
public void enable() throws ServiceRegistrationException {
  if (State.ENABLED.ordinal() > this.stateMachine.getState().ordinal()) {
    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);
      ServiceRegistrationException fail=null;
      for (int i=0; i < CLUSTER_STARTUP_SYNC_RETRIES; i++) {
        CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
        try {
          res.get();
          fail=null;
          break;
        }
 catch (        Exception ex) {
          Logs.exhaust().error(ex,ex);
          fail=new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
        }
      }
      if (fail != null) {
        throw fail;
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15160
Project: 15160
Buggy source:
public TransitionGuard getGuard(){
  return this.guard;
}

Fixed version (ground truth):
public TransitionGuard getGuard(){
  return (Bootstrap.isCloudController() ? cloudControllerGuard() : remoteGuard());
}
Program: 15161
Project: 15161
Buggy source:
private Topology(){
  super();
  this.guard=(Bootstrap.isCloudController() ? cloudControllerGuard() : remoteGuard());
  ListenerRegistry.getInstance().register(Hertz.class,this);
}

Fixed version (ground truth):
private Topology(){
  super();
  ListenerRegistry.getInstance().register(Hertz.class,this);
}
Program: 15162
Project: 15162
Buggy source:
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str").append(this.currentEpoch).append("String_Node_Str").append(this.guard.getClass().getSimpleName());
  return builder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str").append(this.currentEpoch).append("String_Node_Str").append(Bootstrap.isCloudController() ? "String_Node_Str" : "String_Node_Str");
  return builder.toString();
}
Program: 15163
Project: 15163
Buggy source:
private final void doFail(Throwable failure){
  while ((failure instanceof ExecutionException) && (failure.getCause() != null)) {
    failure=failure.getCause();
  }
  if (Callback.Checked.class.isAssignableFrom(this.callback.getClass())) {
    try {
      this.LOG.trace(EventRecord.here(this.callback.getClass(),EventType.CALLBACK,"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str",failure.getMessage()));
      ((Checked)this.callback).fireException(failure);
    }
 catch (    final Throwable t) {
      this.LOG.error("String_Node_Str" + failure.getMessage(),t);
    }
  }
 else   if (Callback.Completion.class.isAssignableFrom(this.callback.getClass())) {
    this.LOG.trace(EventRecord.here(this.callback.getClass(),EventType.CALLBACK,"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str",failure.getMessage()));
    ((Callback.Completion)this.callback).fire();
  }
}

Fixed version (ground truth):
private final void doFail(Throwable failure){
  this.LOG.trace(EventRecord.here(BasicCallbackProcessor.class,EventType.CALLBACK,this.callback.getClass().toString(),"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str"));
  this.LOG.trace(failure.getMessage(),failure);
  if (this.callback instanceof Callback.Checked) {
    ((Checked)this.callback).fireException(failure);
  }
 else   if (this.callback instanceof Callback.Completion) {
    ((Callback.Completion)this.callback).fire();
  }
}
Program: 15164
Project: 15164
Buggy source:
@Override public ClusterConfiguration add(String partitionName,String name,String host,Integer port) throws ServiceRegistrationException {
  ClusterConfiguration config=this.newInstance(partitionName,name,host,port);
  try {
    Partition part=Partitions.lookup(config);
    ServiceConfigurations.getInstance().store(config);
    part.syncKeysToDisk();
  }
 catch (  ServiceRegistrationException ex) {
    Partitions.maybeRemove(config.getPartition());
    throw ex;
  }
catch (  Throwable ex) {
    Partitions.maybeRemove(config.getPartition());
    LOG.error(ex,ex);
    throw new ServiceRegistrationException(String.format("String_Node_Str",partitionName,name,host,port),ex);
  }
  return config;
}

Fixed version (ground truth):
@Override public ClusterConfiguration add(String partitionName,String name,String host,Integer port) throws ServiceRegistrationException {
  ClusterConfiguration config=this.newInstance(partitionName,name,host,port);
  try {
    Partition part=Partitions.lookup(config);
    part.syncKeysToDisk();
    ServiceConfigurations.getInstance().store(config);
  }
 catch (  ServiceRegistrationException ex) {
    throw ex;
  }
catch (  Throwable ex) {
    LOG.error(ex,ex);
    throw new ServiceRegistrationException(String.format("String_Node_Str",partitionName,name,host,port),ex);
  }
  return config;
}
Program: 15166
Project: 15166
Buggy source:
@Override public <T extends ServiceConfiguration>T store(T t) throws ServiceRegistrationException {
  EntityWrapper<T> db=EntityWrapper.get(t);
  try {
    db.add(t);
    t=db.getUnique(t);
    db.commit();
    EventRecord.here(ServiceConfigurationProvider.class,EventClass.COMPONENT,EventType.COMPONENT_REGISTERED).withDetails(t.getComponentId().name(),t.getName(),"String_Node_Str",t.getHostName()).info();
  }
 catch (  Exception e) {
    db.rollback();
    LOG.error(e,e);
    throw new ServiceRegistrationException(e);
  }
  return t;
}

Fixed version (ground truth):
@Override public <T extends ServiceConfiguration>T store(T t) throws ServiceRegistrationException {
  EntityWrapper<T> db=EntityWrapper.get(t);
  try {
    db.add(t);
    t=db.getUnique(t);
    db.commit();
    EventRecord.here(ServiceConfigurationProvider.class,EventClass.COMPONENT,EventType.COMPONENT_REGISTERED,t.toString()).info();
  }
 catch (  Exception e) {
    db.rollback();
    EventRecord.here(ServiceConfigurationProvider.class,EventClass.COMPONENT,EventType.COMPONENT_REGISTERED,t.toString()).error();
    LOG.error(e,e);
    throw new ServiceRegistrationException(e);
  }
  return t;
}
Program: 15167
Project: 15167
Buggy source:
@Override public <T extends ServiceConfiguration>T remove(T t) throws ServiceRegistrationException {
  EntityWrapper<T> db=EntityWrapper.get(t);
  try {
    T searchConfig=(T)t.getClass().newInstance();
    searchConfig.setName(t.getName());
    T exists=db.getUnique(searchConfig);
    db.delete(exists);
    db.commit();
    EventRecord.here(ServiceConfigurationProvider.class,EventClass.COMPONENT,EventType.COMPONENT_DEREGISTERED).withDetails(t.getComponentId().name(),t.getName(),"String_Node_Str",t.getHostName()).info();
  }
 catch (  Exception e) {
    db.rollback();
    LOG.error(e,e);
    throw new ServiceRegistrationException(e);
  }
  return t;
}

Fixed version (ground truth):
@Override public <T extends ServiceConfiguration>T remove(T t) throws ServiceRegistrationException {
  EntityWrapper<T> db=EntityWrapper.get(t);
  try {
    T searchConfig=(T)t.getClass().newInstance();
    searchConfig.setName(t.getName());
    T exists=db.getUnique(searchConfig);
    db.delete(exists);
    db.commit();
    EventRecord.here(ServiceConfigurationProvider.class,EventClass.COMPONENT,EventType.COMPONENT_DEREGISTERED,t.toString()).info();
  }
 catch (  Exception e) {
    db.rollback();
    EventRecord.here(ServiceConfigurationProvider.class,EventClass.COMPONENT,EventType.COMPONENT_DEREGISTERED,t.toString()).error();
    LOG.error(e,e);
    throw new ServiceRegistrationException(e);
  }
  return t;
}
Program: 15169
Project: 15169
Buggy source:
@Override public void fire(DescribeServicesResponseType msg){
  List<ServiceStatusType> serviceStatuses=msg.getServiceStatuses();
  if (serviceStatuses.isEmpty()) {
    throw new NoSuchElementException("String_Node_Str" + this.getSubject().getConfiguration());
  }
 else {
    ServiceConfiguration config=this.getSubject().getConfiguration();
    for (    ServiceStatusType status : serviceStatuses) {
      if (config.getName().equals(status.getServiceId().getName())) {
        LOG.debug("String_Node_Str" + status);
        Component.State serviceState=Component.State.valueOf(status.getLocalState());
        CheckException ex=ServiceChecks.chainCheckExceptions(ServiceChecks.Functions.statusToCheckExceptions(this.getRequest().getCorrelationId()).apply(status));
        if (Component.State.NOTREADY.equals(serviceState)) {
          throw new IllegalStateException(ex);
        }
 else {
          this.getSubject().getConfiguration().info(ex);
        }
      }
 else {
        LOG.error("String_Node_Str" + status);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void fire(DescribeServicesResponseType msg){
  List<ServiceStatusType> serviceStatuses=msg.getServiceStatuses();
  if (serviceStatuses.isEmpty()) {
    throw new NoSuchElementException("String_Node_Str" + this.getSubject().getConfiguration());
  }
 else {
    ServiceConfiguration config=this.getSubject().getConfiguration();
    for (    ServiceStatusType status : serviceStatuses) {
      if (config.getName().equals(status.getServiceId().getName())) {
        LOG.debug("String_Node_Str" + status);
        Component.State serviceState=Component.State.valueOf(status.getLocalState());
        Component.State localState=this.getSubject().getConfiguration().lookupState();
        CheckException ex=ServiceChecks.chainCheckExceptions(ServiceChecks.Functions.statusToCheckExceptions(this.getRequest().getCorrelationId()).apply(status));
        if (Component.State.NOTREADY.equals(serviceState)) {
          throw new IllegalStateException(ex);
        }
 else         if (Component.State.NOTREADY.equals(localState) && Component.State.NOTREADY.ordinal() < serviceState.ordinal()) {
          this.getSubject().getConfiguration().debug(ex);
          this.getSubject().clearExceptions();
        }
 else {
          this.getSubject().getConfiguration().info(ex);
        }
      }
 else {
        LOG.error("String_Node_Str" + status);
      }
    }
  }
}
Program: 15171
Project: 15171
Buggy source:
private static TransitionException exceptionOnCondition(String message,Predicate p){
  return new TransitionException("String_Node_Str" + message + "String_Node_Str"+ p.getClass().getCanonicalName());
}

Fixed version (ground truth):
private static TransitionException exceptionOnCondition(String message,Predicate p){
  return new TransitionException("String_Node_Str" + message + "String_Node_Str"+ p.getClass());
}
Program: 15174
Project: 15174
Buggy source:
public void enable() throws ServiceRegistrationException {
  if (State.ENABLED.ordinal() > this.stateMachine.getState().ordinal()) {
    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);
      CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
      try {
        res.get();
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
public void enable() throws ServiceRegistrationException {
  if (State.ENABLED.ordinal() > this.stateMachine.getState().ordinal()) {
    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);
      ServiceRegistrationException fail=null;
      for (int i=0; i < CLUSTER_STARTUP_SYNC_RETRIES; i++) {
        CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
        try {
          res.get();
          fail=null;
          break;
        }
 catch (        Exception ex) {
          Logs.exhaust().error(ex,ex);
          fail=new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
        }
      }
      if (fail == null) {
        throw fail;
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15175
Project: 15175
Buggy source:
/** 
 * @see com.eucalyptus.util.async.Request#dispatch(java.lang.String)
 * @param cluster
 * @return
 */
@Override public CheckedListenableFuture<R> dispatch(final ServiceConfiguration serviceConfig){
  try {
    ServiceEndpoint serviceEndpoint=serviceConfig.lookupEndpoint();
    serviceEndpoint.enqueue(this);
    return this.getResponse();
  }
 catch (  Exception ex1) {
    Future<CheckedListenableFuture<R>> res=Threads.lookup(Empyrean.class,AsyncRequest.class,serviceConfig.getFullName().toString()).limitTo(NUM_WORKERS).submit(new Callable<CheckedListenableFuture<R>>(){
      @Override public CheckedListenableFuture<R> call() throws Exception {
        return AsyncRequest.this.execute(serviceConfig).getResponse();
      }
    }
);
    try {
      res.get().get();
    }
 catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      Thread.currentThread().interrupt();
      LOG.error(ex,ex);
    }
    return this.getResponse();
  }
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.async.Request#dispatch(java.lang.String)
 * @param cluster
 * @return
 */
@Override public CheckedListenableFuture<R> dispatch(final ServiceConfiguration serviceConfig){
  try {
    serviceConfig.lookupService().enqueue(this);
    return this.getResponse();
  }
 catch (  Exception ex1) {
    Future<CheckedListenableFuture<R>> res=Threads.lookup(Empyrean.class,AsyncRequest.class,serviceConfig.getFullName().toString()).limitTo(NUM_WORKERS).submit(new Callable<CheckedListenableFuture<R>>(){
      @Override public CheckedListenableFuture<R> call() throws Exception {
        return AsyncRequest.this.execute(serviceConfig).getResponse();
      }
    }
);
    try {
      res.get().get();
    }
 catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      Thread.currentThread().interrupt();
      LOG.error(ex,ex);
    }
    return this.getResponse();
  }
}
Program: 15178
Project: 15178
Buggy source:
private static <T extends EmpyreanMessage>T sendEmpyreanRequest(final ServiceConfiguration parent,final EmpyreanMessage msg) throws Throwable {
  ServiceConfiguration config=ServiceConfigurations.createEphemeral(Empyrean.INSTANCE,parent.getInetAddress());
  LOG.debug("String_Node_Str" + msg.getClass().getSimpleName() + "String_Node_Str"+ parent.getFullName());
  Throwable lastEx=null;
  for (int i=0; i < BOOTSTRAP_REMOTE_RETRIES; i++) {
    try {
      T reply=(T)AsyncRequests.sendSync(config,msg);
      return reply;
    }
 catch (    RetryableConnectionException ex) {
      try {
        TimeUnit.MILLISECONDS.sleep(BOOTSTRAP_REMOTE_RETRY_INTERVAL_MSEC);
      }
 catch (      InterruptedException ex1) {
        Thread.currentThread().interrupt();
      }
      lastEx=ex;
      continue;
    }
catch (    ExecutionException ex) {
      LOG.error(ex,ex);
      if (ex.getCause() instanceof RetryableConnectionException) {
        try {
          TimeUnit.MILLISECONDS.sleep(BOOTSTRAP_REMOTE_RETRY_INTERVAL_MSEC);
        }
 catch (        InterruptedException ex1) {
          Thread.currentThread().interrupt();
        }
        lastEx=ex.getCause();
        continue;
      }
 else {
        throw ex;
      }
    }
catch (    Throwable ex) {
      LOG.error(ex,ex);
      throw ex;
    }
  }
  throw new ServiceRegistrationException("String_Node_Str" + lastEx + "String_Node_Str"+ BOOTSTRAP_REMOTE_RETRIES+ "String_Node_Str"+ config.getUri()+ "String_Node_Str"+ msg,lastEx);
}

Fixed version (ground truth):
private static <T extends EmpyreanMessage>T sendEmpyreanRequest(final ServiceConfiguration parent,final EmpyreanMessage msg) throws Throwable {
  ServiceConfiguration config=ServiceConfigurations.createEphemeral(Empyrean.INSTANCE,parent.getInetAddress());
  LOG.debug("String_Node_Str" + msg.getClass().getSimpleName() + "String_Node_Str"+ parent.getFullName());
  Throwable lastEx=null;
  try {
    T reply=(T)AsyncRequests.sendSync(config,msg);
    return reply;
  }
 catch (  Throwable ex) {
    LOG.error(ex,ex);
    throw ex;
  }
}
Program: 15180
Project: 15180
Buggy source:
public VmTypeInfo populateVirtualBootRecord(VmType vmType) throws EucalyptusCloudException {
  Long imgSize=this.getMachine().getImageSizeBytes();
  if (imgSize > 1024l * 1024l * 1024l* vmType.getDisk()) {
    throw new EucalyptusCloudException("String_Node_Str" + imgSize / (1024l * 1024l) + "String_Node_Str" + vmType.getName() + "String_Node_Str" + vmType.getDisk() * 1024l + "String_Node_Str");
  }
  VmTypeInfo vmTypeInfo=createVmTypeInfo(vmType,imgSize);
  if (this.hasKernel()) {
    vmTypeInfo.setKernel(this.getKernel().getDisplayName(),this.getKernel().getManifestLocation());
  }
  if (this.hasRamdisk()) {
    vmTypeInfo.setRamdisk(this.getRamdisk().getDisplayName(),this.getRamdisk().getManifestLocation());
  }
  return vmTypeInfo;
}

Fixed version (ground truth):
public VmTypeInfo populateVirtualBootRecord(VmType vmType) throws EucalyptusCloudException {
  Long imgSize=this.getMachine().getImageSizeBytes();
  if (imgSize > 1024l * 1024l * 1024l* vmType.getDisk()) {
    throw new EucalyptusCloudException("String_Node_Str" + imgSize / (1024l * 1024l) + "String_Node_Str" + vmType.getName() + "String_Node_Str" + vmType.getDisk() * 1024l + "String_Node_Str");
  }
  VmTypeInfo vmTypeInfo=createVmTypeInfo(vmType,imgSize);
  if (!Image.Platform.windows.equals(this.getMachine().getPlatform())) {
    if (this.hasKernel()) {
      vmTypeInfo.setKernel(this.getKernel().getDisplayName(),this.getKernel().getManifestLocation());
    }
    if (this.hasRamdisk()) {
      vmTypeInfo.setRamdisk(this.getRamdisk().getDisplayName(),this.getRamdisk().getManifestLocation());
    }
  }
  return vmTypeInfo;
}
Program: 15185
Project: 15185
Buggy source:
@Override public boolean apply(ServiceConfiguration arg0){
  try {
    ServiceKey key=ServiceKey.create(arg0);
    return Bootstrap.isCloudController() && Component.State.DISABLED.isIn(arg0) && !Topology.this.services.containsKey(key);
  }
 catch (  ServiceRegistrationException ex) {
    LOG.error(ex,ex);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean apply(ServiceConfiguration arg0){
  try {
    ServiceKey key=ServiceKey.create(arg0);
    if (!Bootstrap.isCloudController()) {
      return false;
    }
 else     if (disabledServices.contains(arg0)) {
      return false;
    }
 else     if (!Component.State.DISABLED.isIn(arg0)) {
      return false;
    }
 else     if (!Topology.this.services.containsKey(key)) {
      return false;
    }
 else {
      return true;
    }
  }
 catch (  ServiceRegistrationException ex) {
    LOG.error(ex,ex);
    return false;
  }
}
Program: 15187
Project: 15187
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.errors.add(fin);
  }
 else   if ((fin instanceof ConnectionException) || (fin instanceof IOException)) {
    LOG.error(this.getName() + "String_Node_Str" + fin.getMessage());
    LOG.trace(fin,fin);
    this.errors.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);
  }
  return false;
}
Program: 15188
Project: 15188
Buggy source:
public void clearExceptions(){
  if (!this.errors.isEmpty()) {
    List<Throwable> currentErrors=Lists.newArrayList();
    this.errors.drainTo(currentErrors);
    for (    Throwable t : currentErrors) {
      Throwable filtered=Exceptions.filterStackTrace(t);
      LOG.error("String_Node_Str" + filtered.getMessage(),filtered);
    }
  }
 else {
    LOG.trace(this.toString() + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void clearExceptions(){
  if (!this.pendingErrors.isEmpty()) {
    List<Throwable> currentErrors=Lists.newArrayList();
    this.pendingErrors.drainTo(currentErrors);
    for (    Throwable t : currentErrors) {
      Throwable filtered=Exceptions.filterStackTrace(t);
      LOG.error("String_Node_Str" + filtered.getMessage(),filtered);
    }
  }
 else {
    LOG.trace(this.toString() + "String_Node_Str");
  }
}
Program: 15189
Project: 15189
Buggy source:
public String getValue(){
  EntityWrapper db=EntityWrapper.get(this.getDefiningClass());
  try {
    Object o=db.getUnique(this.getQueryObject());
    Object prop=this.getter.invoke(o);
    String result=prop != null ? prop.toString() : "String_Node_Str";
    db.commit();
    return result;
  }
 catch (  Exception e) {
    db.rollback();
    return "String_Node_Str" + e.getMessage();
  }
}

Fixed version (ground truth):
public String getValue(){
  EntityWrapper db=EntityWrapper.get(this.getDefiningClass());
  try {
    Object o=db.getUnique(this.getQueryObject());
    Object prop=this.getter.invoke(o);
    String result=prop != null ? prop.toString() : "String_Node_Str";
    db.commit();
    return result;
  }
 catch (  Exception e) {
    Logs.exhaust().error(e,e);
    db.rollback();
    return "String_Node_Str" + e.getMessage();
  }
}
Program: 15190
Project: 15190
Buggy source:
public String setValue(String s){
  EntityWrapper db=EntityWrapper.get(this.getDefiningClass());
  try {
    Object o=db.getUnique(this.getQueryObject());
    Object prop=this.getTypeParser().parse(s);
    this.fireChange(prop);
    this.setter.invoke(o,prop);
    db.commit();
    return s;
  }
 catch (  Exception e) {
    db.rollback();
    return "String_Node_Str" + e.getMessage();
  }
}

Fixed version (ground truth):
public String setValue(String s){
  EntityWrapper db=EntityWrapper.get(this.getDefiningClass());
  try {
    Object o=db.getUnique(this.getQueryObject());
    Object prop=this.getTypeParser().parse(s);
    this.fireChange(prop);
    this.setter.invoke(o,prop);
    db.commit();
    return s;
  }
 catch (  Exception e) {
    Logs.exhaust().error(e,e);
    db.rollback();
    return "String_Node_Str" + e.getMessage();
  }
}
Program: 15191
Project: 15191
Buggy source:
private final CheckedListenableFuture<P> afterLeave(final T transitionName,final ActiveTransition tid) throws IllegalStateException {
  try {
    CheckedListenableFuture<P> result=tid.leave();
    try {
      this.fireOutListeners(tid.getTransitionRule().getFromState());
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
    }
    return result;
  }
 catch (  Throwable t) {
    this.rollback(t);
    throw Exceptions.debug(new IllegalStateException(String.format("String_Node_Str",transitionName.toString(),t.getMessage()),t));
  }
}

Fixed version (ground truth):
private final CheckedListenableFuture<P> afterLeave(final T transitionName,final ActiveTransition tid) throws IllegalStateException {
  try {
    CheckedListenableFuture<P> result=tid.leave();
    try {
      this.fireOutListeners(tid.getTransitionRule().getFromState());
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
    }
    return result;
  }
 catch (  Throwable t) {
    this.error(t);
    throw Exceptions.debug(new IllegalStateException(String.format("String_Node_Str",transitionName.toString(),t.getMessage()),t));
  }
}
Program: 15193
Project: 15193
Buggy source:
/** 
 * @see com.eucalyptus.util.concurrent.ListenableFuture#addListener(java.util.concurrent.Callable)
 */
@Override public <T>CheckedListenableFuture<T> addListener(Callable<T> listener){
  return addListener(listener,Threads.currentThreadExecutor());
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.concurrent.ListenableFuture#addListener(java.util.concurrent.Callable)
 */
@Override public <T>CheckedListenableFuture<T> addListener(Callable<T> listener){
  return addListener(listener,Threads.lookup(Empyrean.class,AbstractListenableFuture.class));
}
Program: 15194
Project: 15194
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.error(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);
      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) {
          Thread.currentThread().interrupt();
          LOG.error(ex,ex);
        }
catch (        Exception ex) {
          LOG.error(ex,ex);
          error=ex;
        }
      }
      if (error != null) {
        this.configuration.error(error);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ error.getMessage(),error);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15195
Project: 15195
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.error(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);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ error.getMessage(),error);
    }
  }
}
Program: 15196
Project: 15196
Buggy source:
private RegistrationWorker(){
}

Fixed version (ground truth):
private RegistrationWorker(){
  this.executor.submit(this);
}
Program: 15197
Project: 15197
Buggy source:
private final void doFail(Throwable failure){
  if ((failure instanceof ExecutionException) && (failure.getCause() != null)) {
    failure=failure.getCause();
  }
  if (Callback.Checked.class.isAssignableFrom(this.callback.getClass())) {
    try {
      this.LOG.trace(EventRecord.here(this.callback.getClass(),EventType.CALLBACK,"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str",failure.getMessage()));
      ((Checked)this.callback).fireException(failure);
    }
 catch (    final Throwable t) {
      this.LOG.error("String_Node_Str" + failure.getMessage(),t);
    }
  }
 else   if (Callback.Completion.class.isAssignableFrom(this.callback.getClass())) {
    this.LOG.trace(EventRecord.here(this.callback.getClass(),EventType.CALLBACK,"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str",failure.getMessage()));
    ((Callback.Completion)this.callback).fire();
  }
}

Fixed version (ground truth):
private final void doFail(Throwable failure){
  while ((failure instanceof ExecutionException) && (failure.getCause() != null)) {
    failure=failure.getCause();
  }
  if (Callback.Checked.class.isAssignableFrom(this.callback.getClass())) {
    try {
      this.LOG.trace(EventRecord.here(this.callback.getClass(),EventType.CALLBACK,"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str",failure.getMessage()));
      ((Checked)this.callback).fireException(failure);
    }
 catch (    final Throwable t) {
      this.LOG.error("String_Node_Str" + failure.getMessage(),t);
    }
  }
 else   if (Callback.Completion.class.isAssignableFrom(this.callback.getClass())) {
    this.LOG.trace(EventRecord.here(this.callback.getClass(),EventType.CALLBACK,"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str",failure.getMessage()));
    ((Callback.Completion)this.callback).fire();
  }
}
Program: 15198
Project: 15198
Buggy source:
@PostUpdate @PostPersist private void writePartitionKeyFiles(){
  File keyDir=SubDirectory.KEYS.getChildFile(this.getName());
  X509Certificate systemX509=SystemCredentialProvider.getCredentialProvider(Eucalyptus.class).getCertificate();
  FileWriter out=null;
  try {
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getPrivateKey());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getCertificate());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getNodePrivateKey());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getNodeCertificate());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",systemX509);
    out=new FileWriter(keyDir.getAbsolutePath() + File.separator + "String_Node_Str");
    out.write(SystemIds.tunnelPassword());
    out.flush();
    out.close();
  }
 catch (  Throwable ex) {
    LOG.error(ex,ex);
    throw new RuntimeException("String_Node_Str" + this,ex);
  }
 finally {
    if (out != null)     try {
      out.close();
    }
 catch (    IOException e) {
      LOG.error(e,e);
    }
  }
}

Fixed version (ground truth):
@PostUpdate @PostPersist private void writePartitionKeyFiles(){
  File keyDir=SubDirectory.KEYS.getChildFile(this.getName());
  if (!keyDir.exists() && !keyDir.mkdir()) {
    throw new RuntimeException("String_Node_Str" + this);
  }
  X509Certificate systemX509=SystemCredentialProvider.getCredentialProvider(Eucalyptus.class).getCertificate();
  FileWriter out=null;
  try {
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getPrivateKey());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getCertificate());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getNodePrivateKey());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",this.getNodeCertificate());
    PEMFiles.write(keyDir.getAbsolutePath() + File.separator + "String_Node_Str",systemX509);
    out=new FileWriter(keyDir.getAbsolutePath() + File.separator + "String_Node_Str");
    out.write(SystemIds.tunnelPassword());
    out.flush();
    out.close();
  }
 catch (  Throwable ex) {
    LOG.error(ex,ex);
    throw new RuntimeException("String_Node_Str" + this,ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      IOException e) {
        LOG.error(e,e);
      }
    }
  }
}
Program: 15199
Project: 15199
Buggy source:
public static Partition lookup(final ServiceConfiguration config) throws ServiceRegistrationException {
  if (config.getComponentId().isPartitioned()) {
    final String partitionName=config.getPartition();
    EntityWrapper<Partition> db=EntityWrapper.get(Partition.class);
    Partition p=null;
    try {
      p=db.getUnique(Partition.newInstanceNamed(partitionName));
      db.commit();
    }
 catch (    EucalyptusCloudException ex1) {
      db.rollback();
      LOG.warn("String_Node_Str" + config + "String_Node_Str");
      p=Partitions.generatePartition(config);
    }
    return p;
  }
 else {
    return Partition.fakePartition(config.getComponentId());
  }
}

Fixed version (ground truth):
public static Partition lookup(final ServiceConfiguration config) throws ServiceRegistrationException {
  if (config.getComponentId().isPartitioned() && config.getComponentId().isRegisterable()) {
    final String partitionName=config.getPartition();
    EntityWrapper<Partition> db=EntityWrapper.get(Partition.class);
    Partition p=null;
    try {
      p=db.getUnique(Partition.newInstanceNamed(partitionName));
      db.commit();
    }
 catch (    EucalyptusCloudException ex1) {
      db.rollback();
      LOG.warn("String_Node_Str" + config + "String_Node_Str");
      p=Partitions.generatePartition(config);
    }
    return p;
  }
 else {
    return Partition.fakePartition(config.getComponentId());
  }
}
Program: 15200
Project: 15200
Buggy source:
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
          try {
            T res2=secondCall.call();
            resultFuture.set(res2.get());
          }
 catch (          Exception ex) {
            resultFuture.setException(ex);
          }
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
          resultFuture.setException(ex);
        }
catch (        ExecutionException ex) {
          resultFuture.setException(ex.getCause());
        }
catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}

Fixed version (ground truth):
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      resultFuture.setException(ex);
      intermediateFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
          try {
            T res2=secondCall.call();
            resultFuture.set(res2.get());
          }
 catch (          Exception ex) {
            resultFuture.setException(ex);
          }
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
          resultFuture.setException(ex);
        }
catch (        ExecutionException ex) {
          resultFuture.setException(ex.getCause());
        }
catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
).get();
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}
Program: 15202
Project: 15202
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);
      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) {
          Thread.currentThread().interrupt();
          LOG.error(ex,ex);
        }
catch (        Exception ex) {
          LOG.error(ex,ex);
          error=ex;
        }
      }
      if (error != null) {
        this.configuration.error(error);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ error.getMessage(),error);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),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);
      CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
      try {
        res.get();
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15203
Project: 15203
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.error(error);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ error.getMessage(),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);
    try {
      transition.call().get();
    }
 catch (    Exception ex) {
      Logs.exhaust().error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15204
Project: 15204
Buggy source:
@Override public void fireEnable(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_ENABLED,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  try {
    if (Components.lookup(Eucalyptus.class).isEnabledLocally()) {
      try {
        Cluster newCluster=Clusters.getInstance().lookupDisabled(config.getName());
        Clusters.getInstance().enable(config.getName());
        newCluster.enable();
      }
 catch (      NoSuchElementException ex) {
        Cluster newCluster=Clusters.getInstance().lookup(config.getName());
        newCluster.enable();
      }
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void fireEnable(ServiceConfiguration config) throws ServiceRegistrationException {
  LOG.info("String_Node_Str" + config);
  EventRecord.here(ClusterBuilder.class,EventType.COMPONENT_SERVICE_ENABLED,config.getComponentId().name(),config.getName(),config.getUri().toASCIIString()).info();
  try {
    try {
      Cluster newCluster=Clusters.getInstance().lookupDisabled(config.getName());
      Clusters.getInstance().enable(config.getName());
      newCluster.enable();
    }
 catch (    NoSuchElementException ex) {
      Cluster newCluster=Clusters.getInstance().lookup(config.getName());
      newCluster.enable();
    }
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex,ex);
  }
}