Program: 106948
Project: 106948
Buggy source:
@Override public boolean updateState(State oldState,Event event,State newState,VirtualMachine vm,Long hostId){
  if (newState == null) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + oldState.toString() + "String_Node_Str"+ event.toString());
    }
    return false;
  }
  VMInstanceVO vmi=(VMInstanceVO)vm;
  Long oldHostId=vmi.getHostId();
  SearchCriteria<VMInstanceVO> sc=StateChangeSearch.create();
  sc.setParameters("String_Node_Str",vmi.getId());
  sc.setParameters("String_Node_Str",oldState);
  sc.setParameters("String_Node_Str",vmi.getHostId());
  sc.setParameters("String_Node_Str",vmi.getUpdated());
  vmi.incrUpdated();
  UpdateBuilder ub=getUpdateBuilder(vmi);
  ub.set(vmi,"String_Node_Str",newState);
  ub.set(vmi,"String_Node_Str",hostId);
  ub.set(vmi,_updateTimeAttr,new Date());
  int result=update(vmi,sc);
  if (result == 0 && s_logger.isDebugEnabled()) {
    vmi.setState(oldState);
    vmi.setHostId(oldHostId);
    vmi.decrUpdated();
    VMInstanceVO vo=findById(vm.getId());
    StringBuilder str=new StringBuilder("String_Node_Str").append(vo.toString());
    str.append("String_Node_Str").append(vo.getHostId()).append("String_Node_Str").append(vo.getState().toString()).append("String_Node_Str").append(vo.getUpdated());
    str.append("String_Node_Str").append(vm.getHostId()).append("String_Node_Str").append(vm.getState().toString()).append("String_Node_Str").append(vmi.getUpdated()).append("String_Node_Str");
    s_logger.debug(str.toString());
  }
  return result > 0;
}

Fixed version (ground truth):
@Override public boolean updateState(State oldState,Event event,State newState,VirtualMachine vm,Long hostId){
  if (newState == null) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + oldState.toString() + "String_Node_Str"+ event.toString());
    }
    return false;
  }
  VMInstanceVO vmi=(VMInstanceVO)vm;
  Long oldHostId=vmi.getHostId();
  Long oldUpdated=vmi.getUpdated();
  Date oldUpdateDate=vmi.getUpdateTime();
  SearchCriteria<VMInstanceVO> sc=StateChangeSearch.create();
  sc.setParameters("String_Node_Str",vmi.getId());
  sc.setParameters("String_Node_Str",oldState);
  sc.setParameters("String_Node_Str",vmi.getHostId());
  sc.setParameters("String_Node_Str",vmi.getUpdated());
  vmi.incrUpdated();
  UpdateBuilder ub=getUpdateBuilder(vmi);
  ub.set(vmi,"String_Node_Str",newState);
  ub.set(vmi,"String_Node_Str",hostId);
  ub.set(vmi,_updateTimeAttr,new Date());
  int result=update(vmi,sc);
  if (result == 0 && s_logger.isDebugEnabled()) {
    VMInstanceVO vo=findById(vm.getId());
    StringBuilder str=new StringBuilder("String_Node_Str").append(vo.toString());
    str.append("String_Node_Str").append(vo.getHostId()).append("String_Node_Str").append(vo.getState().toString()).append("String_Node_Str").append(vo.getUpdated()).append("String_Node_Str").append(vo.getUpdateTime());
    str.append("String_Node_Str").append(vm.getHostId()).append("String_Node_Str").append(vm.getState().toString()).append("String_Node_Str").append(vmi.getUpdated()).append("String_Node_Str").append(vo.getUpdateTime());
    str.append("String_Node_Str").append(oldHostId).append("String_Node_Str").append(oldState).append("String_Node_Str").append(oldUpdated).append("String_Node_Str").append(oldUpdateDate).append("String_Node_Str");
    s_logger.debug(str.toString());
  }
  return result > 0;
}