Program: 105381
Project: 105381
Buggy source:
@Override public List<ConfigItem> generateConfig(final NetworkElementCommand cmd){
  final SetNetworkACLCommand command=(SetNetworkACLCommand)cmd;
  final String privateGw=cmd.getAccessDetail(NetworkElementCommand.VPC_PRIVATE_GATEWAY);
  final String[][] rules=command.generateFwRules();
  final String[] aclRules=rules[0];
  final NicTO nic=command.getNic();
  final String dev="String_Node_Str" + nic.getDeviceId();
  final String netmask=Long.toString(NetUtils.getCidrSize(nic.getNetmask()));
  final List<AclRule> ingressRules=new ArrayList<AclRule>();
  final List<AclRule> egressRules=new ArrayList<AclRule>();
  for (int i=0; i < aclRules.length; i++) {
    AclRule aclRule;
    final String[] ruleParts=aclRules[i].split("String_Node_Str");
switch (ruleParts[1].toLowerCase()) {
case "String_Node_Str":
      aclRule=new IcmpAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[2]),Integer.parseInt(ruleParts[3]));
    break;
case "String_Node_Str":
  aclRule=new TcpAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[2]),Integer.parseInt(ruleParts[3]));
break;
case "String_Node_Str":
aclRule=new UdpAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[2]),Integer.parseInt(ruleParts[3]));
break;
case "String_Node_Str":
aclRule=new AllAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]));
break;
default :
aclRule=new ProtocolAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[1]));
}
if ("String_Node_Str".equals(ruleParts[0])) {
ingressRules.add(aclRule);
}
 else {
egressRules.add(aclRule);
}
}
final NetworkACL networkACL=new NetworkACL(dev,nic.getMac(),privateGw != null,nic.getIp(),netmask,ingressRules.toArray(new AclRule[ingressRules.size()]),egressRules.toArray(new AclRule[egressRules.size()]));
return generateConfigItems(networkACL);
}

Fixed version (ground truth):
@Override public List<ConfigItem> generateConfig(final NetworkElementCommand cmd){
  final SetNetworkACLCommand command=(SetNetworkACLCommand)cmd;
  final String privateGw=cmd.getAccessDetail(NetworkElementCommand.VPC_PRIVATE_GATEWAY);
  final String[][] rules=command.generateFwRules();
  final String[] aclRules=rules[0];
  final NicTO nic=command.getNic();
  final String dev="String_Node_Str" + nic.getDeviceId();
  final String netmask=Long.toString(NetUtils.getCidrSize(nic.getNetmask()));
  final List<AclRule> ingressRules=new ArrayList<AclRule>();
  final List<AclRule> egressRules=new ArrayList<AclRule>();
  for (int i=0; i < aclRules.length; i++) {
    AclRule aclRule;
    final String[] ruleParts=aclRules[i].split("String_Node_Str");
switch (ruleParts[1].toLowerCase()) {
case "String_Node_Str":
      aclRule=new IcmpAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[2]),Integer.parseInt(ruleParts[3]));
    break;
case "String_Node_Str":
  aclRule=new TcpAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[2]),Integer.parseInt(ruleParts[3]));
break;
case "String_Node_Str":
aclRule=new UdpAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]),Integer.parseInt(ruleParts[2]),Integer.parseInt(ruleParts[3]));
break;
case "String_Node_Str":
aclRule=new AllAclRule(ruleParts[4],"String_Node_Str".equals(ruleParts[5]));
break;
default :
try {
aclRule=new ProtocolAclRule(ruleParts[5],false,Integer.parseInt(ruleParts[1]));
}
 catch (final Exception e) {
s_logger.warn("String_Node_Str" + ruleParts.length + "String_Node_Str");
continue;
}
}
if ("String_Node_Str".equals(ruleParts[0])) {
ingressRules.add(aclRule);
}
 else {
egressRules.add(aclRule);
}
}
final NetworkACL networkACL=new NetworkACL(dev,nic.getMac(),privateGw != null,nic.getIp(),netmask,ingressRules.toArray(new AclRule[ingressRules.size()]),egressRules.toArray(new AclRule[egressRules.size()]));
return generateConfigItems(networkACL);
}