nus-yam/ex-repair huggingface dataset:
Program: 14699
Project: 14699
Buggy source:
private ClusterAllocator(final Allocation allocInfo){
  this.allocInfo=allocInfo;
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    this.cluster=Clusters.lookup(allocInfo.getPartition());
    this.messages=new StatefulMessageSet<State>(this.cluster,State.values());
    this.setupVolumeMessages();
    this.setupNetworkMessages();
    for (    final ResourceToken token : allocInfo.getAllocationTokens()) {
      this.setupVmMessages(token);
    }
    db.commit();
  }
 catch (  final Exception e) {
    db.rollback();
    LOG.debug(e,e);
    this.allocInfo.abort();
    for (    final ResourceToken token : allocInfo.getAllocationTokens()) {
      try {
        final VmInstance vm=VmInstances.lookup(token.getInstanceId());
        vm.setState(VmState.TERMINATED,Reason.FAILED,e.getMessage());
      }
 catch (      final Exception e1) {
        LOG.debug(e1,e1);
      }
    }
  }
}

Fixed version (ground truth):
private ClusterAllocator(final Allocation allocInfo){
  this.allocInfo=allocInfo;
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    this.cluster=Clusters.lookup(Topology.lookup(ClusterController.class,allocInfo.getPartition()));
    this.messages=new StatefulMessageSet<State>(this.cluster,State.values());
    this.setupVolumeMessages();
    this.setupNetworkMessages();
    for (    final ResourceToken token : allocInfo.getAllocationTokens()) {
      this.setupVmMessages(token);
    }
    db.commit();
  }
 catch (  final Exception e) {
    db.rollback();
    LOG.debug(e,e);
    this.allocInfo.abort();
    for (    final ResourceToken token : allocInfo.getAllocationTokens()) {
      try {
        final VmInstance vm=VmInstances.lookup(token.getInstanceId());
        vm.setState(VmState.TERMINATED,Reason.FAILED,e.getMessage());
      }
 catch (      final Exception e1) {
        LOG.debug(e1,e1);
      }
    }
  }
}
Program: 14700
Project: 14700
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(Partitions.lookupService(Storage.class,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);
    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;
}
Program: 14701
Project: 14701
Buggy source:
@Override public void fireException(Throwable e){
  LOG.debug(e,e);
  LOG.debug("String_Node_Str" + this.getRequest().getVolumeId() + "String_Node_Str"+ this.getRequest().getInstanceId());
  try {
    VmInstance vm=VmInstances.lookup(this.getRequest().getInstanceId());
    Cluster cluster=Clusters.lookup(Topology.lookup(ClusterController.class,vm.lookupPartition()));
    ServiceConfiguration sc=Partitions.lookupService(Storage.class,cluster.getConfiguration().getPartition());
    try {
      Dispatcher dispatcher=ServiceDispatcher.lookup(sc);
      String iqn=cluster.getNode(vm.getServiceTag()).getIqn();
      LOG.debug("String_Node_Str" + cluster.getName() + "String_Node_Str"+ iqn+ "String_Node_Str"+ sc+ "String_Node_Str"+ dispatcher.getName()+ "String_Node_Str"+ dispatcher.getAddress());
      dispatcher.send(new DetachStorageVolumeType(iqn,this.getRequest().getVolumeId()));
    }
 catch (    EucalyptusCloudException ex) {
      LOG.error(ex,ex);
    }
    AttachedVolume failVol=new AttachedVolume(this.getRequest().getVolumeId());
    try {
      AttachedVolume volume=vm.removeVolumeAttachment(this.getRequest().getVolumeId());
      LOG.debug("String_Node_Str" + volume);
    }
 catch (    NoSuchElementException ex1) {
      LOG.error("String_Node_Str" + failVol);
    }
    LOG.debug("String_Node_Str" + failVol.getVolumeId() + "String_Node_Str"+ vm.getInstanceId());
  }
 catch (  Exception e1) {
    LOG.error(e1,e1);
  }
}

