Program: 106040
Project: 106040
Buggy source:
private Pair<ManagedObjectReference,String> prepareNetworkFromNicInfo(HostMO hostMo,NicTO nicTo,boolean configureVServiceInNexus,VirtualMachine.Type vmType) throws Exception {
  Ternary<String,String,String> switchDetails=getTargetSwitch(nicTo);
  nicTo.getType();
  VirtualSwitchType switchType=VirtualSwitchType.getType(switchDetails.second());
  String switchName=switchDetails.first();
  String vlanToken=switchDetails.third();
  String namePrefix=getNetworkNamePrefix(nicTo);
  Pair<ManagedObjectReference,String> networkInfo=null;
  s_logger.info("String_Node_Str" + switchType + "String_Node_Str"+ switchName+ "String_Node_Str"+ namePrefix);
  if (VirtualSwitchType.StandardVirtualSwitch == switchType) {
synchronized (hostMo.getMor().getValue().intern()) {
      networkInfo=HypervisorHostHelper.prepareNetwork(switchName,namePrefix,hostMo,getVlanInfo(nicTo,vlanToken),nicTo.getNetworkRateMbps(),nicTo.getNetworkRateMulticastMbps(),_ops_timeout,!namePrefix.startsWith("String_Node_Str"),nicTo.getBroadcastType(),nicTo.getUuid());
    }
  }
 else {
    String vlanId=getVlanInfo(nicTo,vlanToken);
    String svlanId=null;
    boolean pvlannetwork=(getPvlanInfo(nicTo) == null) ? false : true;
    if (vmType != null && vmType.equals(VirtualMachine.Type.DomainRouter) && pvlannetwork) {
      svlanId=vlanId;
    }
 else {
      svlanId=getPvlanInfo(nicTo);
    }
    networkInfo=HypervisorHostHelper.prepareNetwork(switchName,namePrefix,hostMo,vlanId,svlanId,nicTo.getNetworkRateMbps(),nicTo.getNetworkRateMulticastMbps(),_ops_timeout,switchType,_portsPerDvPortGroup,nicTo.getGateway(),configureVServiceInNexus,nicTo.getBroadcastType());
  }
  return networkInfo;
}

Fixed version (ground truth):
private Pair<ManagedObjectReference,String> prepareNetworkFromNicInfo(HostMO hostMo,NicTO nicTo,boolean configureVServiceInNexus,VirtualMachine.Type vmType) throws Exception {
  Ternary<String,String,String> switchDetails=getTargetSwitch(nicTo);
  nicTo.getType();
  VirtualSwitchType switchType=VirtualSwitchType.getType(switchDetails.second());
  String switchName=switchDetails.first();
  String vlanToken=switchDetails.third();
  String namePrefix=getNetworkNamePrefix(nicTo);
  Pair<ManagedObjectReference,String> networkInfo=null;
  s_logger.info("String_Node_Str" + switchType + "String_Node_Str"+ switchName+ "String_Node_Str"+ namePrefix);
  if (VirtualSwitchType.StandardVirtualSwitch == switchType) {
synchronized (hostMo.getMor().getValue().intern()) {
      networkInfo=HypervisorHostHelper.prepareNetwork(switchName,namePrefix,hostMo,getVlanInfo(nicTo,vlanToken),nicTo.getNetworkRateMbps(),nicTo.getNetworkRateMulticastMbps(),_opsTimeout,!namePrefix.startsWith("String_Node_Str"),nicTo.getBroadcastType(),nicTo.getUuid());
    }
  }
 else {
    String vlanId=getVlanInfo(nicTo,vlanToken);
    String svlanId=null;
    boolean pvlannetwork=(getPvlanInfo(nicTo) == null) ? false : true;
    if (vmType != null && vmType.equals(VirtualMachine.Type.DomainRouter) && pvlannetwork) {
      svlanId=vlanId;
    }
 else {
      svlanId=getPvlanInfo(nicTo);
    }
    networkInfo=HypervisorHostHelper.prepareNetwork(switchName,namePrefix,hostMo,vlanId,svlanId,nicTo.getNetworkRateMbps(),nicTo.getNetworkRateMulticastMbps(),_opsTimeout,switchType,_portsPerDvPortGroup,nicTo.getGateway(),configureVServiceInNexus,nicTo.getBroadcastType());
  }
  return networkInfo;
}