Program: 15435
Project: 15435
Buggy source:
private static void updateVmInstance(final String originCluster,final VmInfo runVm){
  VmState state=VmState.Mapper.get(runVm.getStateName());
  VmInstance vm=null;
  try {
    vm=VmInstances.getInstance().lookup(runVm.getInstanceId());
  }
 catch (  NoSuchElementException e) {
    try {
      vm=VmInstances.getInstance().lookupDisabled(runVm.getInstanceId());
      if (!VmState.BURIED.equals(vm.getState()) && vm.getSplitTime() > BURY_TIME) {
        vm.setState(VmState.BURIED,Reason.BURIED);
      }
      return;
    }
 catch (    NoSuchElementException e1) {
      if ((VmState.PENDING.equals(state) || VmState.RUNNING.equals(state))) {
        SystemState.restoreInstance(originCluster,runVm);
      }
      return;
    }
  }
  long splitTime=vm.getSplitTime();
  VmState oldState=vm.getState();
  vm.setServiceTag(runVm.getServiceTag());
  vm.setUuid(runVm.getUuid());
  vm.setPlatform(runVm.getPlatform());
  vm.setBundleTaskState(runVm.getBundleTaskStateName());
  if (VmState.SHUTTING_DOWN.equals(vm.getState()) && splitTime > SHUT_DOWN_TIME) {
    vm.setState(VmState.TERMINATED,Reason.EXPIRED);
  }
 else   if (VmState.SHUTTING_DOWN.equals(vm.getState()) && VmState.SHUTTING_DOWN.equals(VmState.Mapper.get(runVm.getStateName()))) {
    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());
    try {
      Network network=Networks.getInstance().lookup(runVm.getOwnerId() + "String_Node_Str" + runVm.getGroupNames().get(0));
      network.extantNetworkIndex(vm.getClusterName(),vm.getNetworkIndex());
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
private static void updateVmInstance(final String originCluster,final VmInfo runVm){
  VmState state=VmState.Mapper.get(runVm.getStateName());
  VmInstance vm=null;
  try {
    vm=VmInstances.getInstance().lookup(runVm.getInstanceId());
  }
 catch (  NoSuchElementException e) {
    try {
      vm=VmInstances.getInstance().lookupDisabled(runVm.getInstanceId());
      if (!VmState.BURIED.equals(vm.getState()) && vm.getSplitTime() > BURY_TIME) {
        vm.setState(VmState.BURIED,Reason.BURIED);
      }
      return;
    }
 catch (    NoSuchElementException e1) {
      if ((VmState.PENDING.equals(state) || VmState.RUNNING.equals(state))) {
        SystemState.restoreInstance(originCluster,runVm);
      }
      return;
    }
  }
  long splitTime=vm.getSplitTime();
  VmState oldState=vm.getState();
  vm.setServiceTag(runVm.getServiceTag());
  vm.setPlatform(runVm.getPlatform());
  vm.setBundleTaskState(runVm.getBundleTaskStateName());
  if (VmState.SHUTTING_DOWN.equals(vm.getState()) && splitTime > SHUT_DOWN_TIME) {
    vm.setState(VmState.TERMINATED,Reason.EXPIRED);
  }
 else   if (VmState.SHUTTING_DOWN.equals(vm.getState()) && VmState.SHUTTING_DOWN.equals(VmState.Mapper.get(runVm.getStateName()))) {
    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());
    try {
      Network network=Networks.getInstance().lookup(runVm.getOwnerId() + "String_Node_Str" + runVm.getGroupNames().get(0));
      network.extantNetworkIndex(vm.getClusterName(),vm.getNetworkIndex());
    }
 catch (    Exception e) {
    }
  }
}