Fixed version (ground truth):
@Override public void fireException(Throwable e){
  LOG.debug(e,e);
  LOG.debug("String_Node_Str" + this.getRequest().getVolumeId() + "String_Node_Str"+ this.getRequest().getInstanceId());
  try {
    VmInstance vm=VmInstances.lookup(this.getRequest().getInstanceId());
    Partition partition=vm.lookupPartition();
    ServiceConfiguration cc=Topology.lookup(ClusterController.class,partition);
    Cluster cluster=Clusters.lookup(cc);
    ServiceConfiguration sc=Topology.lookup(Storage.class,partition);
    try {
      Dispatcher dispatcher=ServiceDispatcher.lookup(sc);
      String iqn=cluster.getNode(vm.getServiceTag()).getIqn();
      LOG.debug("String_Node_Str" + cluster.getName() + "String_Node_Str"+ iqn+ "String_Node_Str"+ sc+ "String_Node_Str"+ dispatcher.getName()+ "String_Node_Str"+ dispatcher.getAddress());
      dispatcher.send(new DetachStorageVolumeType(iqn,this.getRequest().getVolumeId()));
    }
 catch (    EucalyptusCloudException ex) {
      LOG.error(ex,ex);
    }
    AttachedVolume failVol=new AttachedVolume(this.getRequest().getVolumeId());
    try {
      AttachedVolume volume=vm.removeVolumeAttachment(this.getRequest().getVolumeId());
      LOG.debug("String_Node_Str" + volume);
    }
 catch (    NoSuchElementException ex1) {
      LOG.error("String_Node_Str" + failVol);
    }
    LOG.debug("String_Node_Str" + failVol.getVolumeId() + "String_Node_Str"+ vm.getInstanceId());
  }
 catch (  Exception e1) {
    LOG.error(e1,e1);
  }
}
Program: 14702
Project: 14702
Buggy source:
public CreateImageResponseType createImage(CreateImageType request) throws EucalyptusCloudException {
  CreateImageResponseType reply=request.getReply();
  Context ctx=Contexts.lookup();
  VmInstance vm;
  try {
    vm=RestrictedTypes.doPrivileged(request.getInstanceId(),VmInstance.class);
    if (!VmState.RUNNING.equals(vm.getState()) && !VmState.STOPPED.equals(vm.getState())) {
      throw new EucalyptusCloudException("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState().getName());
    }
    if (vm.isBlockStorage() && !ctx.hasAdministrativePrivileges()) {
      throw new EucalyptusCloudException("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState().getName());
    }
 else     if (vm.isBlockStorage()) {
    }
 else {
      Cluster cluster=null;
      try {
        cluster=Clusters.getInstance().lookup(vm.lookupPartition());
      }
 catch (      NoSuchElementException e) {
        LOG.debug(e);
        throw new EucalyptusCloudException("String_Node_Str" + Topology.lookup(ClusterController.class,vm.lookupPartition()));
      }
    }
  }
 catch (  AuthException ex) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId() + "String_Node_Str"+ ctx.getUser().getName());
  }
catch (  NoSuchElementException ex) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
catch (  PersistenceException ex) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
  return reply;
}

Fixed version (ground truth):
public CreateImageResponseType createImage(CreateImageType request) throws EucalyptusCloudException {
  CreateImageResponseType reply=request.getReply();
  Context ctx=Contexts.lookup();
  VmInstance vm;
  try {
    vm=RestrictedTypes.doPrivileged(request.getInstanceId(),VmInstance.class);
    if (!VmState.RUNNING.equals(vm.getState()) && !VmState.STOPPED.equals(vm.getState())) {
      throw new EucalyptusCloudException("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState().getName());
    }
    if (vm.isBlockStorage() && !ctx.hasAdministrativePrivileges()) {
      throw new EucalyptusCloudException("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState().getName());
    }
 else     if (vm.isBlockStorage()) {
    }
 else {
      Cluster cluster=null;
      try {
        ServiceConfiguration ccConfig=Topology.lookup(ClusterController.class,vm.lookupPartition());
        cluster=Clusters.lookup(ccConfig);
      }
 catch (      NoSuchElementException e) {
        LOG.debug(e);
        throw new EucalyptusCloudException("String_Node_Str" + vm.getPartition());
      }
    }
  }
 catch (  AuthException ex) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId() + "String_Node_Str"+ ctx.getUser().getName());
  }
catch (  NoSuchElementException ex) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
catch (  PersistenceException ex) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
  return reply;
}
Program: 14703
Project: 14703
Buggy source:
@Override public void entryRemoved(final String input){
  LOG.info("String_Node_Str" + input);
  if (!BootstrapArgs.isCloudController()) {
    Databases.disable(input);
  }
}

