Program: 14894
Project: 14894
Buggy source:
private void fireClockTick(final Hertz tick){
  try {
    Component.State systemState;
    try {
      systemState=this.configuration.lookupState();
    }
 catch (    NoSuchElementException ex1) {
      this.stop();
      return;
    }
    boolean initialized=systemState.ordinal() > Component.State.LOADED.ordinal();
    if (!this.stateMachine.isBusy()) {
      Callable<CheckedListenableFuture<Cluster>> transition=null;
switch (this.stateMachine.getState()) {
case PENDING:
case AUTHENTICATING:
case STARTING:
        if (tick.isAsserted(Cluster.STATE_INTERVAL_PENDING)) {
          transition=Automata.sequenceTransitions(this,State.STOPPED,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
        }
      break;
case NOTREADY:
    if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_NOTREADY)) {
      transition=Automata.sequenceTransitions(this,State.NOTREADY,State.DISABLED);
    }
  break;
case DISABLED:
if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_DISABLED) && (Component.State.DISABLED.equals(systemState) || Component.State.NOTREADY.equals(systemState))) {
  transition=Automata.sequenceTransitions(this,State.DISABLED,State.DISABLED);
}
 else if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_DISABLED) && Component.State.ENABLED.equals(systemState)) {
  transition=Automata.sequenceTransitions(this,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
}
break;
case ENABLED:
if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_ENABLED) && Component.State.ENABLED.equals(this.configuration.lookupState())) {
Refresh.VOLATILE_INSTANCES.apply(this);
}
if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_ENABLED) && Component.State.ENABLED.equals(this.configuration.lookupState())) {
transition=Automata.sequenceTransitions(this,State.ENABLED,State.ENABLED_SERVICE_CHECK,State.ENABLED_ADDRS,State.ENABLED_RSC,State.ENABLED_NET,State.ENABLED_VMS,State.ENABLED);
}
 else if (initialized && Component.State.DISABLED.equals(this.configuration.lookupState()) || Component.State.NOTREADY.equals(this.configuration.lookupState())) {
transition=Automata.sequenceTransitions(this,State.ENABLED,State.DISABLED);
}
break;
default :
break;
}
if (transition != null) {
try {
Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
this.clearExceptions();
}
 catch (Exception ex) {
LOG.error(ex,ex);
}
}
}
}
 catch (final Exception ex) {
LOG.error(ex,ex);
}
}

Fixed version (ground truth):
private void fireClockTick(final Hertz tick){
  try {
    Component.State systemState;
    try {
      systemState=this.configuration.lookupState();
    }
 catch (    NoSuchElementException ex1) {
      this.stop();
      return;
    }
    boolean initialized=systemState.ordinal() > Component.State.LOADED.ordinal();
    if (!this.stateMachine.isBusy()) {
      Callable<CheckedListenableFuture<Cluster>> transition=null;
switch (this.stateMachine.getState()) {
case PENDING:
case AUTHENTICATING:
case STARTING:
        if (tick.isAsserted(Cluster.STATE_INTERVAL_PENDING)) {
          transition=Automata.sequenceTransitions(this,State.STOPPED,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
        }
      break;
case NOTREADY:
    if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_NOTREADY)) {
      transition=Automata.sequenceTransitions(this,State.NOTREADY,State.DISABLED);
    }
  break;
case DISABLED:
if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_DISABLED) && (Component.State.DISABLED.equals(systemState) || Component.State.NOTREADY.equals(systemState))) {
  transition=Automata.sequenceTransitions(this,State.DISABLED,State.DISABLED);
}
 else if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_DISABLED) && Component.State.ENABLED.equals(systemState)) {
  transition=Automata.sequenceTransitions(this,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
}
break;
case ENABLED:
if (initialized && tick.isAsserted(VmInstances.VOLATILE_STATE_INTERVAL_SEC) && Component.State.ENABLED.equals(this.configuration.lookupState())) {
Refresh.VOLATILE_INSTANCES.apply(this);
}
if (initialized && tick.isAsserted(Cluster.STATE_INTERVAL_ENABLED) && Component.State.ENABLED.equals(this.configuration.lookupState())) {
transition=Automata.sequenceTransitions(this,State.ENABLED,State.ENABLED_SERVICE_CHECK,State.ENABLED_ADDRS,State.ENABLED_RSC,State.ENABLED_NET,State.ENABLED_VMS,State.ENABLED);
}
 else if (initialized && Component.State.DISABLED.equals(this.configuration.lookupState()) || Component.State.NOTREADY.equals(this.configuration.lookupState())) {
transition=Automata.sequenceTransitions(this,State.ENABLED,State.DISABLED);
}
break;
default :
break;
}
if (transition != null) {
try {
Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
this.clearExceptions();
}
 catch (Exception ex) {
LOG.error(ex,ex);
}
}
}
}
 catch (final Exception ex) {
LOG.error(ex,ex);
}
}