Program: 106083
Project: 106083
Buggy source:
private void configDnsMasq(VirtualRouter router,Network network,Commands cmds){
  DataCenterVO dcVo=_dcDao.findById(router.getDataCenterId());
  List<NicIpAliasVO> ipAliasVOList=_nicIpAliasDao.listByNetworkIdAndState(network.getId(),NicIpAlias.state.active);
  List<DhcpTO> ipList=new ArrayList<DhcpTO>();
  NicVO router_guest_nic=_nicDao.findByNtwkIdAndInstanceId(network.getId(),router.getId());
  String cidr=NetUtils.getCidrFromGatewayAndNetmask(router_guest_nic.getGateway(),router_guest_nic.getNetmask());
  String[] cidrPair=cidr.split("String_Node_Str");
  String cidrAddress=cidrPair[0];
  long cidrSize=Long.parseLong(cidrPair[1]);
  String startIpOfSubnet=NetUtils.getIpRangeStartIpFromCidr(cidrAddress,cidrSize);
  ipList.add(new DhcpTO(router_guest_nic.getIp4Address(),router_guest_nic.getGateway(),router_guest_nic.getNetmask(),startIpOfSubnet));
  for (  NicIpAliasVO ipAliasVO : ipAliasVOList) {
    DhcpTO DhcpTO=new DhcpTO(ipAliasVO.getIp4Address(),ipAliasVO.getGateway(),ipAliasVO.getNetmask(),ipAliasVO.getStartIpOfSubnet());
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("String_Node_Str" + DhcpTO.getGateway() + "String_Node_Str"+ DhcpTO.getNetmask()+ "String_Node_Str"+ DhcpTO.getRouterIp()+ "String_Node_Str"+ DhcpTO.getStartIpOfSubnet()+ "String_Node_Str");
    }
    ipList.add(DhcpTO);
    ipAliasVO.setVmId(router.getId());
  }
  DataCenterVO dcvo=_dcDao.findById(router.getDataCenterId());
  DnsMasqConfigCommand dnsMasqConfigCmd=new DnsMasqConfigCommand(ipList);
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_IP,getRouterControlIp(router.getId()));
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,getRouterIpInNetwork(network.getId(),router.getId()));
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
  cmds.addCommand("String_Node_Str",dnsMasqConfigCmd);
}

Fixed version (ground truth):
private void configDnsMasq(VirtualRouter router,Network network,Commands cmds){
  DataCenterVO dcVo=_dcDao.findById(router.getDataCenterId());
  List<NicIpAliasVO> ipAliasVOList=_nicIpAliasDao.listByNetworkIdAndState(network.getId(),NicIpAlias.state.active);
  List<DhcpTO> ipList=new ArrayList<DhcpTO>();
  NicVO router_guest_nic=_nicDao.findByNtwkIdAndInstanceId(network.getId(),router.getId());
  String cidr=NetUtils.getCidrFromGatewayAndNetmask(router_guest_nic.getGateway(),router_guest_nic.getNetmask());
  String[] cidrPair=cidr.split("String_Node_Str");
  String cidrAddress=cidrPair[0];
  long cidrSize=Long.parseLong(cidrPair[1]);
  String startIpOfSubnet=NetUtils.getIpRangeStartIpFromCidr(cidrAddress,cidrSize);
  ipList.add(new DhcpTO(router_guest_nic.getIp4Address(),router_guest_nic.getGateway(),router_guest_nic.getNetmask(),startIpOfSubnet));
  for (  NicIpAliasVO ipAliasVO : ipAliasVOList) {
    DhcpTO DhcpTO=new DhcpTO(ipAliasVO.getIp4Address(),ipAliasVO.getGateway(),ipAliasVO.getNetmask(),ipAliasVO.getStartIpOfSubnet());
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("String_Node_Str" + DhcpTO.getGateway() + "String_Node_Str"+ DhcpTO.getNetmask()+ "String_Node_Str"+ DhcpTO.getRouterIp()+ "String_Node_Str"+ DhcpTO.getStartIpOfSubnet()+ "String_Node_Str");
    }
    ipList.add(DhcpTO);
    ipAliasVO.setVmId(router.getId());
  }
  _dcDao.findById(router.getDataCenterId());
  DnsMasqConfigCommand dnsMasqConfigCmd=new DnsMasqConfigCommand(ipList);
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_IP,getRouterControlIp(router.getId()));
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,getRouterIpInNetwork(network.getId(),router.getId()));
  dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
  cmds.addCommand("String_Node_Str",dnsMasqConfigCmd);
}