Fixed version (ground truth):
@Override public void entryRemoved(final String input){
  LOG.info("String_Node_Str" + input);
  Databases.disable(input);
}
Program: 14704
Project: 14704
Buggy source:
static void awaitDatabases() throws InterruptedException {
  if (!BootstrapArgs.isCloudController()) {
    while (list(filterBooedSyncedDbs).isEmpty()) {
      TimeUnit.SECONDS.sleep(3);
      LOG.info("String_Node_Str");
    }
    if (Databases.shouldInitialize()) {
      doInitialize();
    }
  }
 else   if (BootstrapArgs.isCloudController()) {
    for (Host coordinator=Hosts.getCoordinator(); !coordinator.hasSynced() && !coordinator.hasBootstrapped() && !coordinator.isLocalHost(); coordinator=Hosts.getCoordinator()) {
      TimeUnit.SECONDS.sleep(3);
      LOG.info("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
static void awaitDatabases() throws InterruptedException {
  if (!BootstrapArgs.isCloudController()) {
    while (list(filterBootedSyncedDbs).isEmpty()) {
      TimeUnit.SECONDS.sleep(3);
      LOG.info("String_Node_Str");
    }
    if (Databases.shouldInitialize()) {
      doInitialize();
    }
  }
 else   if (BootstrapArgs.isCloudController()) {
    for (Host coordinator=Hosts.getCoordinator(); !coordinator.hasSynced() && !coordinator.hasBootstrapped() && !coordinator.isLocalHost(); coordinator=Hosts.getCoordinator()) {
      TimeUnit.SECONDS.sleep(3);
      LOG.info("String_Node_Str");
    }
  }
}
Program: 14705
Project: 14705
Buggy source:
public void check() throws Faults.CheckException, IllegalStateException {
  final Cluster.State currentState=this.stateMachine.getState();
  final Component.State externalState=this.configuration.lookupState();
  final List<Throwable> currentErrors=Lists.newArrayList();
  try {
    Refresh.SERVICEREADY.apply(this);
  }
 catch (  Exception ex) {
    throw Faults.failure(this.configuration,ex);
  }
  currentErrors.addAll(this.pendingErrors);
  if (!currentErrors.isEmpty()) {
    throw Faults.failure(this.configuration,currentErrors);
  }
 else   if ((currentState.ordinal() < State.DISABLED.ordinal()) || (Component.State.ENABLED.equals(externalState) && (Cluster.State.ENABLING.ordinal() >= currentState.ordinal()))) {
    final IllegalStateException ex=new IllegalStateException("String_Node_Str" + externalState + "String_Node_Str"+ currentState+ "String_Node_Str");
    this.pendingErrors.add(ex);
    throw Faults.failure(this.configuration,currentErrors);
  }
}

Fixed version (ground truth):
public void check() throws Faults.CheckException, IllegalStateException {
  final Cluster.State currentState=this.stateMachine.getState();
  final Component.State externalState=this.configuration.lookupState();
  final List<Throwable> currentErrors=Lists.newArrayList();
  try {
    Refresh.SERVICEREADY.apply(this);
  }
 catch (  Exception ex) {
    CheckException fail=Faults.failure(this.configuration,ex);
    currentErrors.add(fail);
    throw fail;
  }
  currentErrors.addAll(this.pendingErrors);
  if (!currentErrors.isEmpty()) {
    throw Faults.failure(this.configuration,currentErrors);
  }
 else   if ((currentState.ordinal() < State.DISABLED.ordinal()) || (Component.State.ENABLED.equals(externalState) && (Cluster.State.ENABLING.ordinal() >= currentState.ordinal()))) {
    final IllegalStateException ex=new IllegalStateException("String_Node_Str" + externalState + "String_Node_Str"+ currentState+ "String_Node_Str");
    this.pendingErrors.add(ex);
    throw Faults.failure(this.configuration,currentErrors);
  }
}
Program: 14706
Project: 14706
Buggy source:
private static void runDbStateChange(Function<String,Runnable> runnableFunction){
  LOG.debug("String_Node_Str" + runnableFunction);
  try {
    if (canHas.writeLock().tryLock(30000L,TimeUnit.MILLISECONDS)) {
      try {
        Map<Runnable,Future<Runnable>> runnables=Maps.newHashMap();
        for (        final String ctx : PersistenceContexts.list()) {
          Runnable run=runnableFunction.apply(ctx);
          runnables.put(run,ExecuteRunnable.INSTANCE.apply(run));
        }
        Map<Runnable,Future<Runnable>> succeeded=Futures.waitAll(runnables);
        MapDifference<Runnable,Future<Runnable>> failed=Maps.difference(runnables,succeeded);
        StringBuilder builder=new StringBuilder();
        builder.append(Joiner.on("String_Node_Str").join(succeeded.keySet()));
        builder.append(Joiner.on("String_Node_Str").join(failed.entriesOnlyOnLeft().keySet()));
        LOG.debug(builder.toString());
        if (!failed.entriesOnlyOnLeft().isEmpty()) {
          throw Exceptions.toUndeclared(builder.toString());
        }
      }
  finally {
        canHas.writeLock().unlock();
      }
    }
 else {
      throw Exceptions.toUndeclared("String_Node_Str" + runnableFunction);
    }
  }
 catch (  InterruptedException ex) {
    Exceptions.maybeInterrupted(ex);
  }
catch (  RuntimeException ex) {
    LOG.error(ex);
    Logs.extreme().error(ex,ex);
    throw ex;
  }
}

Fixed version (ground truth):
private static void runDbStateChange(Function<String,Runnable> runnableFunction){
  LOG.debug("String_Node_Str" + runnableFunction);
  try {
    if (canHas.writeLock().tryLock(30000L,TimeUnit.MILLISECONDS)) {
      try {
        Map<Runnable,Future<Runnable>> runnables=Maps.newHashMap();
        for (        final String ctx : PersistenceContexts.list()) {
          Runnable run=runnableFunction.apply(ctx);
          runnables.put(run,ExecuteRunnable.INSTANCE.apply(run));
        }
        Map<Runnable,Future<Runnable>> succeeded=Futures.waitAll(runnables);
        MapDifference<Runnable,Future<Runnable>> failed=Maps.difference(runnables,succeeded);
        StringBuilder builder=new StringBuilder();
        builder.append(Joiner.on("String_Node_Str").join(succeeded.keySet()));
        builder.append(Joiner.on("String_Node_Str").join(failed.entriesOnlyOnLeft().keySet()));
        Logs.extreme().debug(builder.toString());
        if (!failed.entriesOnlyOnLeft().isEmpty()) {
          throw Exceptions.toUndeclared(builder.toString());
        }
      }
  finally {
        canHas.writeLock().unlock();
      }
    }
 else {
      throw Exceptions.toUndeclared("String_Node_Str" + runnableFunction);
    }
  }
 catch (  InterruptedException ex) {
    Exceptions.maybeInterrupted(ex);
  }
catch (  RuntimeException ex) {
    LOG.error(ex);
    Logs.extreme().error(ex,ex);
    throw ex;
  }
}
Program: 14707
Project: 14707
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + host.getDisplayName() + "String_Node_Str"+ contextName;
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str";
}
Program: 14708
Project: 14708
Buggy source:
public void check() throws Faults.CheckException, IllegalStateException {
  final Cluster.State currentState=this.stateMachine.getState();
  final Component.State externalState=this.configuration.lookupState();
  final List<Throwable> currentErrors=Lists.newArrayList();
  try {
    Refresh.SERVICEREADY.apply(this);
  }
 catch (  Exception ex) {
    throw Faults.failure(this.configuration,ex);
  }
  currentErrors.addAll(this.pendingErrors);
  if (!currentErrors.isEmpty()) {
    throw Faults.failure(this.configuration,currentErrors);
  }
 else   if ((currentState.ordinal() < State.DISABLED.ordinal()) || (Component.State.ENABLED.equals(externalState) && (Cluster.State.ENABLING.ordinal() >= currentState.ordinal()))) {
    final IllegalStateException ex=new IllegalStateException("String_Node_Str" + externalState + "String_Node_Str"+ currentState+ "String_Node_Str");
    this.pendingErrors.add(ex);
    throw Faults.failure(this.configuration,currentErrors);
  }
}

Fixed version (ground truth):
public void check() throws Faults.CheckException, IllegalStateException {
  final Cluster.State currentState=this.stateMachine.getState();
  final Component.State externalState=this.configuration.lookupState();
  final List<Throwable> currentErrors=Lists.newArrayList();
  try {
    Refresh.SERVICEREADY.apply(this);
  }
 catch (  Exception ex) {
    CheckException fail=Faults.failure(this.configuration,ex);
    currentErrors.add(fail);
    throw fail;
  }
  currentErrors.addAll(this.pendingErrors);
  if (!currentErrors.isEmpty()) {
    throw Faults.failure(this.configuration,currentErrors);
  }
 else   if ((currentState.ordinal() < State.DISABLED.ordinal()) || (Component.State.ENABLED.equals(externalState) && (Cluster.State.ENABLING.ordinal() >= currentState.ordinal()))) {
    final IllegalStateException ex=new IllegalStateException("String_Node_Str" + externalState + "String_Node_Str"+ currentState+ "String_Node_Str");
    this.pendingErrors.add(ex);
    throw Faults.failure(this.configuration,currentErrors);
  }
}
Program: 14709
Project: 14709
Buggy source:
private static void runDbStateChange(Function<String,Runnable> runnableFunction){
  LOG.debug("String_Node_Str" + runnableFunction);
  try {
    if (canHas.writeLock().tryLock(30000L,TimeUnit.MILLISECONDS)) {
      try {
        Map<Runnable,Future<Runnable>> runnables=Maps.newHashMap();
        for (        final String ctx : PersistenceContexts.list()) {
          Runnable run=runnableFunction.apply(ctx);
          runnables.put(run,ExecuteRunnable.INSTANCE.apply(run));
        }
        Map<Runnable,Future<Runnable>> succeeded=Futures.waitAll(runnables);
        MapDifference<Runnable,Future<Runnable>> failed=Maps.difference(runnables,succeeded);
        StringBuilder builder=new StringBuilder();
        builder.append(Joiner.on("String_Node_Str").join(succeeded.keySet()));
        builder.append(Joiner.on("String_Node_Str").join(failed.entriesOnlyOnLeft().keySet()));
        LOG.debug(builder.toString());
        if (!failed.entriesOnlyOnLeft().isEmpty()) {
          throw Exceptions.toUndeclared(builder.toString());
        }
      }
  finally {
        canHas.writeLock().unlock();
      }
    }
 else {
      throw Exceptions.toUndeclared("String_Node_Str" + runnableFunction);
    }
  }
 catch (  InterruptedException ex) {
    Exceptions.maybeInterrupted(ex);
  }
catch (  RuntimeException ex) {
    LOG.error(ex);
    Logs.extreme().error(ex,ex);
    throw ex;
  }
}

Fixed version (ground truth):
private static void runDbStateChange(Function<String,Runnable> runnableFunction){
  LOG.debug("String_Node_Str" + runnableFunction);
  try {
    if (canHas.writeLock().tryLock(30000L,TimeUnit.MILLISECONDS)) {
      try {
        Map<Runnable,Future<Runnable>> runnables=Maps.newHashMap();
        for (        final String ctx : PersistenceContexts.list()) {
          Runnable run=runnableFunction.apply(ctx);
          runnables.put(run,ExecuteRunnable.INSTANCE.apply(run));
        }
        Map<Runnable,Future<Runnable>> succeeded=Futures.waitAll(runnables);
        MapDifference<Runnable,Future<Runnable>> failed=Maps.difference(runnables,succeeded);
        StringBuilder builder=new StringBuilder();
        builder.append(Joiner.on("String_Node_Str").join(succeeded.keySet()));
        builder.append(Joiner.on("String_Node_Str").join(failed.entriesOnlyOnLeft().keySet()));
        Logs.extreme().debug(builder.toString());
        if (!failed.entriesOnlyOnLeft().isEmpty()) {
          throw Exceptions.toUndeclared(builder.toString());
        }
      }
  finally {
        canHas.writeLock().unlock();
      }
    }
 else {
      throw Exceptions.toUndeclared("String_Node_Str" + runnableFunction);
    }
  }
 catch (  InterruptedException ex) {
    Exceptions.maybeInterrupted(ex);
  }
catch (  RuntimeException ex) {
    LOG.error(ex);
    Logs.extreme().error(ex,ex);
    throw ex;
  }
}
Program: 14710
Project: 14710
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + host.getDisplayName() + "String_Node_Str"+ contextName;
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str";
}
Program: 14711
Project: 14711
Buggy source:
public static void persist(final CheckException errors){
  for (  final CheckException e : errors) {
    final EntityTransaction db=Entities.get(CheckException.class);
    try {
      Entities.persist(e);
      db.commit();
    }
 catch (    final Exception ex) {
      LOG.error("String_Node_Str" + ex,ex);
      db.rollback();
    }
  }
}

Fixed version (ground truth):
public static void persist(final CheckException errors){
  if (errors != null && Hosts.isCoordinator()) {
    try {
      for (      final CheckException e : errors) {
        final EntityTransaction db=Entities.get(CheckException.class);
        try {
          Entities.persist(e);
          db.commit();
        }
 catch (        final Exception ex) {
          LOG.error("String_Node_Str" + ex,ex);
          db.rollback();
        }
      }
    }
 catch (    Exception ex) {
      Logs.extreme().error(ex,ex);
    }
  }
}
Program: 14712
Project: 14712
Buggy source:
private static CheckException chain(final ServiceConfiguration config,final Severity severity,final List<? extends Throwable> exs){
  CheckException last=null;
  for (  final Throwable ex : Lists.reverse(exs)) {
    if ((last != null) && (ex instanceof CheckException)) {
      last.other=(CheckException)ex;
    }
 else     if (last == null) {
      last=new CheckException(config,severity,ex);
    }
  }
  last=(last != null ? last : new CheckException(config,Severity.DEBUG,new NullPointerException("String_Node_Str" + exs)));
  Logs.extreme().error(last,last);
  LOG.debug(last);
  LOG.debug(Exceptions.causeString(last));
  return last;
}

Fixed version (ground truth):
private static CheckException chain(final ServiceConfiguration config,final Severity severity,final List<? extends Throwable> exs){
  CheckException last=null;
  for (  final Throwable ex : Lists.reverse(exs)) {
    if ((last != null) && (ex instanceof CheckException)) {
      last.other=(CheckException)ex;
    }
 else     if (last == null) {
      last=new CheckException(config,severity,ex);
    }
  }
  last=(last != null ? last : new CheckException(config,Severity.DEBUG,new NullPointerException("String_Node_Str" + exs)));
  return last;
}
Program: 14713
Project: 14713
Buggy source:
private static void processTransition(final ServiceConfiguration parent,final Completion transitionCallback,final TransitionActions transitionAction){
  ServiceTransitionCallback trans=null;
  try {
    if (Hosts.isServiceLocal(parent)) {
      trans=ServiceLocalTransitionCallbacks.valueOf(transitionAction.name());
    }
 else     if (Hosts.isCoordinator()) {
      trans=CloudRemoteTransitionCallbacks.valueOf(transitionAction.name());
    }
 else {
      trans=ServiceRemoteTransitionNotification.valueOf(transitionAction.name());
    }
    if (trans != null) {
      Logs.exhaust().debug("String_Node_Str" + trans.getClass() + "String_Node_Str"+ transitionAction.name()+ "String_Node_Str"+ parent);
      trans.fire(parent);
    }
    transitionCallback.fire();
  }
 catch (  Exception ex) {
    LOG.error(ex);
    if (Faults.filter(parent,ex)) {
      transitionCallback.fireException(ex);
      throw Exceptions.toUndeclared(ex);
    }
 else {
      transitionCallback.fire();
    }
  }
}

Fixed version (ground truth):
private static void processTransition(final ServiceConfiguration parent,final Completion transitionCallback,final TransitionActions transitionAction){
  ServiceTransitionCallback trans=null;
  try {
    if (Hosts.isServiceLocal(parent)) {
      trans=ServiceLocalTransitionCallbacks.valueOf(transitionAction.name());
    }
 else     if (Hosts.isCoordinator()) {
      trans=CloudRemoteTransitionCallbacks.valueOf(transitionAction.name());
    }
 else {
      trans=ServiceRemoteTransitionNotification.valueOf(transitionAction.name());
    }
    if (trans != null) {
      Logs.exhaust().debug("String_Node_Str" + trans.getClass() + "String_Node_Str"+ transitionAction.name()+ "String_Node_Str"+ parent);
      trans.fire(parent);
    }
    transitionCallback.fire();
  }
 catch (  Exception ex) {
    LOG.error(parent.getFullName() + "String_Node_Str" + transitionAction.name()+ "String_Node_Str"+ ex.getMessage());
    if (Faults.filter(parent,ex)) {
      transitionCallback.fireException(ex);
      Faults.persist(Faults.failure(parent,ex));
      throw Exceptions.toUndeclared(ex);
    }
 else {
      Faults.persist(Faults.advisory(parent,ex));
      transitionCallback.fire();
    }
  }
}
Program: 14714
Project: 14714
Buggy source:
@Override public boolean check() throws Exception {
  return this.db.isRunning();
}

Fixed version (ground truth):
public static void check(){
  for (  String ctx : PersistenceContexts.list()) {
    try {
      DriverDatabaseClusterMBean db=lookup(ctx);
      for (      String host : db.getActiveDatabases()) {
        if (Hosts.lookup(host) == null) {
          disable(host);
        }
      }
    }
 catch (    NoSuchElementException ex) {
      LOG.error(ex,ex);
    }
    return;
  }
}
Program: 14716
Project: 14716
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){
  try {
    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,JiBXException.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);
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
  return false;
}
Program: 14717
Project: 14717
Buggy source:
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + quantity);
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + quantity);
}
throw new AuthException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + 1);
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + 1);
}
throw new AuthException("String_Node_Str");
}
Program: 14718
Project: 14718
Buggy source:
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(toMb(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + quantity));
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(toMb(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + quantity));
}
throw new AuthException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + quantity);
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + quantity);
}
throw new AuthException("String_Node_Str");
}
Program: 14724
Project: 14724
Buggy source:
@Override public void viewChange(final View currentView,final Vector<Address> joinMembers,final Vector<Address> partMembers){
  LOG.info("String_Node_Str" + printMap());
  LOG.info("String_Node_Str" + Joiner.on("String_Node_Str").join(currentView.getMembers()));
  if (!joinMembers.isEmpty())   LOG.info("String_Node_Str" + Joiner.on("String_Node_Str").join(joinMembers));
  if (!partMembers.isEmpty())   LOG.info("String_Node_Str" + Joiner.on("String_Node_Str").join(partMembers));
  for (  final Host h : Hosts.list()) {
    if (Iterables.contains(partMembers,h.getGroupsId())) {
      BootstrapComponent.TEARDOWN.apply(h);
      LOG.info("String_Node_Str" + h);
    }
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void viewChange(final View currentView,final Vector<Address> joinMembers,final Vector<Address> partMembers){
  LOG.info("String_Node_Str" + printMap());
  LOG.info("String_Node_Str" + Joiner.on("String_Node_Str").join(currentView.getMembers()));
  if (!joinMembers.isEmpty())   LOG.info("String_Node_Str" + Joiner.on("String_Node_Str").join(joinMembers));
  if (!partMembers.isEmpty())   LOG.info("String_Node_Str" + Joiner.on("String_Node_Str").join(partMembers));
  for (  final Host h : Hosts.list()) {
    if (Iterables.contains(partMembers,h.getGroupsId())) {
      try {
        BootstrapComponent.TEARDOWN.apply(h);
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
      LOG.info("String_Node_Str" + h);
    }
  }
  LOG.info("String_Node_Str");
}
Program: 14725
Project: 14725
Buggy source:
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + quantity);
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + quantity);
}
throw new AuthException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + 1);
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(RestrictedTypes.quantityMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + 1);
}
throw new AuthException("String_Node_Str");
}
Program: 14726
Project: 14726
Buggy source:
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(toMb(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + quantity));
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(toMb(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + quantity));
}
throw new AuthException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String value(Scope scope,String id,String resource,Long quantity) throws AuthException {
switch (scope) {
case ACCOUNT:
    return Long.toString(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(AccountFullName.getInstance(id)) + quantity);
case GROUP:
  return NOT_SUPPORTED;
case USER:
return Long.toString(RestrictedTypes.usageMetricFunction(VolumeMetadata.class).apply(UserFullName.getInstance(id)) + quantity);
}
throw new AuthException("String_Node_Str");
}
Program: 14727
Project: 14727
Buggy source:
@Override public void fireEvent(final Hertz event){
  final Host currentHost=Hosts.localHost();
  if (!BootstrapArgs.isCloudController() && currentHost.hasBootstrapped() && Databases.shouldInitialize()) {
    System.exit(123);
  }
  if (!Topology.isEnabled(Eucalyptus.class) && Hosts.getCoordinator() != null) {
    BootstrapComponent.setup(Eucalyptus.class,Hosts.getCoordinator().getBindAddress());
  }
  if (event.isAsserted(15L)) {
    UpdateEntry.INSTANCE.apply(currentHost);
  }
}

