Program: 106467
Project: 106467
Buggy source:
private SearchCriteria<NetworkVO> buildNetworkSearchCriteria(SearchBuilder<NetworkVO> sb,String keyword,Long id,Boolean isSystem,Long zoneId,String guestIpType,String trafficType,Long physicalNetworkId,String aclType,boolean skipProjectNetworks,Boolean restartRequired,Boolean specifyIpRanges,Map<String,String> tags){
  SearchCriteria<NetworkVO> sc=sb.create();
  if (isSystem != null) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",isSystem);
  }
  if (keyword != null) {
    SearchCriteria<NetworkVO> ssc=_networksDao.createSearchCriteria();
    ssc.addOr("String_Node_Str",SearchCriteria.Op.LIKE,"String_Node_Str" + keyword + "String_Node_Str");
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,ssc);
  }
  if (id != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,id);
  }
  if (zoneId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,zoneId);
  }
  if (guestIpType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,guestIpType);
  }
  if (trafficType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,trafficType);
  }
  if (aclType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,aclType.toString());
  }
  if (physicalNetworkId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,physicalNetworkId);
  }
  if (skipProjectNetworks) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",Account.ACCOUNT_TYPE_PROJECT);
  }
  if (restartRequired != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,restartRequired);
  }
  if (specifyIpRanges != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,specifyIpRanges);
  }
  if (tags != null && !tags.isEmpty()) {
    int count=0;
    sc.setJoinParameters("String_Node_Str","String_Node_Str",TaggedResourceType.Network.toString());
    for (    String key : tags.keySet()) {
      sc.setJoinParameters("String_Node_Str","String_Node_Str" + String.valueOf(count),key);
      sc.setJoinParameters("String_Node_Str","String_Node_Str" + String.valueOf(count),tags.get(key));
      count++;
    }
  }
  return sc;
}

Fixed version (ground truth):
private SearchCriteria<NetworkVO> buildNetworkSearchCriteria(SearchBuilder<NetworkVO> sb,String keyword,Long id,Boolean isSystem,Long zoneId,String guestIpType,String trafficType,Long physicalNetworkId,String aclType,boolean skipProjectNetworks,Boolean restartRequired,Boolean specifyIpRanges,Map<String,String> tags){
  SearchCriteria<NetworkVO> sc=sb.create();
  if (isSystem != null) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",isSystem);
  }
  if (keyword != null) {
    SearchCriteria<NetworkVO> ssc=_networksDao.createSearchCriteria();
    ssc.addOr("String_Node_Str",SearchCriteria.Op.LIKE,"String_Node_Str" + keyword + "String_Node_Str");
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,ssc);
  }
  if (id != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,id);
  }
  if (zoneId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,zoneId);
  }
  if (guestIpType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,guestIpType);
  }
  if (trafficType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,trafficType);
  }
  if (aclType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,aclType.toString());
  }
  if (physicalNetworkId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,physicalNetworkId);
  }
  if (skipProjectNetworks) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",Account.ACCOUNT_TYPE_PROJECT);
  }
 else {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",Account.ACCOUNT_TYPE_PROJECT);
  }
  if (restartRequired != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,restartRequired);
  }
  if (specifyIpRanges != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,specifyIpRanges);
  }
  if (tags != null && !tags.isEmpty()) {
    int count=0;
    sc.setJoinParameters("String_Node_Str","String_Node_Str",TaggedResourceType.Network.toString());
    for (    String key : tags.keySet()) {
      sc.setJoinParameters("String_Node_Str","String_Node_Str" + String.valueOf(count),key);
      sc.setJoinParameters("String_Node_Str","String_Node_Str" + String.valueOf(count),tags.get(key));
      count++;
    }
  }
  return sc;
}