Program: 105785
Project: 105785
Buggy source:
@Override public VMInstanceVO reConfigureVm(String vmUuid,ServiceOffering oldServiceOffering,boolean reconfiguringOnExistingHost) throws ResourceUnavailableException, InsufficientServerCapacityException, ConcurrentOperationException {
  AsyncJobExecutionContext jobContext=AsyncJobExecutionContext.getCurrentExecutionContext();
  if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
    VmWorkJobVO placeHolder=null;
    if (VmJobEnabled.value()) {
      VirtualMachine vm=_vmDao.findByUuid(vmUuid);
      placeHolder=createPlaceHolderWork(vm.getId());
    }
    try {
      return orchestrateReConfigureVm(vmUuid,oldServiceOffering,reconfiguringOnExistingHost);
    }
  finally {
      if (VmJobEnabled.value())       _workJobDao.expunge(placeHolder.getId());
    }
  }
 else {
    Outcome<VirtualMachine> outcome=reconfigureVmThroughJobQueue(vmUuid,oldServiceOffering,reconfiguringOnExistingHost);
    VirtualMachine vm=null;
    try {
      vm=outcome.get();
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    java.util.concurrent.ExecutionException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    Object jobResult=_jobMgr.unmarshallResultObject(outcome.getJob());
    if (jobResult != null) {
      if (jobResult instanceof ResourceUnavailableException)       throw (ResourceUnavailableException)jobResult;
 else       if (jobResult instanceof ConcurrentOperationException)       throw (ConcurrentOperationException)jobResult;
 else       if (jobResult instanceof InsufficientServerCapacityException)       throw (InsufficientServerCapacityException)jobResult;
 else       if (jobResult instanceof Throwable) {
        s_logger.error("String_Node_Str",(Throwable)jobResult);
        throw new RuntimeException("String_Node_Str",(Throwable)jobResult);
      }
    }
    return (VMInstanceVO)vm;
  }
}

Fixed version (ground truth):
@Override public VMInstanceVO reConfigureVm(String vmUuid,ServiceOffering oldServiceOffering,boolean reconfiguringOnExistingHost) throws ResourceUnavailableException, InsufficientServerCapacityException, ConcurrentOperationException {
  AsyncJobExecutionContext jobContext=AsyncJobExecutionContext.getCurrentExecutionContext();
  if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
    VmWorkJobVO placeHolder=null;
    if (VmJobEnabled.value()) {
      VirtualMachine vm=_vmDao.findByUuid(vmUuid);
      placeHolder=createPlaceHolderWork(vm.getId());
    }
    try {
      return orchestrateReConfigureVm(vmUuid,oldServiceOffering,reconfiguringOnExistingHost);
    }
  finally {
      if (placeHolder != null) {
        _workJobDao.expunge(placeHolder.getId());
      }
    }
  }
 else {
    Outcome<VirtualMachine> outcome=reconfigureVmThroughJobQueue(vmUuid,oldServiceOffering,reconfiguringOnExistingHost);
    VirtualMachine vm=null;
    try {
      vm=outcome.get();
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    java.util.concurrent.ExecutionException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    Object jobResult=_jobMgr.unmarshallResultObject(outcome.getJob());
    if (jobResult != null) {
      if (jobResult instanceof ResourceUnavailableException)       throw (ResourceUnavailableException)jobResult;
 else       if (jobResult instanceof ConcurrentOperationException)       throw (ConcurrentOperationException)jobResult;
 else       if (jobResult instanceof InsufficientServerCapacityException)       throw (InsufficientServerCapacityException)jobResult;
 else       if (jobResult instanceof Throwable) {
        s_logger.error("String_Node_Str",(Throwable)jobResult);
        throw new RuntimeException("String_Node_Str",(Throwable)jobResult);
      }
    }
    return (VMInstanceVO)vm;
  }
}