Fixed version (ground truth):
@Override public void fireEvent(final Hertz event){
  final Host currentHost=Hosts.localHost();
  if (!BootstrapArgs.isCloudController() && currentHost.hasBootstrapped() && Databases.shouldInitialize()) {
    System.exit(123);
  }
  if (!Topology.isEnabled(Eucalyptus.class) && Hosts.getCoordinator() != null) {
    BootstrapComponent.setup(Eucalyptus.class,Hosts.getCoordinator().getBindAddress());
  }
  if (event.isAsserted(3L) && Bootstrap.isFinished() && !Hosts.list(Predicates.not(BootedFilter.INSTANCE)).isEmpty()) {
    UpdateEntry.INSTANCE.apply(currentHost);
  }
 else   if (event.isAsserted(15L)) {
    UpdateEntry.INSTANCE.apply(currentHost);
  }
}
Program: 14728
Project: 14728
Buggy source:
@Override public void run(){
  try {
    try {
      Hosts.remove(Internets.localHostIdentifier());
    }
 catch (    final Exception ex) {
      LOG.error(ex,ex);
    }
    hostMap.stop();
  }
 catch (  final Exception ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    try {
      if (Hosts.contains(Internets.localHostIdentifier())) {
        Hosts.remove(Internets.localHostIdentifier());
      }
    }
 catch (    final Exception ex) {
      LOG.error(ex,ex);
    }
    hostMap.stop();
  }
 catch (  final Exception ex) {
    LOG.error(ex,ex);
  }
}
Program: 14729
Project: 14729
Buggy source:
private static <T extends ComponentId>Function<T,ServiceConfiguration> initRemoteSetupConfigurations(final InetAddress addr){
  return new Function<T,ServiceConfiguration>(){
    @Override public ServiceConfiguration apply(    final T input){
      Component component=Components.lookup(input);
      final ServiceConfiguration config=!Internets.testLocal(addr) ? component.initRemoteService(addr) : component.initService();
      LOG.info("String_Node_Str" + config.getFullName());
      return config;
    }
  }
;
}

