Program: 106356
Project: 106356
Buggy source:
@Override public VmwareHypervisorHostNetworkSummary getHyperHostNetworkSummary(String managementPortGroup) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ managementPortGroup);
  VmwareHypervisorHostNetworkSummary summary=new VmwareHypervisorHostNetworkSummary();
  if (this.getHostType() == VmwareHostType.ESXi) {
    VirtualNicManagerNetConfig[] netConfigs=(VirtualNicManagerNetConfig[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
    assert(netConfigs != null);
    for (int i=0; i < netConfigs.length; i++) {
      if (netConfigs[i].getNicType().equals("String_Node_Str")) {
        for (        HostVirtualNic nic : netConfigs[i].getCandidateVnic()) {
          if (nic.getPortgroup().equals(managementPortGroup)) {
            summary.setHostIp(nic.getSpec().getIp().getIpAddress());
            summary.setHostNetmask(nic.getSpec().getIp().getSubnetMask());
            summary.setHostMacAddress(nic.getSpec().getMac());
            if (s_logger.isTraceEnabled())             s_logger.trace("String_Node_Str");
            return summary;
          }
        }
      }
    }
  }
 else {
    HostVirtualNic[] hostVNics=(HostVirtualNic[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
    if (hostVNics != null) {
      for (      HostVirtualNic vnic : hostVNics) {
        if (vnic.getPortgroup().equals(managementPortGroup)) {
          summary.setHostIp(vnic.getSpec().getIp().getIpAddress());
          summary.setHostNetmask(vnic.getSpec().getIp().getSubnetMask());
          summary.setHostMacAddress(vnic.getSpec().getMac());
          if (s_logger.isTraceEnabled())           s_logger.trace("String_Node_Str");
          return summary;
        }
      }
    }
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  throw new Exception("String_Node_Str" + managementPortGroup);
}

Fixed version (ground truth):
@Override public VmwareHypervisorHostNetworkSummary getHyperHostNetworkSummary(String managementPortGroup) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ managementPortGroup);
  VmwareHypervisorHostNetworkSummary summary=new VmwareHypervisorHostNetworkSummary();
  if (this.getHostType() == VmwareHostType.ESXi) {
    List<VirtualNicManagerNetConfig> netConfigs=(List<VirtualNicManagerNetConfig>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
    assert(netConfigs != null);
    for (    VirtualNicManagerNetConfig netConfig : netConfigs) {
      if (netConfig.getNicType().equals("String_Node_Str")) {
        for (        HostVirtualNic nic : netConfig.getCandidateVnic()) {
          if (nic.getPortgroup().equals(managementPortGroup)) {
            summary.setHostIp(nic.getSpec().getIp().getIpAddress());
            summary.setHostNetmask(nic.getSpec().getIp().getSubnetMask());
            summary.setHostMacAddress(nic.getSpec().getMac());
            if (s_logger.isTraceEnabled())             s_logger.trace("String_Node_Str");
            return summary;
          }
        }
      }
    }
  }
 else {
    List<HostVirtualNic> hostVNics=(List<HostVirtualNic>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
    if (hostVNics != null) {
      for (      HostVirtualNic vnic : hostVNics) {
        if (vnic.getPortgroup().equals(managementPortGroup)) {
          summary.setHostIp(vnic.getSpec().getIp().getIpAddress());
          summary.setHostNetmask(vnic.getSpec().getIp().getSubnetMask());
          summary.setHostMacAddress(vnic.getSpec().getMac());
          if (s_logger.isTraceEnabled())           s_logger.trace("String_Node_Str");
          return summary;
        }
      }
    }
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  throw new Exception("String_Node_Str" + managementPortGroup);
}