Github user wilderrodrigues commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/935#discussion_r42740183
  
    --- Diff: 
vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java ---
    @@ -79,6 +79,52 @@ public static boolean isReservedScsiDeviceNumber(int 
deviceNumber) {
             return deviceNumber == 7;
         }
     
    +    public static VirtualDevice prepareNicOpaque(VirtualMachineMO vmMo, 
VirtualEthernetCardType deviceType, String portGroupName,
    +            String macAddress, int deviceNumber, int contextNumber, 
boolean conntected, boolean connectOnStart) throws Exception {
    +
    +        assert(vmMo.getRunningHost().hasOpaqueNSXNetwork());
    +
    +        VirtualEthernetCard nic;
    +        switch (deviceType) {
    +        case E1000:
    +            nic = new VirtualE1000();
    +            break;
    +
    +        case PCNet32:
    +            nic = new VirtualPCNet32();
    +            break;
    +
    +        case Vmxnet2:
    +            nic = new VirtualVmxnet2();
    +            break;
    +
    +        case Vmxnet3:
    +            nic = new VirtualVmxnet3();
    +            break;
    +
    +        default:
    +            assert (false);
    --- End diff --
    
    Why this "assert (false);" here? Asserting as false might cause problems.
    ```
    Each assertion contains a boolean expression that you believe will be true 
when the assertion executes. If it is not true, the system will throw an error.
    ```
    
    Source: 
http://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html
    
    The user os assertion in this way is irrelevant and error-prone. Could you 
please remove it and push a new commit?
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to