Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D287018F62 for ; Thu, 7 Jan 2016 18:00:50 +0000 (UTC) Received: (qmail 52062 invoked by uid 500); 7 Jan 2016 18:00:44 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 52020 invoked by uid 500); 7 Jan 2016 18:00:44 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 51649 invoked by uid 99); 7 Jan 2016 18:00:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2016 18:00:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3EF21E2C5A; Thu, 7 Jan 2016 18:00:44 +0000 (UTC) From: rafaelweingartner To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-9104: VM naming convention in ... Content-Type: text/plain Message-Id: <20160107180044.3EF21E2C5A@git1-us-west.apache.org> Date: Thu, 7 Jan 2016 18:00:44 +0000 (UTC) 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 private Pair 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. ---