Fixed version (ground truth):
private static <T extends ComponentId>Function<T,ServiceConfiguration> initRemoteSetupConfigurations(final InetAddress addr){
  return new Function<T,ServiceConfiguration>(){
    @Override public ServiceConfiguration apply(    final T input){
      Component component=Components.lookup(input);
      final ServiceConfiguration config=!Internets.testLocal(addr.getHostAddress()) ? component.initRemoteService(addr) : component.initService();
      LOG.info("String_Node_Str" + config.getFullName());
      return config;
    }
  }
;
}
Program: 14731
Project: 14731
Buggy source:
public Host get(){
  Host minHost=null;
  List<Host> dbHosts=Hosts.listActiveDatabases();
  for (  final Host h : dbHosts) {
    minHost=(minHost == null ? h : (minHost.getStartedTime() > h.getStartedTime() ? h : minHost));
  }
  return minHost;
}

Fixed version (ground truth):
public Host get(){
  List<Host> dbHosts=Hosts.listActiveDatabases();
  return findCoordinator(dbHosts);
}
Program: 14733
Project: 14733
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));
      final Queue workQueue=(this.serializedStates.contains(toState) ? Queue.INTERNAL : Queue.EXTERNAL);
      return workQueue.enqueue(call);
    }
  }
;
  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(call.call());
        }
 catch (        Exception ex) {
          return Futures.predestinedFuture(input);
        }
      }
    }
  }
