Program: 48977
Project: 48977
Buggy source:
@Override public boolean eventHandler(VcEventType type,Event e) throws Exception {
  AuAssert.check(e instanceof VmEvent || e instanceof EventEx);
  ManagedObjectReference moRef=e.getVm().getVm();
  String moId=MoUtil.morefToString(moRef);
  logger.debug("String_Node_Str" + e);
switch (type) {
case VmRemoved:
{
      logger.debug("String_Node_Str" + moId);
      if (clusterEntityMgr.getNodeByMobId(moId) != null) {
        clusterEntityMgr.refreshNodeByMobId(moId,null,true);
      }
      return false;
    }
case VmPoweredOn:
{
    VmPoweredOnEvent event=(VmPoweredOnEvent)e;
    e.getVm();
    VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
    if (vm == null) {
      return false;
    }
    vm.updateRuntime();
    if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
      logger.info("String_Node_Str" + vm.getName());
      clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),Constants.NODE_ACTION_WAITING_IP,true);
    }
    break;
  }
case VmCloned:
{
  VmClonedEvent event=(VmClonedEvent)e;
  e.getVm();
  VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
  if (vm == null) {
    return false;
  }
  vm.updateRuntime();
  if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
    logger.info("String_Node_Str" + vm.getName());
    clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),Constants.NODE_ACTION_RECONFIGURE,true);
  }
  break;
}
case VmSuspended:
{
VmSuspendedEvent event=(VmSuspendedEvent)e;
VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
if (vm == null) {
  return false;
}
vm.updateRuntime();
if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
  logger.info("String_Node_Str" + vm.getName());
  clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),null,true);
}
break;
}
case VmPoweredOff:
{
VmPoweredOffEvent event=(VmPoweredOffEvent)e;
VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
if (vm == null) {
return false;
}
vm.updateRuntime();
if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
logger.info("String_Node_Str" + vm.getName());
clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),null,true);
}
break;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean eventHandler(VcEventType type,Event e) throws Exception {
  AuAssert.check(e instanceof VmEvent || e instanceof EventEx);
  ManagedObjectReference moRef=e.getVm().getVm();
  String moId=MoUtil.morefToString(moRef);
  logger.debug("String_Node_Str" + e);
switch (type) {
case VmRemoved:
{
      logger.debug("String_Node_Str" + moId);
      if (clusterEntityMgr.getNodeByMobId(moId) != null) {
        clusterEntityMgr.refreshNodeByMobId(moId,null,true);
      }
      return false;
    }
case VmPoweredOn:
{
    VmPoweredOnEvent event=(VmPoweredOnEvent)e;
    e.getVm();
    VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
    if (vm == null) {
      return false;
    }
    vm.updateRuntime();
    if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
      logger.info("String_Node_Str" + vm.getName());
      clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),Constants.NODE_ACTION_WAITING_IP,true);
    }
    break;
  }
case VmCloned:
{
  VmClonedEvent event=(VmClonedEvent)e;
  e.getVm();
  VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
  if (vm == null) {
    return false;
  }
  vm.updateRuntime();
  if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
    logger.info("String_Node_Str" + vm.getName());
    clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),Constants.NODE_ACTION_WAITING,true);
  }
  break;
}
case VmSuspended:
{
VmSuspendedEvent event=(VmSuspendedEvent)e;
VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
if (vm == null) {
  return false;
}
vm.updateRuntime();
if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
  logger.info("String_Node_Str" + vm.getName());
  clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),null,true);
}
break;
}
case VmPoweredOff:
{
VmPoweredOffEvent event=(VmPoweredOffEvent)e;
VcVirtualMachine vm=VcCache.getIgnoreMissing(event.getVm().getVm());
if (vm == null) {
return false;
}
vm.updateRuntime();
if (clusterEntityMgr.getNodeByVmName(vm.getName()) != null) {
logger.info("String_Node_Str" + vm.getName());
clusterEntityMgr.refreshNodeByVmName(moId,vm.getName(),null,true);
}
break;
}
}
return false;
}