Program: 25496
Project: 25496
Buggy source:
private OFFlowMod expandActions(OFFlowMod flowMod){
  List<OFAction> actions=flowMod.getActions();
  if (actions == null || actions.isEmpty()) {
    return null;
  }
  List<OFAction> newActions=new ArrayList<OFAction>();
  for (  OFAction action : actions) {
    log.debug("String_Node_Str" + action.getType().name());
    if (action.getType() == OFActionType.OUTPUT) {
      OFActionOutput output=(OFActionOutput)action;
      if (output.getPort() == OFPort.OFPP_ALL.getValue()) {
        log.debug("String_Node_Str");
        for (        Map.Entry<String,PortConfig> port : this.portList.entrySet()) {
          OFActionOutput newAct;
          try {
            newAct=(OFActionOutput)action.clone();
          }
 catch (          CloneNotSupportedException e) {
            log.error("String_Node_Str");
            log.error(e.getMessage());
            return null;
          }
          newAct.setPort(port.getValue().getPortId());
          newActions.add(newAct);
        }
      }
 else       if (output.getPort() == OFPort.OFPP_FLOOD.getValue()) {
        return null;
      }
 else {
        log.debug("String_Node_Str");
        newActions.add(action);
      }
    }
  }
  OFFlowMod newFlow;
  try {
    newFlow=flowMod.clone();
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
    return null;
  }
  newFlow.setActions(newActions);
  return newFlow;
}

Fixed version (ground truth):
/** 
 * expands the actions in a flowMod so that if we have an ALL action it will be output to all ports but the port it came frome
 * @param flowMod
 * @return
 */
private OFFlowMod expandActions(OFFlowMod flowMod){
  Short portId=flowMod.getMatch().getInputPort();
  List<OFAction> actions=flowMod.getActions();
  if (actions == null || actions.isEmpty()) {
    log.debug("String_Node_Str");
    return null;
  }
  List<OFAction> newActions=new ArrayList<OFAction>();
  for (  OFAction action : actions) {
    log.debug("String_Node_Str" + action.getType().name());
    if (action.getType() == OFActionType.OUTPUT) {
      OFActionOutput output=(OFActionOutput)action;
      if (output.getPort() == OFPort.OFPP_ALL.getValue()) {
        log.debug("String_Node_Str");
        for (        Map.Entry<String,PortConfig> port : this.portList.entrySet()) {
          if (port.getValue().getPortId() != portId) {
            OFActionOutput newAct;
            try {
              newAct=(OFActionOutput)action.clone();
            }
 catch (            CloneNotSupportedException e) {
              log.error("String_Node_Str");
              log.error(e.getMessage());
              return null;
            }
            newAct.setPort(port.getValue().getPortId());
            newActions.add(newAct);
          }
        }
      }
 else       if (output.getPort() == OFPort.OFPP_FLOOD.getValue()) {
        return null;
      }
 else {
        log.debug("String_Node_Str");
        newActions.add(action);
      }
    }
 else {
      log.debug("String_Node_Str");
      newActions.add(action);
    }
  }
  OFFlowMod newFlow;
  try {
    newFlow=flowMod.clone();
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
    return null;
  }
  newFlow.setActions(newActions);
  return newFlow;
}