Program: 25467
Project: 25467
Buggy source:
public List<OFFlowMod> managedFlows(OFFlowMod flowMod){
  log.debug("String_Node_Str" + flowMod.toString() + "String_Node_Str");
  List<OFFlowMod> flows=new ArrayList<OFFlowMod>();
  OFMatch match=flowMod.getMatch();
  if (match == null) {
    return flows;
  }
  if (match.getDataLayerVirtualLan() == 0 || match.getDataLayerVirtualLan() == -1) {
    if (match.getInputPort() == 0) {
      Iterator<Entry<String,PortConfig>> it=this.portList.entrySet().iterator();
      while (it.hasNext()) {
        Map.Entry<String,PortConfig> port=(Entry<String,PortConfig>)it.next();
        if (port.getValue().getPortId() != 0) {
          try {
            OFFlowMod newFlow=flowMod.clone();
            newFlow.getMatch().setInputPort(port.getValue().getPortId());
            newFlow.getMatch().setDataLayerVirtualLan(port.getValue().getVlanRange().getAvailableTags()[0]);
            List<OFFlowMod> newFlows=this.managedFlowActions(newFlow);
            for (            OFFlowMod flow : newFlows) {
              flows.add(flow);
            }
          }
 catch (          CloneNotSupportedException e) {
            flows.clear();
            return flows;
          }
catch (          Exception e) {
            flows.clear();
            return flows;
          }
        }
      }
    }
 else {
      match.setDataLayerVirtualLan((short)this.getPortConfig(match.getInputPort()).getVlanRange().getAvailableTags()[0]);
      flowMod.setMatch(match);
      flows=this.managedFlowActions(flowMod);
    }
  }
 else {
    log.debug("String_Node_Str" + flowMod.toString());
    return flows;
  }
  return flows;
}

Fixed version (ground truth):
public List<OFFlowMod> managedFlows(OFFlowMod flowMod){
  log.debug("String_Node_Str" + flowMod.toString() + "String_Node_Str");
  List<OFFlowMod> flows=new ArrayList<OFFlowMod>();
  OFMatch match=flowMod.getMatch();
  if (match == null) {
    return flows;
  }
  if (match.getDataLayerVirtualLan() == 0 || match.getDataLayerVirtualLan() == -1) {
    if (match.getInputPort() == 0) {
      Iterator<Entry<String,PortConfig>> it=this.portList.entrySet().iterator();
      while (it.hasNext()) {
        Map.Entry<String,PortConfig> port=(Entry<String,PortConfig>)it.next();
        if (port.getValue().getPortId() != 0) {
          try {
            OFFlowMod newFlow=flowMod.clone();
            newFlow.getMatch().setInputPort(port.getValue().getPortId());
            newFlow.getMatch().setDataLayerVirtualLan(port.getValue().getVlanRange().getAvailableTags()[0]);
            List<OFFlowMod> newFlows=this.managedFlowActions(newFlow);
            for (            OFFlowMod flow : newFlows) {
              flows.add(flow);
            }
          }
 catch (          CloneNotSupportedException e) {
            flows.clear();
            return flows;
          }
catch (          Exception e) {
            flows.clear();
            return flows;
          }
        }
      }
    }
 else {
      short vlanId;
      PortConfig pConfig=this.getPortConfig(match.getInputPort());
      if (pConfig == null) {
        flows.clear();
        return flows;
      }
 else {
        vlanId=(short)pConfig.getVlanRange().getAvailableTags()[0];
      }
      match.setDataLayerVirtualLan(vlanId);
      flowMod.setMatch(match);
      flows=this.managedFlowActions(flowMod);
    }
  }
 else {
    log.debug("String_Node_Str" + flowMod.toString());
    return flows;
  }
  return flows;
}