cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafaelweingartner <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-9104: VM naming convention in ...
Date Thu, 07 Jan 2016 18:00:44 GMT
Github user rafaelweingartner commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1302#discussion_r49103580
  
    --- Diff: plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
---
    @@ -2032,11 +2032,20 @@ int getReservedCpuMHZ(VirtualMachineTO vmSpec) {
     
         // Pair<internal CS name, vCenter display name>
         private Pair<String, String> composeVmNames(VirtualMachineTO vmSpec) {
    -        String vmInternalCSName = vmSpec.getName();
    -        String vmNameOnVcenter = vmSpec.getName();
    -        if (_instanceNameFlag && vmSpec.getHostName() != null) {
    -            vmNameOnVcenter = vmSpec.getHostName();
    +
    +        String vmInternalCSName = null;
    +        String vmNameOnVcenter  = null;
    +        if(vmSpec != null)
    --- End diff --
    
    Is there a case in which "vmSpec" can be null here?
    
    That is nice that you are trying to avoid a null pointer exception, but the way it is,
you just change the null pointer to somewhere else


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message