;
  return transition;
}
Program: 14740
Project: 14740
Buggy source:
private static void processTransition(final ServiceConfiguration parent,final Completion transitionCallback,final TransitionActions transitionAction){
  ServiceTransitionCallback trans=null;
  try {
    if (parent.isVmLocal() || (parent.isHostLocal() && Hosts.isCoordinator())) {
      try {
        trans=ServiceLocalTransitionCallbacks.valueOf(transitionAction.name());
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
        throw ex;
      }
    }
 else     if (Hosts.isCoordinator()) {
      try {
        trans=CloudRemoteTransitionCallbacks.valueOf(transitionAction.name());
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
        throw ex;
      }
    }
 else {
      try {
        trans=ServiceRemoteTransitionNotification.valueOf(transitionAction.name());
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
        throw ex;
      }
    }
    if (trans != null) {
      Logs.exhaust().debug("String_Node_Str" + trans.getClass() + "String_Node_Str"+ transitionAction.name()+ "String_Node_Str"+ parent);
      trans.fire(parent);
    }
    transitionCallback.fire();
  }
 catch (  Exception ex) {
    if (Faults.filter(parent,ex)) {
      transitionCallback.fireException(ex);
      throw Exceptions.toUndeclared(ex);
    }
 else {
      transitionCallback.fire();
    }
  }
}

