nus-yam/ex-repair huggingface dataset:
Program: 15412
Project: 15412
Buggy source:
private void store(){
  try {
    ListenerRegistry.getInstance().fireEvent(new InstanceEvent(this.getId(),this.getDisplayName(),this.vmTypeInfo.getName(),this.getOwner().getNamespace(),this.getOwner().getName(),this.clusterName,this.partition,this.networkBytes,this.blockBytes));
  }
 catch (  EventFailedException ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
private void store(){
  try {
    ListenerRegistry.getInstance().fireEvent(new InstanceEvent(this.getInstanceUuid(),this.getDisplayName(),this.vmTypeInfo.getName(),this.getOwner().getNamespace(),this.getOwner().getName(),this.clusterName,this.partition,this.networkBytes,this.blockBytes));
  }
 catch (  EventFailedException ex) {
    LOG.error(ex,ex);
  }
}
Program: 15413
Project: 15413
Buggy source:
private void store(){
  try {
    ListenerRegistry.getInstance().fireEvent(new InstanceEvent(this.getId(),this.getDisplayName(),this.vmTypeInfo.getName(),this.getOwner().getNamespace(),this.getOwner().getName(),this.clusterName,this.partition,this.networkBytes,this.blockBytes));
  }
 catch (  EventFailedException ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
private void store(){
  try {
    ListenerRegistry.getInstance().fireEvent(new InstanceEvent(this.getInstanceUuid(),this.getDisplayName(),this.vmTypeInfo.getName(),this.getOwner().getNamespace(),this.getOwner().getName(),this.clusterName,this.partition,this.networkBytes,this.blockBytes));
  }
 catch (  EventFailedException ex) {
    LOG.error(ex,ex);
  }
}
Program: 15414
Project: 15414
Buggy source:
@Override public void onSuccess(Void arg0){
  clientFactory.getShellView().getFooterView().showStatus(StatusType.NONE,"String_Node_Str" + value + "String_Node_Str",60000);
  doSearch(place.getSearch(),range);
}

Fixed version (ground truth):
@Override public void onSuccess(Void arg0){
  clientFactory.getShellView().getFooterView().showStatus(StatusType.NONE,"String_Node_Str" + value + "String_Node_Str",60000);
  reloadCurrentRange();
}
Program: 15415
Project: 15415
Buggy source:
@Override public void doCreateAccount(final String value){
  this.clientFactory.getShellView().getFooterView().showStatus(StatusType.LOADING,"String_Node_Str" + value + "String_Node_Str",0);
  this.createAccountDialog.hide();
  this.clientFactory.getBackendService().createAccount(this.clientFactory.getLocalSession().getSession(),value,new AsyncCallback<Void>(){
    @Override public void onFailure(    Throwable caught){
      String error="String_Node_Str" + value + "String_Node_Str"+ caught.getMessage();
      clientFactory.getShellView().getFooterView().showStatus(StatusType.ERROR,error,60000);
      clientFactory.getShellView().getLogView().log(LogType.ERROR,error);
    }
    @Override public void onSuccess(    Void arg0){
      clientFactory.getShellView().getFooterView().showStatus(StatusType.NONE,"String_Node_Str" + value + "String_Node_Str",60000);
      doSearch(place.getSearch(),range);
    }
  }
);
}

Fixed version (ground truth):
@Override public void doCreateAccount(final String value){
  this.clientFactory.getShellView().getFooterView().showStatus(StatusType.LOADING,"String_Node_Str" + value + "String_Node_Str",0);
  this.createAccountDialog.hide();
  this.clientFactory.getBackendService().createAccount(this.clientFactory.getLocalSession().getSession(),value,new AsyncCallback<Void>(){
    @Override public void onFailure(    Throwable caught){
      String error="String_Node_Str" + value + "String_Node_Str"+ caught.getMessage();
      clientFactory.getShellView().getFooterView().showStatus(StatusType.ERROR,error,60000);
      clientFactory.getShellView().getLogView().log(LogType.ERROR,error);
    }
    @Override public void onSuccess(    Void arg0){
      clientFactory.getShellView().getFooterView().showStatus(StatusType.NONE,"String_Node_Str" + value + "String_Node_Str",60000);
      reloadCurrentRange();
    }
  }
);
}
Program: 15416
Project: 15416
Buggy source:
public void restart(SearchResult newResult){
  clear();
  if (newResult != null) {
    this.sort=newResult.getRange();
    this.totalSize=newResult.getTotalSize();
    this.descs.addAll(newResult.getDescs());
  }
}

Fixed version (ground truth):
public void restart(SearchResult newResult){
  clear();
  if (newResult != null) {
    this.sort=newResult.getRange();
    this.totalSize=newResult.getTotalSize();
    this.descs.addAll(newResult.getDescs());
    LOG.log(Level.INFO,"String_Node_Str" + this.getDescs());
  }
}
Program: 15417
Project: 15417
Buggy source:
@Override public void init(){
  name.setText("String_Node_Str");
}

Fixed version (ground truth):
@Override public void init(){
  error.setText("String_Node_Str");
  name.setText("String_Node_Str");
}
Program: 15418
Project: 15418
Buggy source:
@UiHandler("String_Node_Str") void handleOkClickEvent(ClickEvent event){
  if (Strings.isNullOrEmpty(name.getValue())) {
    this.presenter.doCreateAccount(name.getValue());
  }
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void handleOkClickEvent(ClickEvent event){
  String checkError=InputChecker.checkAccountName(name.getValue());
  if (checkError == null) {
    this.presenter.doCreateAccount(name.getValue());
  }
 else {
    error.setText(checkError);
  }
}
Program: 15419
Project: 15419
Buggy source:
/** 
 * operation self-cancelled 
 */
public void check() throws CheckException {
  List<Throwable> currentErrors=Lists.newArrayList();
  this.errors.drainTo(currentErrors);
  if (!currentErrors.isEmpty()) {
    CheckException ex=ServiceChecks.Severity.ERROR.transform(this.configuration,currentErrors);
    throw ex;
  }
 else   if (State.NOTREADY.equals(this.stateMachine.getState())) {
    CheckException ex=ServiceChecks.Severity.ERROR.transform(configuration,new RuntimeException("String_Node_Str"));
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * operation self-cancelled 
 */
public void check() throws CheckException {
  List<Throwable> currentErrors=Lists.newArrayList();
  this.errors.drainTo(currentErrors);
  if (!currentErrors.isEmpty()) {
    CheckException ex=ServiceChecks.Severity.ERROR.transform(this.configuration,currentErrors);
    throw ex;
  }
}
Program: 15420
Project: 15420
Buggy source:
private VmInstance getVmInstance(UserFullName userFullName,VmAllocationInfo vmAllocInfo,String reservationId,ResourceToken token,Integer index,Integer networkIndex){
  VmInstance vmInst=new VmInstance(userFullName,VmInstances.getId(vmAllocInfo.getReservationIndex(),index),token.getInstanceIds().get(index),reservationId,index - 1,token.getCluster(),vmAllocInfo.getUserData(),vmAllocInfo.getKeyInfo(),vmAllocInfo.getVmTypeInfo(),vmAllocInfo.getPlatform(),vmAllocInfo.getNetworks(),networkIndex.toString());
  return vmInst;
}

Fixed version (ground truth):
private VmInstance getVmInstance(UserFullName userFullName,VmAllocationInfo vmAllocInfo,String reservationId,ResourceToken token,Integer index,Integer networkIndex){
  VmInstance vmInst=new VmInstance(userFullName,VmInstances.getId(vmAllocInfo.getReservationIndex(),index),token.getInstanceIds().get(index - 1),reservationId,index - 1,token.getCluster(),vmAllocInfo.getUserData(),vmAllocInfo.getKeyInfo(),vmAllocInfo.getVmTypeInfo(),vmAllocInfo.getPlatform(),vmAllocInfo.getNetworks(),networkIndex.toString());
  return vmInst;
}
Program: 15421
Project: 15421
Buggy source:
private VmInstance getVmInstance(UserFullName userFullName,VmAllocationInfo vmAllocInfo,String reservationId,ResourceToken token,Integer index,Integer networkIndex){
  VmInstance vmInst=new VmInstance(userFullName,VmInstances.getId(vmAllocInfo.getReservationIndex(),index),token.getInstanceIds().get(index - 1),reservationId,index - 1,token.getCluster(),vmAllocInfo.getUserData(),vmAllocInfo.getKeyInfo(),vmAllocInfo.getVmTypeInfo(),vmAllocInfo.getPlatform(),vmAllocInfo.getNetworks(),networkIndex.toString());
  return vmInst;
}

Fixed version (ground truth):
private VmInstance getVmInstance(UserFullName userFullName,VmAllocationInfo vmAllocInfo,String reservationId,ResourceToken token,Integer index,Integer networkIndex){
  VmInstance vmInst=new VmInstance(userFullName,VmInstances.getId(vmAllocInfo.getReservationIndex(),index),token.getInstanceUuids().get(index - 1),reservationId,index - 1,token.getCluster(),vmAllocInfo.getUserData(),vmAllocInfo.getKeyInfo(),vmAllocInfo.getVmTypeInfo(),vmAllocInfo.getPlatform(),vmAllocInfo.getNetworks(),networkIndex.toString());
  return vmInst;
}
Program: 15422
Project: 15422
Buggy source:
@Override public void fireCheck(ServiceConfiguration config) throws ServiceRegistrationException, CheckException {
  Clusters.lookup(config).check();
}

Fixed version (ground truth):
@Override public void fireCheck(ServiceConfiguration config) throws ServiceRegistrationException, CheckException {
  try {
    Clusters.lookup(config).check();
  }
 catch (  NoSuchElementException ex) {
    LOG.error(ex);
  }
}
Program: 15423
Project: 15423
Buggy source:
public synchronized ResourceToken getResourceAllocation(String requestId,UserFullName userFullName,String vmTypeName,Integer min,Integer max) throws NotEnoughResourcesAvailable {
  VmTypeAvailability vmType=this.typeMap.get(vmTypeName);
  Integer available=vmType.getAvailable();
  NavigableSet<VmTypeAvailability> sorted=this.sorted();
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  Integer quantity=min;
  if (vmType.getAvailable() < min) {
    throw new NotEnoughResourcesAvailable("String_Node_Str" + available + "String_Node_Str"+ min+ "String_Node_Str");
  }
 else {
    quantity=(max < available ? max : available);
  }
  Set<VmTypeAvailability> tailSet=sorted.tailSet(vmType);
  Set<VmTypeAvailability> headSet=sorted.headSet(vmType);
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(LogUtil.subheader("String_Node_Str" + tailSet));
  LOG.debug(LogUtil.subheader("String_Node_Str" + headSet));
  for (  VmTypeAvailability v : tailSet)   v.decrement(quantity);
  for (  VmTypeAvailability v : headSet)   v.setAvailable(vmType.getAvailable());
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  ResourceToken token=new ResourceToken(userFullName,requestId,this.clusterName,quantity,this.virtualTimer++,vmTypeName);
  for (int i=0; i < quantity; i++) {
    token.getInstanceUuids().add(UUID.randomUUID().toString());
  }
  EventRecord.caller(ResourceToken.class,EventType.TOKEN_RESERVED,token.toString()).info();
  this.pendingTokens.add(token);
  return token;
}

Fixed version (ground truth):
public synchronized ResourceToken getResourceAllocation(String requestId,UserFullName userFullName,String vmTypeName,Integer min,Integer max) throws NotEnoughResourcesAvailable {
  VmTypeAvailability vmType=this.typeMap.get(vmTypeName);
  Integer available=vmType.getAvailable();
  NavigableSet<VmTypeAvailability> sorted=this.sorted();
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  Integer quantity=min;
  if (vmType.getAvailable() < min) {
    throw new NotEnoughResourcesAvailable("String_Node_Str" + available + "String_Node_Str"+ min+ "String_Node_Str");
  }
 else {
    quantity=(max < available ? max : available);
  }
  Set<VmTypeAvailability> tailSet=sorted.tailSet(vmType);
  Set<VmTypeAvailability> headSet=sorted.headSet(vmType);
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(LogUtil.subheader("String_Node_Str" + tailSet));
  LOG.debug(LogUtil.subheader("String_Node_Str" + headSet));
  for (  VmTypeAvailability v : tailSet)   v.decrement(quantity);
  for (  VmTypeAvailability v : headSet)   v.setAvailable(vmType.getAvailable());
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  ResourceToken token=new ResourceToken(userFullName,requestId,this.clusterName,quantity,this.virtualTimer++,vmTypeName);
  EventRecord.caller(ResourceToken.class,EventType.TOKEN_RESERVED,token.toString()).info();
  this.pendingTokens.add(token);
  return token;
}
Program: 15424
Project: 15424
Buggy source:
public ResourceToken(final UserFullName userFullName,final String correlationId,final String cluster,final int amount,final int sequenceNumber,final String vmType){
  this.cluster=cluster;
  this.correlationId=correlationId;
  this.userFullName=userFullName;
  this.amount=amount;
  this.sequenceNumber=sequenceNumber;
  this.creationTime=Calendar.getInstance().getTime();
  this.vmType=vmType;
}

Fixed version (ground truth):
public ResourceToken(final UserFullName userFullName,final String correlationId,final String cluster,final int amount,final int sequenceNumber,final String vmType){
  this.cluster=cluster;
  this.correlationId=correlationId;
  this.userFullName=userFullName;
  this.amount=amount;
  for (int i=0; i < amount; i++) {
    this.instanceUuids.add(UUID.randomUUID().toString());
  }
  this.sequenceNumber=sequenceNumber;
  this.creationTime=Calendar.getInstance().getTime();
  this.vmType=vmType;
}
Program: 15425
Project: 15425
Buggy source:
private VmInstance getVmInstance(UserFullName userFullName,VmAllocationInfo vmAllocInfo,String reservationId,ResourceToken token,Integer index,Integer networkIndex){
  VmInstance vmInst=new VmInstance(userFullName,VmInstances.getId(vmAllocInfo.getReservationIndex(),index),reservationId,index - 1,token.getCluster(),vmAllocInfo.getUserData(),vmAllocInfo.getKeyInfo(),vmAllocInfo.getVmTypeInfo(),vmAllocInfo.getPlatform(),vmAllocInfo.getNetworks(),networkIndex.toString());
  return vmInst;
}

Fixed version (ground truth):
private VmInstance getVmInstance(UserFullName userFullName,VmAllocationInfo vmAllocInfo,String reservationId,ResourceToken token,Integer index,Integer networkIndex){
  VmInstance vmInst=new VmInstance(userFullName,VmInstances.getId(vmAllocInfo.getReservationIndex(),index),token.getInstanceIds().get(index),reservationId,index - 1,token.getCluster(),vmAllocInfo.getUserData(),vmAllocInfo.getKeyInfo(),vmAllocInfo.getVmTypeInfo(),vmAllocInfo.getPlatform(),vmAllocInfo.getNetworks(),networkIndex.toString());
  return vmInst;
}
Program: 15426
Project: 15426
Buggy source:
public void flush(){
  EntityWrapper<InstanceUsageSnapshot> entityWrapper=EntityWrapper.get(InstanceUsageSnapshot.class);
  try {
    for (    InstanceUsageSnapshot ius : recentUsageSnapshots) {
      entityWrapper.add(ius);
      log.info("String_Node_Str" + ius.getUuid() + "String_Node_Str"+ ius.getEntityId());
    }
    recentUsageSnapshots.clear();
    entityWrapper.commit();
  }
 catch (  Exception ex) {
    entityWrapper.rollback();
    log.error(ex);
  }
}

Fixed version (ground truth):
public void flush(){
  EntityWrapper<InstanceUsageSnapshot> entityWrapper=EntityWrapper.get(InstanceUsageSnapshot.class);
  try {
    for (    String key : recentUsageSnapshots.keySet()) {
      InstanceUsageSnapshot ius=recentUsageSnapshots.get(key);
      entityWrapper.add(ius);
      log.info("String_Node_Str" + ius.getUuid() + "String_Node_Str"+ ius.getEntityId());
    }
    recentUsageSnapshots.clear();
    entityWrapper.commit();
  }
 catch (  Exception ex) {
    entityWrapper.rollback();
    log.error(ex);
  }
}
Program: 15428
Project: 15428
Buggy source:
public InstanceEventListener(){
  this.recentlySeenUuids=new HashSet<String>();
  this.recentUsageSnapshots=new ArrayList<InstanceUsageSnapshot>();
  this.lastWriteMs=0l;
  this.writeIntervalMs=DEFAULT_WRITE_INTERVAL_SECS * 1000;
}

Fixed version (ground truth):
public InstanceEventListener(){
  this.recentlySeenUuids=new HashSet<String>();
  this.recentUsageSnapshots=new HashMap<String,InstanceUsageSnapshot>();
  this.lastWriteMs=0l;
  this.writeIntervalMs=DEFAULT_WRITE_INTERVAL_SECS * 1000;
}
Program: 15429
Project: 15429
Buggy source:
public synchronized ResourceToken getResourceAllocation(String requestId,UserFullName userFullName,String vmTypeName,Integer min,Integer max) throws NotEnoughResourcesAvailable {
  VmTypeAvailability vmType=this.typeMap.get(vmTypeName);
  Integer available=vmType.getAvailable();
  NavigableSet<VmTypeAvailability> sorted=this.sorted();
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  Integer quantity=min;
  if (vmType.getAvailable() < min) {
    throw new NotEnoughResourcesAvailable("String_Node_Str" + available + "String_Node_Str"+ min+ "String_Node_Str");
  }
 else {
    quantity=(max < available ? max : available);
  }
  Set<VmTypeAvailability> tailSet=sorted.tailSet(vmType);
  Set<VmTypeAvailability> headSet=sorted.headSet(vmType);
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(LogUtil.subheader("String_Node_Str" + tailSet));
  LOG.debug(LogUtil.subheader("String_Node_Str" + headSet));
  for (  VmTypeAvailability v : tailSet)   v.decrement(quantity);
  for (  VmTypeAvailability v : headSet)   v.setAvailable(vmType.getAvailable());
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  ResourceToken token=new ResourceToken(userFullName,requestId,this.clusterName,quantity,this.virtualTimer++,vmTypeName);
  EventRecord.caller(ResourceToken.class,EventType.TOKEN_RESERVED,token.toString()).info();
  this.pendingTokens.add(token);
  return token;
}

Fixed version (ground truth):
public synchronized ResourceToken getResourceAllocation(String requestId,UserFullName userFullName,String vmTypeName,Integer min,Integer max) throws NotEnoughResourcesAvailable {
  VmTypeAvailability vmType=this.typeMap.get(vmTypeName);
  Integer available=vmType.getAvailable();
  NavigableSet<VmTypeAvailability> sorted=this.sorted();
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  Integer quantity=min;
  if (vmType.getAvailable() < min) {
    throw new NotEnoughResourcesAvailable("String_Node_Str" + available + "String_Node_Str"+ min+ "String_Node_Str");
  }
 else {
    quantity=(max < available ? max : available);
  }
  Set<VmTypeAvailability> tailSet=sorted.tailSet(vmType);
  Set<VmTypeAvailability> headSet=sorted.headSet(vmType);
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(LogUtil.subheader("String_Node_Str" + tailSet));
  LOG.debug(LogUtil.subheader("String_Node_Str" + headSet));
  for (  VmTypeAvailability v : tailSet)   v.decrement(quantity);
  for (  VmTypeAvailability v : headSet)   v.setAvailable(vmType.getAvailable());
  LOG.debug(LogUtil.header("String_Node_Str"));
  LOG.debug(sorted);
  ResourceToken token=new ResourceToken(userFullName,requestId,this.clusterName,quantity,this.virtualTimer++,vmTypeName);
  for (int i=0; i < quantity; i++) {
    token.getInstanceUuids().add(UUID.randomUUID().toString());
  }
  EventRecord.caller(ResourceToken.class,EventType.TOKEN_RESERVED,token.toString()).info();
  this.pendingTokens.add(token);
  return token;
}
Program: 15430
Project: 15430
Buggy source:
public synchronized List<ResourceToken> splitToken(ResourceToken token) throws NoSuchTokenException {
  EventRecord.caller(ResourceToken.class,EventType.TOKEN_SPLIT,token.toString()).info();
  if (!this.pendingTokens.contains(token)) {
    throw new NoSuchTokenException("String_Node_Str" + token);
  }
  List<ResourceToken> childTokens=Lists.newArrayList();
  for (int index=0; index < token.getAmount(); index++) {
    NetworkToken primaryNet=token.getPrimaryNetwork();
    ResourceToken childToken=new ResourceToken(token.getUserFullName(),token.getCorrelationId() + index,token.getCluster(),1,this.virtualTimer++,token.getVmType());
    if (token.getAddresses().size() > index) {
      childToken.getAddresses().add(token.getAddresses().get(index));
    }
    if (token.getInstanceIds().size() > index) {
      childToken.getInstanceIds().add(token.getInstanceIds().get(index));
    }
    if (primaryNet != null) {
      NetworkToken childNet=new NetworkToken(primaryNet.getCluster(),primaryNet.getAccountId(),primaryNet.getNetworkName(),primaryNet.getNetworkUuid(),primaryNet.getVlan());
      childNet.getIndexes().add(primaryNet.getIndexes().pollFirst());
      childToken.getNetworkTokens().add(childNet);
    }
    EventRecord.caller(ResourceToken.class,EventType.TOKEN_CHILD,childToken.toString()).info();
    childTokens.add(childToken);
  }
  this.pendingTokens.remove(token);
  this.pendingTokens.addAll(childTokens);
  return childTokens;
}

Fixed version (ground truth):
public synchronized List<ResourceToken> splitToken(ResourceToken token) throws NoSuchTokenException {
  EventRecord.caller(ResourceToken.class,EventType.TOKEN_SPLIT,token.toString()).info();
  if (!this.pendingTokens.contains(token)) {
    throw new NoSuchTokenException("String_Node_Str" + token);
  }
  List<ResourceToken> childTokens=Lists.newArrayList();
  for (int index=0; index < token.getAmount(); index++) {
    NetworkToken primaryNet=token.getPrimaryNetwork();
    ResourceToken childToken=new ResourceToken(token.getUserFullName(),token.getCorrelationId() + index,token.getCluster(),1,this.virtualTimer++,token.getVmType());
    if (token.getAddresses().size() > index) {
      childToken.getAddresses().add(token.getAddresses().get(index));
    }
    if (token.getInstanceIds().size() > index) {
      childToken.getInstanceIds().add(token.getInstanceIds().get(index));
    }
    if (token.getInstanceUuids().size() > index) {
      childToken.getInstanceUuids().add(token.getInstanceUuids().get(index));
    }
    if (primaryNet != null) {
      NetworkToken childNet=new NetworkToken(primaryNet.getCluster(),primaryNet.getAccountId(),primaryNet.getNetworkName(),primaryNet.getNetworkUuid(),primaryNet.getVlan());
      childNet.getIndexes().add(primaryNet.getIndexes().pollFirst());
      childToken.getNetworkTokens().add(childNet);
    }
    EventRecord.caller(ResourceToken.class,EventType.TOKEN_CHILD,childToken.toString()).info();
    childTokens.add(childToken);
  }
  this.pendingTokens.remove(token);
  this.pendingTokens.addAll(childTokens);
  return childTokens;
}
Program: 15431
Project: 15431
Buggy source:
public VmInstance(final UserFullName owner,final String instanceId,final String reservationId,final int launchIndex,final String placement,final byte[] userData,final VmKeyInfo keyInfo,final VmTypeInfo vmTypeInfo,final String platform,final List<Network> networks,final String networkIndex){
  super(owner,instanceId);
  this.reservationId=reservationId;
  this.launchIndex=launchIndex;
  this.instanceId=instanceId;
  this.owner=owner;
  this.clusterName=placement;
  String p=null;
  try {
    p=ServiceConfigurations.getConfiguration(ClusterConfiguration.class,this.clusterName).getPartition();
  }
 catch (  PersistenceException ex) {
    p=placement;
    LOG.debug("String_Node_Str" + this.clusterName + "String_Node_Str");
  }
  this.partition=p;
  this.userData=userData;
  this.platform=platform;
  this.keyInfo=keyInfo;
  this.vmTypeInfo=vmTypeInfo;
  this.networks.addAll(networks);
  this.networkConfig.setMacAddress("String_Node_Str" + VmInstances.asMacAddress(this.instanceId));
  this.networkConfig.setIpAddress(DEFAULT_IP);
  this.networkConfig.setIgnoredPublicIp(DEFAULT_IP);
  this.networkConfig.setNetworkIndex(Integer.parseInt(networkIndex));
  this.stopWatch.start();
  this.updateWatch.start();
  this.updateDns();
  this.store();
}

Fixed version (ground truth):
public VmInstance(final UserFullName owner,final String instanceId,final String instanceUuid,final String reservationId,final int launchIndex,final String placement,final byte[] userData,final VmKeyInfo keyInfo,final VmTypeInfo vmTypeInfo,final String platform,final List<Network> networks,final String networkIndex){
  super(owner,instanceId);
  this.reservationId=reservationId;
  this.launchIndex=launchIndex;
  this.instanceUuid=instanceUuid;
  this.instanceId=instanceId;
  this.owner=owner;
  this.clusterName=placement;
  String p=null;
  try {
    p=ServiceConfigurations.getConfiguration(ClusterConfiguration.class,this.clusterName).getPartition();
  }
 catch (  PersistenceException ex) {
    p=placement;
    LOG.debug("String_Node_Str" + this.clusterName + "String_Node_Str");
  }
  this.partition=p;
  this.userData=userData;
  this.platform=platform;
  this.keyInfo=keyInfo;
  this.vmTypeInfo=vmTypeInfo;
  this.networks.addAll(networks);
  this.networkConfig.setMacAddress("String_Node_Str" + VmInstances.asMacAddress(this.instanceId));
  this.networkConfig.setIpAddress(DEFAULT_IP);
  this.networkConfig.setIgnoredPublicIp(DEFAULT_IP);
  this.networkConfig.setNetworkIndex(Integer.parseInt(networkIndex));
  this.stopWatch.start();
  this.updateWatch.start();
  this.updateDns();
  this.store();
}
Program: 15432
Project: 15432
Buggy source:
@Override public void fire(VmDescribeResponseType reply){
  for (  final VmInfo runVm : reply.getVms()) {
    runVm.setPlacement(this.getSubject().getConfiguration().getName());
    VmState state=VmState.Mapper.get(runVm.getStateName());
    try {
      final VmInstance vm=VmInstances.getInstance().lookup(runVm.getInstanceId());
      vm.setServiceTag(runVm.getServiceTag());
      vm.setUuid(runVm.getUuid());
      if (VmState.SHUTTING_DOWN.equals(vm.getState()) && vm.getSplitTime() > SystemState.SHUT_DOWN_TIME) {
        vm.setState(VmState.TERMINATED,Reason.EXPIRED);
      }
 else       if (VmState.SHUTTING_DOWN.equals(vm.getState()) && VmState.SHUTTING_DOWN.equals(state)) {
        vm.setState(VmState.TERMINATED,Reason.APPEND,"String_Node_Str");
      }
 else       if ((VmState.PENDING.equals(state) || VmState.RUNNING.equals(state)) && (VmState.PENDING.equals(vm.getState()) || VmState.RUNNING.equals(vm.getState()))) {
        if (!VmInstance.DEFAULT_IP.equals(runVm.getNetParams().getIpAddress())) {
          vm.updateAddresses(runVm.getNetParams().getIpAddress(),runVm.getNetParams().getIgnoredPublicIp());
        }
        vm.setState(VmState.Mapper.get(runVm.getStateName()),Reason.APPEND,"String_Node_Str");
        vm.updateNetworkIndex(runVm.getNetParams().getNetworkIndex());
        vm.updateVolumeAttachments(runVm.getVolumes());
      }
    }
 catch (    NoSuchElementException e) {
      LOG.debug("String_Node_Str" + runVm.getInstanceId());
    }
  }
}

Fixed version (ground truth):
@Override public void fire(VmDescribeResponseType reply){
  for (  final VmInfo runVm : reply.getVms()) {
    runVm.setPlacement(this.getSubject().getConfiguration().getName());
    VmState state=VmState.Mapper.get(runVm.getStateName());
    try {
      final VmInstance vm=VmInstances.getInstance().lookup(runVm.getInstanceId());
      vm.setServiceTag(runVm.getServiceTag());
      if (VmState.SHUTTING_DOWN.equals(vm.getState()) && vm.getSplitTime() > SystemState.SHUT_DOWN_TIME) {
        vm.setState(VmState.TERMINATED,Reason.EXPIRED);
      }
 else       if (VmState.SHUTTING_DOWN.equals(vm.getState()) && VmState.SHUTTING_DOWN.equals(state)) {
        vm.setState(VmState.TERMINATED,Reason.APPEND,"String_Node_Str");
      }
 else       if ((VmState.PENDING.equals(state) || VmState.RUNNING.equals(state)) && (VmState.PENDING.equals(vm.getState()) || VmState.RUNNING.equals(vm.getState()))) {
        if (!VmInstance.DEFAULT_IP.equals(runVm.getNetParams().getIpAddress())) {
          vm.updateAddresses(runVm.getNetParams().getIpAddress(),runVm.getNetParams().getIgnoredPublicIp());
        }
        vm.setState(VmState.Mapper.get(runVm.getStateName()),Reason.APPEND,"String_Node_Str");
        vm.updateNetworkIndex(runVm.getNetParams().getNetworkIndex());
        vm.updateVolumeAttachments(runVm.getVolumes());
      }
    }
 catch (    NoSuchElementException e) {
      LOG.debug("String_Node_Str" + runVm.getInstanceId());
    }
  }
}
Program: 15436
Project: 15436
Buggy source:
public SearchResult lookup(SearchRange range){
  if (!this.sort.isSameSort(range)) {
    LOG.log(Level.INFO,"String_Node_Str" + this.sort + "String_Node_Str"+ range);
    return null;
  }
  if (range.getStart() + range.getLength() > this.rows.size()) {
    LOG.log(Level.INFO,"String_Node_Str" + this.rows.size());
    return null;
  }
  for (int i=0; i < range.getLength(); i++) {
    if (this.rows.get(i + range.getStart()) == null) {
      LOG.log(Level.INFO,"String_Node_Str" + (i + range.getStart()));
      return null;
    }
  }
  SearchResult result=new SearchResult(this.totalSize,range);
  result.setDescs(this.descs);
  result.addRows(this.rows.subList(range.getStart(),range.getStart() + range.getLength()));
  return result;
}

Fixed version (ground truth):
public SearchResult lookup(SearchRange range){
  if (!this.sort.isSameSort(range)) {
    LOG.log(Level.INFO,"String_Node_Str" + this.sort + "String_Node_Str"+ range);
    return null;
  }
  if (Math.min(range.getStart() + range.getLength(),this.totalSize) > this.rows.size()) {
    LOG.log(Level.INFO,"String_Node_Str" + this.rows.size());
    return null;
  }
  for (int i=0; i < range.getLength(); i++) {
    if (this.rows.get(i + range.getStart()) == null) {
      LOG.log(Level.INFO,"String_Node_Str" + (i + range.getStart()));
      return null;
    }
  }
  SearchResult result=new SearchResult(this.totalSize,range);
  result.setDescs(this.descs);
  result.addRows(this.rows.subList(range.getStart(),range.getStart() + range.getLength()));
  return result;
}
Program: 15437
Project: 15437
Buggy source:
private static SearchResultRow serializeKey(User user,AccessKey key) throws Exception {
  SearchResultRow result=new SearchResultRow();
  result.addField(key.getAccessKey());
  result.addField(key.isActive().toString());
  result.addField(key.getCreateDate() == null ? "String_Node_Str" : key.getCreateDate().toString());
  result.addField(QueryBuilder.get().start(CategoryConstants.USER).and(ACCOUNT,user.getAccount().getName()).and(NAME,user.getName()).url());
  return result;
}

Fixed version (ground truth):
private static SearchResultRow serializeKey(User user,AccessKey key) throws Exception {
  SearchResultRow result=new SearchResultRow();
  result.addField(key.getAccessKey());
  result.addField(key.isActive().toString());
  result.addField(key.getCreateDate() == null ? "String_Node_Str" : key.getCreateDate().toString());
  result.addField(QueryBuilder.get().start(CategoryConstants.USER).and(ACCOUNT,user.getAccount().getName()).or(NAME,user.getName()).url());
  return result;
}
Program: 15438
Project: 15438
Buggy source:
@Override public void start(AcceptsOneWidget container,EventBus eventBus){
  this.container=container;
  this.clientFactory.getShellView().hideDetail();
  this.clientFactory.getShellView().getDetailView().setPresenter(this);
  this.clientFactory.getShellView().getContentView().setContentTitle(getTitle());
  LoadingAnimationView view=this.clientFactory.getLoadingAnimationView();
  container.setWidget(view);
  doSearch(URL.decodeQueryString(place.getSearch()),new SearchRange(0,pageSize));
}

Fixed version (ground truth):
@Override public void start(AcceptsOneWidget container,EventBus eventBus){
  this.container=container;
  this.clientFactory.getShellView().hideDetail();
  this.clientFactory.getShellView().getDetailView().setPresenter(this);
  this.clientFactory.getShellView().getContentView().setContentTitle(getTitle());
  LoadingAnimationView view=this.clientFactory.getLoadingAnimationView();
  container.setWidget(view);
  String query=URL.decodeQueryString(place.getSearch());
  LOG.log(Level.INFO,"String_Node_Str" + query);
  doSearch(query,new SearchRange(0,pageSize));
}
Program: 15439
Project: 15439
Buggy source:
@Override protected void doSearch(String query,SearchRange range){
  LOG.log(Level.INFO,"String_Node_Str" + query);
  this.clientFactory.getBackendService().lookupUser(this.clientFactory.getLocalSession().getSession(),search,range,new AsyncCallback<SearchResult>(){
    @Override public void onFailure(    Throwable caught){
      LOG.log(Level.WARNING,"String_Node_Str" + caught);
      displayData(null);
    }
    @Override public void onSuccess(    SearchResult result){
      LOG.log(Level.INFO,"String_Node_Str" + result.length());
      displayData(result);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void doSearch(String query,SearchRange range){
  this.clientFactory.getBackendService().lookupUser(this.clientFactory.getLocalSession().getSession(),search,range,new AsyncCallback<SearchResult>(){
    @Override public void onFailure(    Throwable caught){
      LOG.log(Level.WARNING,"String_Node_Str" + caught);
      displayData(null);
    }
    @Override public void onSuccess(    SearchResult result){
      LOG.log(Level.INFO,"String_Node_Str" + result.length());
      displayData(result);
    }
  }
);
}
Program: 15440
Project: 15440
Buggy source:
@UiHandler("String_Node_Str") void handleSearchBoxKeyPressed(KeyPressEvent e){
  int key=e.getNativeEvent().getKeyCode();
  LOG.log(Level.INFO,"String_Node_Str" + key);
  if (KeyCodes.KEY_ENTER == key) {
    searchHandler.search(searchBox.getInput());
  }
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void handleSearchBoxKeyPressed(KeyPressEvent e){
  if (KeyCodes.KEY_ENTER == e.getNativeEvent().getKeyCode()) {
    searchHandler.search(searchBox.getInput());
  }
}
Program: 15441
Project: 15441
Buggy source:
@Override public void start(AcceptsOneWidget container,EventBus eventBus){
  this.container=container;
  this.clientFactory.getShellView().hideDetail();
  this.clientFactory.getShellView().getDetailView().setPresenter(this);
  this.clientFactory.getShellView().getContentView().setContentTitle(getTitle());
  LoadingAnimationView view=this.clientFactory.getLoadingAnimationView();
  container.setWidget(view);
  doSearch(URL.decode(place.getSearch()),new SearchRange(0,pageSize));
}

Fixed version (ground truth):
@Override public void start(AcceptsOneWidget container,EventBus eventBus){
  this.container=container;
  this.clientFactory.getShellView().hideDetail();
  this.clientFactory.getShellView().getDetailView().setPresenter(this);
  this.clientFactory.getShellView().getContentView().setContentTitle(getTitle());
  LoadingAnimationView view=this.clientFactory.getLoadingAnimationView();
  container.setWidget(view);
  String search=URL.decode(place.getSearch());
  LOG.log(Level.INFO,"String_Node_Str" + place.getClass().getName() + "String_Node_Str"+ search);
  doSearch(search,new SearchRange(0,pageSize));
}
Program: 15442
Project: 15442
Buggy source:
@UiHandler("String_Node_Str") void handleSearchBoxKeyPressed(KeyPressEvent e){
  int key=e.getCharCode();
  LOG.log(Level.INFO,"String_Node_Str" + key);
  if (KeyCodes.KEY_ENTER == e.getCharCode()) {
    searchHandler.search(searchBox.getInput());
  }
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void handleSearchBoxKeyPressed(KeyPressEvent e){
  int key=e.getNativeEvent().getKeyCode();
  LOG.log(Level.INFO,"String_Node_Str" + key);
  if (KeyCodes.KEY_ENTER == key) {
    searchHandler.search(searchBox.getInput());
  }
}
Program: 15444
Project: 15444
Buggy source:
@Override public void showData(ArrayList<SearchResultFieldDesc> descs,ArrayList<String> gridValues){
  LOG.log(Level.INFO,"String_Node_Str");
  this.gridValues.clear();
  Grid grid=createGrid(descs,gridValues);
  if (grid != null) {
    this.content.clear();
    this.content.add(grid);
  }
}

Fixed version (ground truth):
@Override public void showData(ArrayList<SearchResultFieldDesc> descs,ArrayList<String> gridValues){
  LOG.log(Level.INFO,"String_Node_Str");
  this.gridValues.clear();
  Grid grid=createGrid(descs,gridValues);
  if (grid != null) {
    this.content.setWidget(grid);
  }
}
Program: 15445
Project: 15445
Buggy source:
private Grid createGrid(ArrayList<SearchResultFieldDesc> descs,ArrayList<String> vals){
  Grid grid=new Grid(1,2);
  grid.addStyleName(gridStyle.grid());
  grid.getColumnFormatter().setWidth(0,"String_Node_Str");
  grid.setWidget(0,0,new Label("String_Node_Str"));
  grid.setWidget(0,1,new TextBox());
  return grid;
}

Fixed version (ground truth):
private Grid createGrid(ArrayList<SearchResultFieldDesc> descs,ArrayList<String> vals){
  if (descs == null || descs.size() < 1 || vals == null || vals.size() < 1) {
    LOG.log(Level.WARNING,"String_Node_Str");
    return null;
  }
  int size=Math.min(descs.size(),vals.size());
  LOG.log(Level.INFO,"String_Node_Str" + descs + "String_Node_Str"+ vals+ "String_Node_Str"+ size);
  Grid grid=new Grid(size,2);
  grid.addStyleName(gridStyle.grid());
  grid.getColumnFormatter().setWidth(0,"String_Node_Str");
  int row=0;
  for (int i=0; i < size; i++) {
    SearchResultFieldDesc desc=descs.get(i);
    String val=vals.get(i);
    if (desc != null && !desc.getHidden()) {
      HasValue widget=getWidget(desc,val);
      if (widget != null) {
        LOG.log(Level.INFO,"String_Node_Str" + row + "String_Node_Str"+ widget.getClass().getName());
        gridValues.add(widget);
        grid.setWidget(row,0,new Label(desc.getTitle()));
        grid.setWidget(row,1,widget.getWidget());
        row++;
        continue;
      }
    }
    gridValues.add(new HiddenValue(val));
  }
  return grid;
}
Program: 15446
Project: 15446
Buggy source:
private static void serializeComponentProperties(List<ComponentProperty> properties,SearchResultRow result){
  for (  ComponentProperty prop : properties) {
    result.addExtraFieldDesc(new SearchResultFieldDesc(prop.getQualifiedName(),prop.getDisplayName(),false,"String_Node_Str",TableDisplay.NONE,propertyTypeToFieldType(prop.getType()),true,false));
    result.addField(prop.getValue());
  }
}

Fixed version (ground truth):
private static void serializeComponentProperties(List<ComponentProperty> properties,SearchResultRow result){
  Collections.<ComponentProperty>sort(properties,new Comparator<ComponentProperty>(){
    @Override public int compare(    ComponentProperty r1,    ComponentProperty r2){
      if (r1 == r2) {
        return 0;
      }
      int diff=-1;
      if (r1 != null) {
        diff=(r2 != null) ? r1.getDisplayName().compareTo(r2.getDisplayName()) : 1;
      }
      return diff;
    }
  }
);
  for (  ComponentProperty prop : properties) {
    result.addExtraFieldDesc(new SearchResultFieldDesc(prop.getQualifiedName(),prop.getDisplayName(),false,"String_Node_Str",TableDisplay.NONE,propertyTypeToFieldType(prop.getType()),true,false));
    result.addField(prop.getValue());
  }
}
Program: 15447
Project: 15447
Buggy source:
@Override public void start(AcceptsOneWidget container,EventBus eventBus){
  this.container=container;
  this.clientFactory.getShellView().hideDetail();
  this.clientFactory.getDetailView().setPresenter(this);
  this.clientFactory.getShellView().getContentView().setContentTitle(TITLE);
  LoadingAnimationView view=this.clientFactory.getLoadingAnimationView();
  container.setWidget(view);
  doSearch(URL.decode(place.getSearch()),new SearchRange(0,pageSize));
}

Fixed version (ground truth):
@Override public void start(AcceptsOneWidget container,EventBus eventBus){
  this.container=container;
  this.clientFactory.getShellView().hideDetail();
  this.clientFactory.getShellView().getDetailView().setPresenter(this);
  this.clientFactory.getShellView().getContentView().setContentTitle(TITLE);
  LoadingAnimationView view=this.clientFactory.getLoadingAnimationView();
  container.setWidget(view);
  doSearch(URL.decode(place.getSearch()),new SearchRange(0,pageSize));
}
Program: 15448
Project: 15448
Buggy source:
private void showSelectedDetails(){
  ArrayList<SearchResultFieldDesc> descs=new ArrayList<SearchResultFieldDesc>();
  descs.addAll(cache.getDescs());
  descs.addAll(currentSelected.getExtraFieldDescs());
  this.clientFactory.getDetailView().showData(descs,currentSelected.getRow());
}

Fixed version (ground truth):
private void showSelectedDetails(){
  ArrayList<SearchResultFieldDesc> descs=new ArrayList<SearchResultFieldDesc>();
  descs.addAll(cache.getDescs());
  descs.addAll(currentSelected.getExtraFieldDescs());
  this.clientFactory.getShellView().getDetailView().showData(descs,currentSelected.getRow());
}
Program: 15449
Project: 15449
Buggy source:
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      res.get();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
catch (        Exception ex) {
          LOG.error(ex,ex);
        }
        try {
          T res2=secondCall.call();
          resultFuture.set(res2.get());
        }
 catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}

Fixed version (ground truth):
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      res.get();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
          try {
            T res2=secondCall.call();
            resultFuture.set(res2.get());
          }
 catch (          Exception ex) {
            resultFuture.setException(ex);
          }
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
          resultFuture.setException(ex);
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
          resultFuture.setException(ex);
        }
catch (        Exception ex) {
          LOG.error(ex,ex);
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}
Program: 15450
Project: 15450
Buggy source:
@Override public void run(){
  try {
    intermediateFuture.get().get();
  }
 catch (  InterruptedException ex) {
    LOG.error(ex);
    Thread.currentThread().interrupt();
  }
catch (  ExecutionException ex) {
    LOG.error(ex,ex);
  }
catch (  Exception ex) {
    LOG.error(ex,ex);
  }
  try {
    T res2=secondCall.call();
    resultFuture.set(res2.get());
  }
 catch (  Exception ex) {
    resultFuture.setException(ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    intermediateFuture.get().get();
    try {
      T res2=secondCall.call();
      resultFuture.set(res2.get());
    }
 catch (    Exception ex) {
      resultFuture.setException(ex);
    }
  }
 catch (  InterruptedException ex) {
    LOG.error(ex);
    Thread.currentThread().interrupt();
    resultFuture.setException(ex);
  }
catch (  ExecutionException ex) {
    LOG.error(ex,ex);
    resultFuture.setException(ex);
  }
catch (  Exception ex) {
    LOG.error(ex,ex);
    resultFuture.setException(ex);
  }
}
Program: 15452
Project: 15452
Buggy source:
/** 
 * TODO: DOCUMENT
 * @param msg
 */
@Override public void fire(GetKeysResponseType msg){
  if (!this.getSubject().checkCerts(msg.getCerts())) {
    throw new InvalidCredentialsException("String_Node_Str" + this.getSubject().getName());
  }
}

Fixed version (ground truth):
/** 
 * TODO: DOCUMENT
 * @param msg
 */
@Override public void fire(GetKeysResponseType msg){
  if (!this.getSubject().checkCerts(msg.getCerts())) {
    throw new InvalidCredentialsException("String_Node_Str" + this.getSubject().getName(),this.getRequest());
  }
}
Program: 15453
Project: 15453
Buggy source:
public InvalidCredentialsException(Throwable cause){
  super(cause);
}

Fixed version (ground truth):
public InvalidCredentialsException(Throwable ex,BaseMessage msg){
  super(ex,msg);
}
Program: 15454
Project: 15454
Buggy source:
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      res.get();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
catch (        Exception ex) {
          LOG.error(ex,ex);
        }
        try {
          T res2=secondCall.call();
          resultFuture.set(res2.get());
        }
 catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}

Fixed version (ground truth):
@Override public T call(){
  try {
    try {
      final T res=firstCall.call();
      res.get();
      intermediateFuture.set(res);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
      intermediateFuture.setException(ex);
      resultFuture.setException(ex);
    }
    Threads.lookup(Empyrean.class,Futures.class).submit(new Runnable(){
      @Override public void run(){
        try {
          intermediateFuture.get().get();
        }
 catch (        InterruptedException ex) {
          LOG.error(ex);
          Thread.currentThread().interrupt();
        }
catch (        ExecutionException ex) {
          LOG.error(ex,ex);
        }
catch (        Exception ex) {
          LOG.error(ex,ex);
        }
        try {
          T res2=secondCall.call();
          resultFuture.set(res2.get());
        }
 catch (        Exception ex) {
          resultFuture.setException(ex);
        }
      }
    }
);
  }
 catch (  Exception ex1) {
    resultFuture.setException(ex1);
  }
  return (T)resultFuture;
}