Program: 156985
Project: 156985
Buggy source:
private void resolveActions(){
  if (!hasGate())   return;
  boolean oldBroadcastRedstone=broadcastRedstone;
  boolean[] oldBroadcastSignal=broadcastSignal;
  broadcastRedstone=false;
  broadcastSignal=new boolean[]{false,false,false,false};
  gate.startResolution();
  HashMap<Integer,Boolean> actions=new HashMap<Integer,Boolean>();
  for (int it=0; it < 8; ++it) {
    ITrigger trigger=activatedTriggers[it];
    IAction action=activatedActions[it];
    ITriggerParameter parameter=triggerParameters[it];
    if (trigger != null && action != null)     if (!actions.containsKey(action.getId())) {
      actions.put(action.getId(),isNearbyTriggerActive(trigger,parameter));
    }
 else     if (gate.getConditional() == GateConditional.AND) {
      actions.put(action.getId(),actions.get(action.getId()) && isNearbyTriggerActive(trigger,parameter));
    }
 else {
      actions.put(action.getId(),actions.get(action.getId()) || isNearbyTriggerActive(trigger,parameter));
    }
  }
  for (  Integer i : actions.keySet())   if (actions.get(i)) {
    if (gate.resolveAction(ActionManager.actions[i])) {
      continue;
    }
    if (ActionManager.actions[i] instanceof ActionRedstoneOutput) {
      broadcastRedstone=true;
    }
 else     if (ActionManager.actions[i] instanceof ActionSignalOutput) {
      broadcastSignal[((ActionSignalOutput)ActionManager.actions[i]).color.ordinal()]=true;
    }
 else {
      for (int a=0; a < container.tileBuffer.length; ++a)       if (container.tileBuffer[a].getTile() instanceof IActionReceptor) {
        IActionReceptor recept=(IActionReceptor)container.tileBuffer[a].getTile();
        recept.actionActivated(ActionManager.actions[i]);
      }
    }
  }
  actionsActivated(actions);
  if (oldBroadcastRedstone != broadcastRedstone) {
    container.scheduleRenderUpdate();
    updateNeighbors(true);
  }
  for (int i=0; i < oldBroadcastSignal.length; ++i)   if (oldBroadcastSignal[i] != broadcastSignal[i]) {
    container.scheduleRenderUpdate();
    updateSignalState();
    break;
  }
}

Fixed version (ground truth):
private void resolveActions(){
  if (!hasGate())   return;
  boolean oldBroadcastRedstone=broadcastRedstone;
  boolean[] oldBroadcastSignal=broadcastSignal;
  broadcastRedstone=false;
  broadcastSignal=new boolean[]{false,false,false,false};
  gate.startResolution();
  HashMap<Integer,Boolean> actions=new HashMap<Integer,Boolean>();
  Multiset<Integer> actionCount=HashMultiset.create();
  for (int it=0; it < 8; ++it) {
    ITrigger trigger=activatedTriggers[it];
    IAction action=activatedActions[it];
    ITriggerParameter parameter=triggerParameters[it];
    if (trigger != null && action != null) {
      actionCount.add(action.getId());
      if (!actions.containsKey(action.getId())) {
        actions.put(action.getId(),isNearbyTriggerActive(trigger,parameter));
      }
 else       if (gate.getConditional() == GateConditional.AND) {
        actions.put(action.getId(),actions.get(action.getId()) && isNearbyTriggerActive(trigger,parameter));
      }
 else {
        actions.put(action.getId(),actions.get(action.getId()) || isNearbyTriggerActive(trigger,parameter));
      }
    }
  }
  for (  Integer i : actions.keySet())   if (actions.get(i)) {
    if (gate.resolveAction(ActionManager.actions[i],actionCount.count(i))) {
      continue;
    }
    if (ActionManager.actions[i] instanceof ActionRedstoneOutput) {
      broadcastRedstone=true;
    }
 else     if (ActionManager.actions[i] instanceof ActionSignalOutput) {
      broadcastSignal[((ActionSignalOutput)ActionManager.actions[i]).color.ordinal()]=true;
    }
 else {
      for (int a=0; a < container.tileBuffer.length; ++a)       if (container.tileBuffer[a].getTile() instanceof IActionReceptor) {
        IActionReceptor recept=(IActionReceptor)container.tileBuffer[a].getTile();
        recept.actionActivated(ActionManager.actions[i]);
      }
    }
  }
  actionsActivated(actions);
  if (oldBroadcastRedstone != broadcastRedstone) {
    container.scheduleRenderUpdate();
    updateNeighbors(true);
  }
  for (int i=0; i < oldBroadcastSignal.length; ++i)   if (oldBroadcastSignal[i] != broadcastSignal[i]) {
    container.scheduleRenderUpdate();
    updateSignalState();
    break;
  }
}