Fixed version (ground truth):
private static void processTransition(final ServiceConfiguration parent,final Completion transitionCallback,final TransitionActions transitionAction){
  ServiceTransitionCallback trans=null;
  try {
    if (Hosts.isServiceLocal(parent)) {
      try {
        trans=ServiceLocalTransitionCallbacks.valueOf(transitionAction.name());
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
        throw ex;
      }
    }
 else     if (Hosts.isCoordinator()) {
      try {
        trans=CloudRemoteTransitionCallbacks.valueOf(transitionAction.name());
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
        throw ex;
      }
    }
 else {
      try {
        trans=ServiceRemoteTransitionNotification.valueOf(transitionAction.name());
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
        throw ex;
      }
    }
    if (trans != null) {
      Logs.exhaust().debug("String_Node_Str" + trans.getClass() + "String_Node_Str"+ transitionAction.name()+ "String_Node_Str"+ parent);
      trans.fire(parent);
    }
    transitionCallback.fire();
  }
 catch (  Exception ex) {
    if (Faults.filter(parent,ex)) {
      transitionCallback.fireException(ex);
      throw Exceptions.toUndeclared(ex);
    }
 else {
      transitionCallback.fire();
    }
  }
}
Program: 14741
Project: 14741
Buggy source:
@Override public void fire(final ServiceConfiguration config){
  try {
    List<ConfigurableProperty> props=PropertyDirectory.getPropertyEntrySet(config.getComponentId().name());
    for (    ConfigurableProperty prop : props) {
      if (prop instanceof SingletonDatabasePropertyEntry) {
      }
 else       if (prop instanceof MultiDatabasePropertyEntry) {
        ((MultiDatabasePropertyEntry)prop).setIdentifierValue(config.getPartition());
        PropertyDirectory.removeProperty(prop);
      }
    }
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
@Override public void fire(ServiceConfiguration input){
  if (State.ENABLED.apply(input) && Hosts.isServiceLocal(input)) {
    try {
      LOG.debug("String_Node_Str" + input.getFullName());
      ServiceLocalTransitionCallbacks.DISABLE.fire(input);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
    }
  }
}
Program: 14743
Project: 14743
Buggy source:
@Override public void handleDownstream(final ChannelHandlerContext ctx,final ChannelEvent channelEvent) throws Exception {
  if (Logs.isExtrrreeeme()) {
    LOG.trace(LogUtil.dumpObject(channelEvent));
  }
  try {
    if (channelEvent instanceof MessageEvent) {
      final MessageEvent msgEvent=(MessageEvent)channelEvent;
      if (msgEvent.getMessage() != null) {
        this.outgoingMessage(ctx,msgEvent);
      }
 else {
        LOG.warn("String_Node_Str" + LogUtil.dumpObject(channelEvent));
      }
    }
    ctx.sendDownstream(channelEvent);
  }
 catch (  Exception e) {
    LOG.error(e,e);
    throw new WebServicesException(e.getMessage(),HttpResponseStatus.BAD_REQUEST);
  }
}

Fixed version (ground truth):
@Override public void handleDownstream(final ChannelHandlerContext ctx,final ChannelEvent channelEvent) throws Exception {
  try {
    if (channelEvent instanceof MessageEvent) {
      final MessageEvent msgEvent=(MessageEvent)channelEvent;
      if (msgEvent.getMessage() != null) {
        Callable<Long> stat=Statistics.startDownstream(ctx.getChannel().getId(),this);
        this.outgoingMessage(ctx,msgEvent);
        stat.call();
      }
    }
    ctx.sendDownstream(channelEvent);
  }
 catch (  Exception e) {
    throw new WebServicesException(e.getMessage(),HttpResponseStatus.BAD_REQUEST);
  }
}
Program: 14744
Project: 14744
Buggy source:
@Override public void handleUpstream(final ChannelHandlerContext ctx,final ChannelEvent channelEvent) throws Exception {
  if (Logs.isExtrrreeeme()) {
    LOG.trace(LogUtil.dumpObject(channelEvent));
  }
  if (channelEvent instanceof MessageEvent) {
    final MessageEvent msgEvent=(MessageEvent)channelEvent;
    this.incomingMessage(ctx,msgEvent);
    ctx.sendUpstream(channelEvent);
  }
 else {
    ctx.sendUpstream(channelEvent);
  }
}

Fixed version (ground truth):
@Override public void handleUpstream(final ChannelHandlerContext ctx,final ChannelEvent channelEvent) throws Exception {
  if (channelEvent instanceof MessageEvent) {
    final MessageEvent msgEvent=(MessageEvent)channelEvent;
    Callable<Long> stat=Statistics.startUpstream(ctx.getChannel().getId(),this);
    this.incomingMessage(ctx,msgEvent);
    stat.call();
    ctx.sendUpstream(channelEvent);
  }
 else {
    ctx.sendUpstream(channelEvent);
  }
}
Program: 14745
Project: 14745
Buggy source:
public static final <T extends ChannelHandler>void startUpstream(Integer correlationId,T handler){
  if (!StackConfiguration.STATISTICS) {
    return;
  }
 else   if (requestStatistics.containsKey(correlationId)) {
    RequestRecord record=requestStatistics.get(correlationId);
    if (record.last != null) {
      record.last.endTime=System.currentTimeMillis();
      record.last=null;
    }
    record.handlerUpstreamStats.put(handler.getClass(),record.last=new HandlerRecord(handler.getClass()));
  }
}

Fixed version (ground truth):
public static final <T extends ChannelHandler>Callable<Long> startUpstream(Integer correlationId,T handler){
  if (StackConfiguration.STATISTICS && requestStatistics.containsKey(correlationId)) {
    RequestRecord record=requestStatistics.get(correlationId);
    HandlerRecord handlerRecord=new HandlerRecord(handler.getClass());
    record.handlerUpstreamStats.put(handler.getClass(),handlerRecord);
    return handlerRecord;
  }
 else {
    return Callables.returning(0L);
  }
}