nus-yam/ex-repair huggingface dataset:
Program: 14620
Project: 14620
Buggy source:
@Override public boolean start() throws Exception {
  try {
    singleton.update();
    singleton.getClient();
    return true;
  }
 catch (  final Exception ex) {
    LOG.error(ex,ex);
    throw ex;
  }
}

Fixed version (ground truth):
@Override public boolean start() throws Exception {
  new Thread(){
    @Override public void run(){
      try {
        singleton.update();
        singleton.getClient();
      }
 catch (      final Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
.start();
  return true;
}
Program: 14621
Project: 14621
Buggy source:
public void fire(){
  try {
    if (!this.isDone()) {
      this.transition.enter(AtomicMarkedState.this.parent);
      this.transition.after(AtomicMarkedState.this.parent);
      AtomicMarkedState.this.commit();
    }
  }
 catch (  Exception t) {
    this.fireException(t);
  }
}

Fixed version (ground truth):
public void fire(){
  try {
    if (!this.isDone()) {
      this.transition.enter(AtomicMarkedState.this.parent);
      this.transition.after(AtomicMarkedState.this.parent);
      try {
        AtomicMarkedState.this.commit();
      }
 catch (      Exception ex) {
      }
    }
  }
 catch (  Exception t) {
    this.fireException(t);
  }
}
Program: 14622
Project: 14622
Buggy source:
public void run(){
  Thread.currentThread().setUncaughtExceptionHandler((UncaughtExceptionHandler)this);
  try {
    ListenerRegistry.getInstance().fireEventAsync(Hertz.class,new Hertz()).get(2,TimeUnit.MINUTES);
  }
 catch (  Exception t) {
    LOG.error(t);
    Logs.extreme().error(t,t);
  }
}

Fixed version (ground truth):
public void run(){
  Thread.currentThread().setUncaughtExceptionHandler((UncaughtExceptionHandler)this);
  try {
    ListenerRegistry.getInstance().fireEvent(new Hertz());
  }
 catch (  EventFailedException e) {
  }
catch (  Exception t) {
    LOG.error(t,t);
  }
}
Program: 14623
Project: 14623
Buggy source:
@Override public boolean apply(final ServiceConfiguration config){
  ServiceBootstrapWorker.submit(new Runnable(){
    @Override public void run(){
      try {
        Topology.transition(State.DISABLED).apply(config).get();
      }
 catch (      final Exception ex) {
        Exceptions.maybeInterrupted(ex);
      }
    }
    @Override public String toString(){
      return "String_Node_Str" + config.getFullName();
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(final ServiceConfiguration config){
  ServiceBootstrapWorker.submit(new Runnable(){
    @Override public void run(){
      try {
        Topology.transition(State.DISABLED).apply(config);
      }
 catch (      final Exception ex) {
        Exceptions.maybeInterrupted(ex);
      }
    }
    @Override public String toString(){
      return "String_Node_Str" + config.getFullName();
    }
  }
);
  return true;
}
Program: 14624
Project: 14624
Buggy source:
@Override public boolean start() throws Exception {
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          try {
            Topology.transition(State.DISABLED).apply(config).get();
          }
 catch (          final Exception ex) {
            Exceptions.maybeInterrupted(ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.markFinished();
  return true;
}

Fixed version (ground truth):
@Override public boolean start() throws Exception {
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          try {
            Topology.transition(State.DISABLED).apply(config);
          }
 catch (          final Exception ex) {
            Exceptions.maybeInterrupted(ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.markFinished();
  return true;
}
Program: 14625
Project: 14625
Buggy source:
@Override public void run(){
  try {
    Topology.transition(State.DISABLED).apply(config).get();
  }
 catch (  final Exception ex) {
    Exceptions.maybeInterrupted(ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Topology.transition(State.DISABLED).apply(config);
  }
 catch (  final Exception ex) {
    Exceptions.maybeInterrupted(ex);
  }
}
Program: 14626
Project: 14626
Buggy source:
@Override public boolean load(){
  WebServices.restart();
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          LOG.debug("String_Node_Str" + config);
          try {
            Components.lookup(config.getComponentId()).setup(config);
            if (config.lookupState().ordinal() < State.LOADED.ordinal()) {
              Topology.transition(State.LOADED).apply(config).get();
            }
          }
 catch (          final Exception ex) {
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.waitAll();
  return true;
}

Fixed version (ground truth):
@Override public boolean load(){
  WebServices.restart();
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          LOG.debug("String_Node_Str" + config);
          try {
            Components.lookup(config.getComponentId()).setup(config);
            if (config.lookupState().ordinal() < State.LOADED.ordinal()) {
              Topology.transition(State.LOADED).apply(config);
            }
          }
 catch (          final Exception ex) {
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.waitAll();
  return true;
}
Program: 14627
Project: 14627
Buggy source:
public static void submit(final Runnable run){
  if (!worker.running.get()) {
    throw new IllegalStateException("String_Node_Str" + ServiceBootstrapWorker.class);
  }
  worker.msgQueue.add(run);
}

Fixed version (ground truth):
public static void submit(final Runnable run){
  LOG.info(run);
  if (!worker.running.get()) {
    throw new IllegalStateException("String_Node_Str" + ServiceBootstrapWorker.class);
  }
 else {
    worker.msgQueue.add(run);
  }
}
Program: 14628
Project: 14628
Buggy source:
public static Function<ServiceConfiguration,Future<ServiceConfiguration>> transition(final Component.State toState){
  final Function<ServiceConfiguration,Future<ServiceConfiguration>> transition=new Function<ServiceConfiguration,Future<ServiceConfiguration>>(){
    private final List<Component.State> serializedStates=Lists.newArrayList(Component.State.ENABLED);
    @Override public Future<ServiceConfiguration> apply(    final ServiceConfiguration input){
      final Callable<ServiceConfiguration> call=Topology.callable(input,Topology.get(toState));
      if (Bootstrap.isOperational()) {
        final Queue workQueue=(this.serializedStates.contains(toState) ? Queue.INTERNAL : Queue.EXTERNAL);
        return workQueue.enqueue(call);
      }
 else {
        try {
          return Futures.predestinedFuture(call.call());
        }
 catch (        Exception ex) {
          return Futures.predestinedFuture(input);
        }
      }
    }
  }
;
  return transition;
}

Fixed version (ground truth):
public static Function<ServiceConfiguration,Future<ServiceConfiguration>> transition(final Component.State toState){
  final Function<ServiceConfiguration,Future<ServiceConfiguration>> transition=new Function<ServiceConfiguration,Future<ServiceConfiguration>>(){
    private final List<Component.State> serializedStates=Lists.newArrayList(Component.State.ENABLED);
    @Override public Future<ServiceConfiguration> apply(    final ServiceConfiguration input){
      final Callable<ServiceConfiguration> call=Topology.callable(input,Topology.get(toState));
      if (Bootstrap.isOperational()) {
        final Queue workQueue=(this.serializedStates.contains(toState) ? Queue.INTERNAL : Queue.EXTERNAL);
        return workQueue.enqueue(call);
      }
 else {
        try {
          return Futures.predestinedFuture(input);
        }
 catch (        Exception ex) {
          return Futures.predestinedFuture(input);
        }
      }
    }
  }
;
  return transition;
}
Program: 14629
Project: 14629
Buggy source:
@Override public boolean apply(final ServiceConfiguration config){
  ServiceBootstrapWorker.submit(new Runnable(){
    @Override public void run(){
      try {
        Topology.disable(config).get();
      }
 catch (      final Exception ex) {
        Exceptions.maybeInterrupted(ex);
        Faults.failure(config,ex);
      }
    }
    @Override public String toString(){
      return "String_Node_Str" + config.getFullName();
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(final ServiceConfiguration config){
  ServiceBootstrapWorker.submit(new Runnable(){
    @Override public void run(){
      try {
        Topology.transition(State.DISABLED).apply(config).get();
      }
 catch (      final Exception ex) {
        Exceptions.maybeInterrupted(ex);
      }
    }
    @Override public String toString(){
      return "String_Node_Str" + config.getFullName();
    }
  }
);
  return true;
}
Program: 14630
Project: 14630
Buggy source:
@Override public boolean start() throws Exception {
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          try {
            Topology.disable(config).get();
          }
 catch (          final Exception ex) {
            Exceptions.maybeInterrupted(ex);
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.markFinished();
  return true;
}

Fixed version (ground truth):
@Override public boolean start() throws Exception {
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          try {
            Topology.transition(State.DISABLED).apply(config).get();
          }
 catch (          final Exception ex) {
            Exceptions.maybeInterrupted(ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.markFinished();
  return true;
}
Program: 14631
Project: 14631
Buggy source:
@Override public void run(){
  try {
    Topology.disable(config).get();
  }
 catch (  final Exception ex) {
    Exceptions.maybeInterrupted(ex);
    Faults.failure(config,ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Topology.transition(State.DISABLED).apply(config).get();
  }
 catch (  final Exception ex) {
    Exceptions.maybeInterrupted(ex);
  }
}
Program: 14632
Project: 14632
Buggy source:
private static void fireCallback(final Cluster parent,final ServiceConfiguration config,final boolean doCoordinatorCheck,final SubjectRemoteCallbackFactory<RemoteCallback,Cluster> factory,final Callback.Completion transitionCallback){
  RemoteCallback messageCallback=null;
  try {
    if (!doCoordinatorCheck || checkCoordinator(transitionCallback)) {
      try {
        messageCallback=factory.newInstance();
        try {
          BaseMessage baseMessage=AsyncRequests.newRequest(messageCallback).then(transitionCallback).sendSync(config);
          if (Logs.isExtrrreeeme()) {
            Logs.extreme().debug(baseMessage);
          }
        }
 catch (        final Exception t) {
          if (!parent.swallowException(t)) {
            transitionCallback.fireException(Exceptions.unwrapCause(t));
          }
 else {
            transitionCallback.fire();
          }
        }
      }
 catch (      Exception ex) {
        transitionCallback.fireException(ex);
      }
    }
  }
  finally {
    if (!transitionCallback.isDone()) {
      LOG.debug(parent.getFullName() + "String_Node_Str" + messageCallback);
      Logs.exhaust().debug(Exceptions.toUndeclared(parent.getFullName() + "String_Node_Str" + messageCallback));
      transitionCallback.fire();
    }
  }
}

Fixed version (ground truth):
private static void fireCallback(final Cluster parent,final ServiceConfiguration config,final boolean doCoordinatorCheck,final SubjectRemoteCallbackFactory<RemoteCallback,Cluster> factory,final Callback.Completion transitionCallback){
  RemoteCallback messageCallback=null;
  try {
    if (!doCoordinatorCheck || checkCoordinator(transitionCallback)) {
      try {
        messageCallback=factory.newInstance();
        try {
          BaseMessage baseMessage=AsyncRequests.newRequest(messageCallback).sendSync(config);
          transitionCallback.fire();
          if (Logs.isExtrrreeeme()) {
            Logs.extreme().debug(baseMessage);
          }
        }
 catch (        final Exception t) {
          if (!parent.swallowException(t)) {
            transitionCallback.fireException(Exceptions.unwrapCause(t));
          }
 else {
            transitionCallback.fire();
          }
        }
      }
 catch (      Exception ex) {
        transitionCallback.fireException(ex);
      }
    }
  }
  finally {
    if (!transitionCallback.isDone()) {
      LOG.debug(parent.getFullName() + "String_Node_Str" + messageCallback);
      Logs.exhaust().debug(Exceptions.toUndeclared(parent.getFullName() + "String_Node_Str" + messageCallback));
      transitionCallback.fire();
    }
  }
}
Program: 14633
Project: 14633
Buggy source:
@Override public boolean load(){
  WebServices.restart();
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          LOG.debug("String_Node_Str" + config);
          try {
            Components.lookup(config.getComponentId()).setup(config);
            Topology.start(config).get();
          }
 catch (          final Exception ex) {
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.waitAll();
  return true;
}

Fixed version (ground truth):
@Override public boolean load(){
  WebServices.restart();
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          LOG.debug("String_Node_Str" + config);
          try {
            Components.lookup(config.getComponentId()).setup(config);
            if (config.lookupState().ordinal() < State.LOADED.ordinal()) {
              Topology.transition(State.LOADED).apply(config).get();
            }
          }
 catch (          final Exception ex) {
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.waitAll();
  return true;
}
Program: 14634
Project: 14634
Buggy source:
private void printAgenda(){
  if (!this.bootstrappers.isEmpty()) {
    LOG.info(LogUtil.header("String_Node_Str" + this.name() + "String_Node_Str"+ (Bootstrap.loading ? "String_Node_Str" : "String_Node_Str")));
    LOG.debug(Joiner.on("String_Node_Str").join(this.name() + "String_Node_Str",this.bootstrappers));
  }
}

Fixed version (ground truth):
private void printAgenda(){
  if (!this.bootstrappers.isEmpty()) {
    LOG.info(LogUtil.header("String_Node_Str" + this.name() + "String_Node_Str"+ (!Bootstrap.starting ? "String_Node_Str" : "String_Node_Str")));
    LOG.debug(Joiner.on("String_Node_Str").join(this.name() + "String_Node_Str",this.bootstrappers));
  }
}
Program: 14635
Project: 14635
Buggy source:
@Override public boolean load(){
  WebServices.restart();
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          LOG.debug("String_Node_Str" + config);
          try {
            Components.lookup(config.getComponentId()).setup(config);
            if (config.lookupState().ordinal() < State.LOADED.ordinal()) {
              Topology.transition(State.LOADED).apply(config);
            }
          }
 catch (          final Exception ex) {
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.waitAll();
  return true;
}

Fixed version (ground truth):
@Override public boolean load(){
  WebServices.restart();
  ServiceBootstrapper.execute(new Predicate<ServiceConfiguration>(){
    @Override public boolean apply(    final ServiceConfiguration config){
      ServiceBootstrapWorker.submit(new Runnable(){
        @Override public void run(){
          try {
            Components.lookup(config.getComponentId()).setup(config);
            if (config.lookupState().ordinal() < State.LOADED.ordinal()) {
              Topology.transition(State.LOADED).apply(config);
            }
          }
 catch (          final Exception ex) {
            Faults.failure(config,ex);
          }
        }
        @Override public String toString(){
          return "String_Node_Str" + config.getFullName();
        }
      }
);
      return true;
    }
  }
);
  ServiceBootstrapWorker.waitAll();
  return true;
}
Program: 14636
Project: 14636
Buggy source:
public static <T extends Throwable>T trace(String message,T t){
  Throwable filtered=new RuntimeException(t.getMessage());
  filtered.setStackTrace(Exceptions.filterStackTraceElements(t).toArray(steArrayType));
  LOG.info(message);
  LOG.trace(message,filtered);
  return t;
}

Fixed version (ground truth):
public static <T extends Throwable>T trace(String message,T t){
  Throwable filtered=new RuntimeException(t.getMessage());
  filtered.setStackTrace(Exceptions.filterStackTraceElements(t).toArray(steArrayType));
  LOG.trace(message);
  Logs.extreme().trace(message,filtered);
  return t;
}
Program: 14637
Project: 14637
Buggy source:
private AbstractTransitionAction<Cluster> newLogRefresh(final Class msgClass){
  final Cluster cluster=this;
  final SubjectRemoteCallbackFactory<RemoteCallback,Cluster> factory=newSubjectMessageFactory(msgClass,cluster);
  return new AbstractTransitionAction<Cluster>(){
    @Override public final void leave(    final Cluster parent,    final Callback.Completion transitionCallback){
      try {
        AsyncRequests.newRequest(factory.newInstance()).then(transitionCallback).sendSync(parent.getLogServiceConfiguration());
      }
 catch (      final ExecutionException e) {
        if (e.getCause() instanceof FailedRequestException) {
          LOG.error(e.getCause().getMessage());
        }
 else         if ((e.getCause() instanceof ConnectionException) || (e.getCause() instanceof IOException)) {
          LOG.error(parent.getName() + "String_Node_Str" + e.getCause().getMessage());
        }
 else {
          LOG.error(e,e);
        }
      }
catch (      final InterruptedException e) {
        LOG.error(e,e);
      }
    }
  }
;
}

Fixed version (ground truth):
private AbstractTransitionAction<Cluster> newLogRefresh(final Class msgClass){
  final Cluster cluster=this;
  final SubjectRemoteCallbackFactory<RemoteCallback,Cluster> factory=newSubjectMessageFactory(msgClass,cluster);
  return new AbstractTransitionAction<Cluster>(){
    @Override public final void leave(    final Cluster parent,    final Callback.Completion transitionCallback){
      Cluster.fireCallback(parent,parent.getLogServiceConfiguration(),false,factory,transitionCallback);
    }
  }
;
}
Program: 14638
Project: 14638
Buggy source:
@Override public final void leave(final Cluster parent,final Callback.Completion transitionCallback){
  try {
    AsyncRequests.newRequest(factory.newInstance()).then(transitionCallback).sendSync(parent.getLogServiceConfiguration());
  }
 catch (  final ExecutionException e) {
    if (e.getCause() instanceof FailedRequestException) {
      LOG.error(e.getCause().getMessage());
    }
 else     if ((e.getCause() instanceof ConnectionException) || (e.getCause() instanceof IOException)) {
      LOG.error(parent.getName() + "String_Node_Str" + e.getCause().getMessage());
    }
 else {
      LOG.error(e,e);
    }
  }
catch (  final InterruptedException e) {
    LOG.error(e,e);
  }
}

Fixed version (ground truth):
@Override public final void leave(final Cluster parent,final Callback.Completion transitionCallback){
  Cluster.fireCallback(parent,parent.getLogServiceConfiguration(),false,factory,transitionCallback);
}
Program: 14639
Project: 14639
Buggy source:
@Override public T newInstance(){
  try {
    final T callback=callbackClass.newInstance();
    callback.setSubject(subject);
    return callback;
  }
 catch (  final Throwable t) {
    LOG.error(t,t);
    throw new RuntimeException(t);
  }
}

Fixed version (ground truth):
@Override public T newInstance(){
  try {
    if (subject != null) {
      try {
        T callback=callbackClass.getConstructor(subject.getClass()).newInstance(subject);
        return callback;
      }
 catch (      NoSuchMethodException nsmex) {
        T callback=callbackClass.newInstance();
        callback.setSubject(subject);
        return callback;
      }
    }
 else {
      T callback=callbackClass.newInstance();
      LOG.error("String_Node_Str" + subject + "String_Node_Str"+ callbackClass.getCanonicalName());
      return callback;
    }
  }
 catch (  final Exception ex) {
    LOG.error(ex);
    Logs.exhaust().error(ex,ex);
    throw new RuntimeException(ex);
  }
}
Program: 14640
Project: 14640
Buggy source:
private static <P,T extends SubjectMessageCallback<P,Q,R>,Q extends BaseMessage,R extends BaseMessage>SubjectRemoteCallbackFactory<T,P> newSubjectMessageFactory(final Class<T> callbackClass,final P subject){
  return new SubjectRemoteCallbackFactory(){
    @Override public T newInstance(){
      try {
        final T callback=callbackClass.newInstance();
        callback.setSubject(subject);
        return callback;
      }
 catch (      final Throwable t) {
        LOG.error(t,t);
        throw new RuntimeException(t);
      }
    }
    @Override public P getSubject(){
      return subject;
    }
  }
;
}

Fixed version (ground truth):
private static <P,T extends SubjectMessageCallback<P,Q,R>,Q extends BaseMessage,R extends BaseMessage>SubjectRemoteCallbackFactory<T,P> newSubjectMessageFactory(final Class<T> callbackClass,final P subject){
  return new SubjectRemoteCallbackFactory<T,P>(){
    @Override public T newInstance(){
      try {
        if (subject != null) {
          try {
            T callback=callbackClass.getConstructor(subject.getClass()).newInstance(subject);
            return callback;
          }
 catch (          NoSuchMethodException nsmex) {
            T callback=callbackClass.newInstance();
            callback.setSubject(subject);
            return callback;
          }
        }
 else {
          T callback=callbackClass.newInstance();
          LOG.error("String_Node_Str" + subject + "String_Node_Str"+ callbackClass.getCanonicalName());
          return callback;
        }
      }
 catch (      final Exception ex) {
        LOG.error(ex);
        Logs.exhaust().error(ex,ex);
        throw new RuntimeException(ex);
      }
    }
    @Override public P getSubject(){
      return subject;
    }
  }
;
}
Program: 14641
Project: 14641
Buggy source:
private <T extends Throwable>boolean swallowException(final T t){
  Throwable fin=t;
  if (t instanceof ExecutionException) {
    fin=t.getCause() != null ? t.getCause() : t;
  }
  LOG.error(t);
  if (Exceptions.isCausedBy(t,InterruptedException.class)) {
    Thread.currentThread().interrupt();
  }
 else   if (Exceptions.isCausedBy(t,FailedRequestException.class)) {
    Logs.extreme().debug(fin,fin);
    this.pendingErrors.add(fin);
  }
 else   if (Exceptions.isCausedBy(t,ConnectionException.class) || Exceptions.isCausedBy(t,IOException.class)) {
    LOG.error(this.getName() + "String_Node_Str" + fin.getMessage());
    Logs.extreme().debug(fin,fin);
    this.pendingErrors.add(fin);
  }
 else {
    Logs.extreme().debug(fin,fin);
    this.pendingErrors.add(fin);
  }
  return false;
}

Fixed version (ground truth):
private <T extends Throwable>boolean swallowException(final T t){
  LOG.error(this.getConfiguration().getFullName() + "String_Node_Str" + Exceptions.causeString(t));
  if (Exceptions.isCausedBy(t,InterruptedException.class)) {
    Thread.currentThread().interrupt();
    return true;
  }
 else   if (Exceptions.isCausedBy(t,FailedRequestException.class)) {
    Logs.extreme().debug(t,t);
    this.pendingErrors.add(t);
    return false;
  }
 else   if (Exceptions.isCausedBy(t,ConnectionException.class) || Exceptions.isCausedBy(t,IOException.class)) {
    LOG.error(this.getName() + "String_Node_Str" + t.getMessage());
    Logs.extreme().debug(t,t);
    this.pendingErrors.add(t);
    return false;
  }
 else {
    Logs.extreme().debug(t,t);
    this.pendingErrors.add(t);
    return false;
  }
}
Program: 14642
Project: 14642
Buggy source:
public VmStateCallback(){
  super(new VmDescribeType(){
{
      regarding();
    }
  }
);
  Predicate<VmInstance> partitionFilter=new Predicate<VmInstance>(){
    @Override public boolean apply(    VmInstance input){
      return input.getPartition().equals(VmStateCallback.this.getSubject().getPartition()) || "String_Node_Str".equals(input.getPartition());
    }
  }
;
  Collection<VmInstance> clusterInstances=Collections2.filter(VmInstances.list(),partitionFilter);
  Collection<String> instanceNames=Collections2.transform(clusterInstances,CloudMetadatas.toDisplayName());
  this.initialInstances=Sets.newHashSet(instanceNames);
}

Fixed version (ground truth):
public VmStateCallback(){
  super(new VmDescribeType(){
{
      regarding();
    }
  }
);
  this.initialInstances=createInstanceSupplier(this);
}
Program: 14643
Project: 14643
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  ResourceToken other=(ResourceToken)obj;
  if (this.instanceUuid == null) {
    if (other.instanceUuid != null) {
      return false;
    }
  }
 else   if (!this.instanceUuid.equals(other.instanceUuid)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  ResourceToken other=(ResourceToken)obj;
  if (this.instanceId == null) {
    if (other.instanceId != null) {
      return false;
    }
  }
 else   if (!this.instanceId.equals(other.instanceId)) {
    return false;
  }
  return true;
}
Program: 14644
Project: 14644
Buggy source:
private VmTypeInfo makeVmTypeInfo(final VmTypeInfo vmInfo,final int index,final VirtualBootRecord root){
  VmTypeInfo childVmInfo=vmInfo;
  if (root.isBlockStorage()) {
    childVmInfo=vmInfo.child();
    final Volume vol=this.allocInfo.getPersistentVolumes().get(index);
    final Dispatcher sc=ServiceDispatcher.lookup(Topology.lookup(Storage.class,Partitions.lookupByName(vol.getPartition())));
    for (int i=0; i < 60; i++) {
      try {
        final DescribeStorageVolumesResponseType volState=sc.send(new DescribeStorageVolumesType(Lists.newArrayList(vol.getDisplayName())));
        if ("String_Node_Str".equals(volState.getVolumeSet().get(0).getStatus())) {
          break;
        }
 else {
          TimeUnit.SECONDS.sleep(1);
        }
      }
 catch (      final InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
catch (      final Exception ex) {
        LOG.error(ex,ex);
      }
    }
    for (    final String nodeTag : this.cluster.getNodeTags()) {
      try {
        final AttachStorageVolumeResponseType scAttachResponse=sc.send(new AttachStorageVolumeType(this.cluster.getNode(nodeTag).getIqn(),vol.getDisplayName()));
        childVmInfo.lookupRoot().setResourceLocation(scAttachResponse.getRemoteDeviceString());
      }
 catch (      final Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
  return childVmInfo;
}

Fixed version (ground truth):
private VmTypeInfo makeVmTypeInfo(final VmTypeInfo vmInfo,final int index,final VirtualBootRecord root){
  VmTypeInfo childVmInfo=vmInfo;
  if (root.isBlockStorage()) {
    childVmInfo=vmInfo.child();
    final Volume vol=this.allocInfo.getPersistentVolumes().get(index);
    ServiceConfiguration scConfig=Topology.lookup(Storage.class,Partitions.lookupByName(vol.getPartition()));
    for (int i=0; i < 60; i++) {
      try {
        DescribeStorageVolumesType describeMsg=new DescribeStorageVolumesType(Lists.newArrayList(vol.getDisplayName()));
        final DescribeStorageVolumesResponseType volState=AsyncRequests.sendSync(scConfig,describeMsg);
        if ("String_Node_Str".equals(volState.getVolumeSet().get(0).getStatus())) {
          break;
        }
 else {
          TimeUnit.SECONDS.sleep(1);
        }
      }
 catch (      final InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
catch (      final Exception ex) {
        LOG.error(ex,ex);
      }
    }
    for (    final String nodeTag : this.cluster.getNodeTags()) {
      try {
        AttachStorageVolumeType attachMsg=new AttachStorageVolumeType(this.cluster.getNode(nodeTag).getIqn(),vol.getDisplayName());
        final AttachStorageVolumeResponseType scAttachResponse=AsyncRequests.sendSync(scConfig,attachMsg);
        childVmInfo.lookupRoot().setResourceLocation(scAttachResponse.getRemoteDeviceString());
      }
 catch (      final Exception ex) {
        LOG.error(ex,ex);
      }
    }
  }
  return childVmInfo;
}
Program: 14645
Project: 14645
Buggy source:
@Override public void entrySet(final String hostKey,final Host host){
  if (Bootstrap.isShuttingDown()) {
    return;
  }
 else {
    LOG.info("String_Node_Str" + hostKey + "String_Node_Str"+ host);
    try {
      if (host.isLocalHost() && Bootstrap.isFinished()) {
        final boolean wasSynched=Databases.isSynchronized();
        Threads.enqueue(ServiceConfigurations.createEphemeral(Empyrean.INSTANCE),new Runnable(){
          @Override public void run(){
            Host currentHost=Hosts.lookup(hostKey);
            if (currentHost != null) {
              BootstrapComponent.SETUP.apply(currentHost);
              if (!wasSynched && Databases.isSynchronized()) {
                UpdateEntry.INSTANCE.apply(currentHost);
              }
            }
          }
        }
);
      }
 else       if (Bootstrap.isFinished() && !host.isLocalHost() && host.hasSynced()) {
        BootstrapComponent.REMOTESETUP.apply(host);
      }
 else       if (InitializeAsCloudController.INSTANCE.apply(host)) {
        LOG.info("String_Node_Str" + host);
      }
 else {
        LOG.debug("String_Node_Str" + host);
      }
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
    }
    LOG.info("String_Node_Str" + hostKey + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void entrySet(final String hostKey,final Host host){
  if (Bootstrap.isShuttingDown()) {
    return;
  }
 else {
    Logs.extreme().info("String_Node_Str" + hostKey + "String_Node_Str"+ host);
    try {
      if (host.isLocalHost() && Bootstrap.isFinished()) {
        final boolean wasSynched=Databases.isSynchronized();
        Threads.enqueue(ServiceConfigurations.createEphemeral(Empyrean.INSTANCE),new Runnable(){
          @Override public void run(){
            Host currentHost=Hosts.lookup(hostKey);
            if (currentHost != null) {
              BootstrapComponent.SETUP.apply(currentHost);
              if (!wasSynched && Databases.isSynchronized()) {
                UpdateEntry.INSTANCE.apply(currentHost);
              }
            }
          }
        }
);
      }
 else       if (Bootstrap.isFinished() && !host.isLocalHost() && host.hasSynced()) {
        BootstrapComponent.REMOTESETUP.apply(host);
      }
 else       if (InitializeAsCloudController.INSTANCE.apply(host)) {
        LOG.info("String_Node_Str" + host);
      }
 else {
        LOG.debug("String_Node_Str" + host);
      }
    }
 catch (    Exception ex) {
      LOG.error(ex);
      Logs.extreme().error(ex,ex);
    }
    Logs.extreme().info("String_Node_Str" + hostKey + "String_Node_Str");
  }
}
Program: 14646
Project: 14646
Buggy source:
private static Supplier<Set<String>> createInstanceSupplier(final StateUpdateMessageCallback<Cluster,?,?> cb){
  return Suppliers.memoize(new Supplier<Set<String>>(){
    @Override public Set<String> get(){
      Predicate<VmInstance> partitionFilter=new Predicate<VmInstance>(){
        @Override public boolean apply(        VmInstance input){
          return input.getPartition().equals(cb.getSubject().getPartition()) || "String_Node_Str".equals(input.getPartition());
        }
      }
;
      Collection<VmInstance> clusterInstances=Collections2.filter(VmInstances.list(),partitionFilter);
      Collection<String> instanceNames=Collections2.transform(clusterInstances,CloudMetadatas.toDisplayName());
      return Sets.newHashSet(instanceNames);
    }
  }
);
}

Fixed version (ground truth):
private static Supplier<Set<String>> createInstanceSupplier(final StateUpdateMessageCallback<Cluster,?,?> cb,final Predicate<VmInstance> filter){
  return Suppliers.memoize(new Supplier<Set<String>>(){
    @Override public Set<String> get(){
      Collection<VmInstance> clusterInstances=Collections2.filter(VmInstances.list(),filter);
      Collection<String> instanceNames=Collections2.transform(clusterInstances,CloudMetadatas.toDisplayName());
      return Sets.newHashSet(instanceNames);
    }
  }
);
}
Program: 14647
Project: 14647
Buggy source:
@Override public boolean apply(VmInstance input){
  return input.getPartition().equals(VmPendingCallback.this.getSubject().getPartition()) || "String_Node_Str".equals(input.getPartition());
}

Fixed version (ground truth):
@Override public boolean apply(VmInstance arg0){
  return arg0.getPartition().equals(cb.getSubject().getConfiguration().getPartition());
}
Program: 14648
Project: 14648
Buggy source:
@Override public Set<String> get(){
  Predicate<VmInstance> partitionFilter=new Predicate<VmInstance>(){
    @Override public boolean apply(    VmInstance input){
      return input.getPartition().equals(cb.getSubject().getPartition()) || "String_Node_Str".equals(input.getPartition());
    }
  }
;
  Collection<VmInstance> clusterInstances=Collections2.filter(VmInstances.list(),partitionFilter);
  Collection<String> instanceNames=Collections2.transform(clusterInstances,CloudMetadatas.toDisplayName());
  return Sets.newHashSet(instanceNames);
}

Fixed version (ground truth):
@Override public Set<String> get(){
  Collection<VmInstance> clusterInstances=Collections2.filter(VmInstances.list(),filter);
  Collection<String> instanceNames=Collections2.transform(clusterInstances,CloudMetadatas.toDisplayName());
  return Sets.newHashSet(instanceNames);
}
Program: 14649
Project: 14649
Buggy source:
@Override public void fire(VmDescribeResponseType reply){
  if (Databases.isSynchronizing()) {
    return;
  }
 else {
    for (    final VmInfo runVm : reply.getVms()) {
      if (this.initialInstances.contains(runVm.getInstanceId())) {
        VmStateCallback.handleReportedState(runVm);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void fire(VmDescribeResponseType reply){
  for (  final VmInfo runVm : reply.getVms()) {
    if (Databases.isVolatile()) {
      return;
    }
 else     if (this.initialInstances.get().contains(runVm.getInstanceId())) {
      VmStateCallback.handleReportedState(runVm);
    }
  }
}
Program: 14650
Project: 14650
Buggy source:
public VmStateCallback(){
  super(new VmDescribeType(){
{
      regarding();
    }
  }
);
  this.initialInstances=createInstanceSupplier(this);
}

Fixed version (ground truth):
public VmStateCallback(){
  super(new VmDescribeType(){
{
      regarding();
    }
  }
);
  this.initialInstances=createInstanceSupplier(this,partitionFilter(this));
}
Program: 14651
Project: 14651
Buggy source:
public VmPendingCallback(Cluster cluster){
  super(cluster);
  Predicate<VmInstance> partitionFilter=new Predicate<VmInstance>(){
    @Override public boolean apply(    VmInstance input){
      return input.getPartition().equals(VmPendingCallback.this.getSubject().getPartition()) || "String_Node_Str".equals(input.getPartition());
    }
  }
;
  Collection<VmInstance> clusterInstances=Collections2.filter(VmInstances.list(),partitionFilter);
  Collection<String> instanceNames=Collections2.transform(clusterInstances,CloudMetadatas.toDisplayName());
  this.initialInstances=Sets.newHashSet(instanceNames);
  super.setRequest(new VmDescribeType(){
{
      regarding();
      EntityTransaction db=Entities.get(VmInstance.class);
      try {
        for (        VmInstance vm : Iterables.filter(VmInstances.list(),VmPendingCallback.this.filter)) {
          if (vm.getCreationSplitTime() > VM_STATE_SETTLE_TIME) {
            this.getInstancesSet().add(vm.getInstanceId());
          }
        }
        Entities.commit(db);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        db.rollback();
      }
    }
  }
);
  if (this.getRequest().getInstancesSet().isEmpty()) {
    throw new CancellationException();
  }
}

Fixed version (ground truth):
public VmPendingCallback(Cluster cluster){
  super(cluster);
  this.initialInstances=createInstanceSupplier(this,this.filter);
  this.setRequest(new VmDescribeType(){
{
      regarding();
      EntityTransaction db=Entities.get(VmInstance.class);
      try {
        for (        VmInstance vm : Iterables.filter(VmInstances.list(),VmPendingCallback.this.filter)) {
          this.getInstancesSet().add(vm.getInstanceId());
        }
        Entities.commit(db);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        db.rollback();
      }
    }
  }
);
  if (this.getRequest().getInstancesSet().isEmpty()) {
    throw new CancellationException();
  }
}
Program: 14652
Project: 14652
Buggy source:
public static void awaitSynchronized(){
  if (!isSynchronizing()) {
    return;
  }
 else {
    Collection<StackTraceElement> stack=Threads.filteredStack(stackFilter);
    String caller=(stack.isEmpty() ? "String_Node_Str" : stack.iterator().next().toString());
    for (int i=0; i < MAX_TX_START_SYNC_RETRIES && isSynchronizing(); i++) {
      try {
        TimeUnit.MILLISECONDS.sleep(1000);
        LOG.debug("String_Node_Str" + caller);
      }
 catch (      InterruptedException ex) {
        Exceptions.maybeInterrupted(ex);
        return;
      }
    }
    if (!isSynchronized()) {
      throw new DatabaseStateException("String_Node_Str" + Hosts.listDatabases() + "String_Node_Str"+ Joiner.on("String_Node_Str").join(stack));
    }
  }
}

Fixed version (ground truth):
public static void awaitSynchronized(){
  if (!isVolatile()) {
    return;
  }
 else {
    Collection<StackTraceElement> stack=Threads.filteredStack(stackFilter);
    String caller=(stack.isEmpty() ? "String_Node_Str" : stack.iterator().next().toString());
    for (int i=0; i < MAX_TX_START_SYNC_RETRIES && isVolatile(); i++) {
      try {
        TimeUnit.MILLISECONDS.sleep(1000);
        LOG.debug("String_Node_Str" + caller);
      }
 catch (      InterruptedException ex) {
        Exceptions.maybeInterrupted(ex);
        return;
      }
    }
    if (!isSynchronized()) {
      throw new DatabaseStateException("String_Node_Str" + Hosts.listDatabases() + "String_Node_Str"+ Joiner.on("String_Node_Str").join(stack));
    }
  }
}
Program: 14653
Project: 14653
Buggy source:
public static void commit(EntityTransaction tx){
  if (tx.getRollbackOnly()) {
    tx.rollback();
  }
 else   if (Databases.isSynchronizing()) {
    tx.rollback();
  }
 else {
    tx.commit();
  }
}

Fixed version (ground truth):
public static void commit(EntityTransaction tx){
  if (tx.getRollbackOnly()) {
    tx.rollback();
  }
 else   if (Databases.isVolatile()) {
    tx.rollback();
  }
 else {
    tx.commit();
  }
}
Program: 14654
Project: 14654
Buggy source:
/** 
 * @see com.eucalyptus.util.fsm.State#commit()
 */
private void commit(){
  Logs.exhaust().trace("String_Node_Str" + this.currentTransition.get());
  if (!this.state.isMarked()) {
    IllegalStateException ex=Exceptions.trace(new IllegalStateException("String_Node_Str" + this.toString()));
    Logs.extreme().error(ex);
    throw ex;
  }
 else {
    ActiveTransition tr=this.currentTransition.getAndSet(null);
    this.state.set(tr.getTransitionRule().getToState(),tr.getTransitionRule().getToStateMark());
    if (!tr.getTransitionRule().getFromState().equals(tr.getTransitionRule().getToState())) {
      this.state.set(tr.getTransitionRule().getToState(),false);
      this.fireInListeners(tr.getTransitionRule().getToState());
    }
 else {
      this.state.set(tr.getTransitionRule().getToState(),false);
    }
    EventRecord.caller(this.getClass(),EventType.TRANSITION_FUTURE,"String_Node_Str" + this.parent.toString() + "String_Node_Str"+ this.parent.getClass().getCanonicalName()+ "String_Node_Str").trace();
    tr.getTransitionFuture().set(this.parent);
  }
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.fsm.State#commit()
 */
private void commit(){
  Logs.exhaust().trace("String_Node_Str" + this.currentTransition.get());
  if (!this.state.isMarked()) {
    IllegalStateException ex=new IllegalStateException("String_Node_Str" + this.toString());
    Logs.exhaust().error(ex,ex);
  }
 else {
    ActiveTransition tr=this.currentTransition.getAndSet(null);
    this.state.set(tr.getTransitionRule().getToState(),tr.getTransitionRule().getToStateMark());
    if (!tr.getTransitionRule().getFromState().equals(tr.getTransitionRule().getToState())) {
      this.state.set(tr.getTransitionRule().getToState(),false);
      this.fireInListeners(tr.getTransitionRule().getToState());
    }
 else {
      this.state.set(tr.getTransitionRule().getToState(),false);
    }
    EventRecord.caller(this.getClass(),EventType.TRANSITION_FUTURE,"String_Node_Str" + this.parent.toString() + "String_Node_Str"+ this.parent.getClass().getCanonicalName()+ "String_Node_Str").trace();
    tr.getTransitionFuture().set(this.parent);
  }
}
Program: 14655
Project: 14655
Buggy source:
public void fire(){
  try {
    this.transition.enter(AtomicMarkedState.this.parent);
    this.transition.after(AtomicMarkedState.this.parent);
    AtomicMarkedState.this.commit();
  }
 catch (  Exception t) {
    this.fireException(t);
  }
}

Fixed version (ground truth):
public void fire(){
  try {
    if (!this.isDone()) {
      this.transition.enter(AtomicMarkedState.this.parent);
      this.transition.after(AtomicMarkedState.this.parent);
      AtomicMarkedState.this.commit();
    }
  }
 catch (  Exception t) {
    this.fireException(t);
  }
}
Program: 14656
Project: 14656
Buggy source:
/** 
 * @see com.eucalyptus.util.fsm.State#commit()
 */
private void commit(){
  Logs.exhaust().trace("String_Node_Str" + this.currentTransition.get());
  if (!this.state.isMarked()) {
    IllegalStateException ex=Exceptions.trace(new IllegalStateException("String_Node_Str" + this.toString()));
    Logs.extreme().error(ex);
    throw ex;
  }
 else {
    ActiveTransition tr=this.currentTransition.getAndSet(null);
    this.state.set(tr.getTransitionRule().getToState(),tr.getTransitionRule().getToStateMark());
    if (!tr.getTransitionRule().getFromState().equals(tr.getTransitionRule().getToState())) {
      this.state.set(tr.getTransitionRule().getToState(),false);
      this.fireInListeners(tr.getTransitionRule().getToState());
    }
 else {
      this.state.set(tr.getTransitionRule().getToState(),false);
    }
    EventRecord.caller(this.getClass(),EventType.TRANSITION_FUTURE,"String_Node_Str" + this.parent.toString() + "String_Node_Str"+ this.parent.getClass().getCanonicalName()+ "String_Node_Str").trace();
    tr.getTransitionFuture().set(this.parent);
  }
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.fsm.State#commit()
 */
private void commit(){
  Logs.exhaust().trace("String_Node_Str" + this.currentTransition.get());
  if (!this.state.isMarked()) {
    IllegalStateException ex=new IllegalStateException("String_Node_Str" + this.toString());
    Logs.exhaust().error(ex,ex);
  }
 else {
    ActiveTransition tr=this.currentTransition.getAndSet(null);
    this.state.set(tr.getTransitionRule().getToState(),tr.getTransitionRule().getToStateMark());
    if (!tr.getTransitionRule().getFromState().equals(tr.getTransitionRule().getToState())) {
      this.state.set(tr.getTransitionRule().getToState(),false);
      this.fireInListeners(tr.getTransitionRule().getToState());
    }
 else {
      this.state.set(tr.getTransitionRule().getToState(),false);
    }
    EventRecord.caller(this.getClass(),EventType.TRANSITION_FUTURE,"String_Node_Str" + this.parent.toString() + "String_Node_Str"+ this.parent.getClass().getCanonicalName()+ "String_Node_Str").trace();
    tr.getTransitionFuture().set(this.parent);
  }
}
Program: 14657
Project: 14657
Buggy source:
public void fire(){
  try {
    this.transition.enter(AtomicMarkedState.this.parent);
    this.transition.after(AtomicMarkedState.this.parent);
    AtomicMarkedState.this.commit();
  }
 catch (  Exception t) {
    this.fireException(t);
  }
}

Fixed version (ground truth):
public void fire(){
  try {
    if (!this.isDone()) {
      this.transition.enter(AtomicMarkedState.this.parent);
      this.transition.after(AtomicMarkedState.this.parent);
      AtomicMarkedState.this.commit();
    }
  }
 catch (  Exception t) {
    this.fireException(t);
  }
}
Program: 14658
Project: 14658
Buggy source:
@Override public void leave(P parent,Callback.Completion transitionCallback){
  try {
    if (!predicate.apply(parent)) {
      transitionCallback.fireException(Transitions.exceptionOnCondition("String_Node_Str" + parent + "String_Node_Str",predicate));
    }
 else {
      transitionCallback.fire();
    }
  }
 catch (  Exception ex) {
    LOG.error(ex);
    transitionCallback.fireException(ex);
  }
}

Fixed version (ground truth):
@Override public void leave(P parent,Callback.Completion transitionCallback){
  try {
    if (!predicate.apply(parent)) {
      transitionCallback.fireException(Transitions.exceptionOnCondition("String_Node_Str" + parent + "String_Node_Str",predicate));
    }
 else {
      transitionCallback.fire();
    }
  }
 catch (  RuntimeException ex) {
    Logs.extreme().error(ex,ex);
    transitionCallback.fireException(ex);
  }
}