Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 80BC4200C28 for ; Mon, 13 Mar 2017 15:57:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7F6C0160B60; Mon, 13 Mar 2017 14:57:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EE889160B6C for ; Mon, 13 Mar 2017 15:57:09 +0100 (CET) Received: (qmail 96027 invoked by uid 500); 13 Mar 2017 14:57:08 -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 96001 invoked by uid 99); 13 Mar 2017 14:57:07 -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; Mon, 13 Mar 2017 14:57:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EFF15DFF12; Mon, 13 Mar 2017 14:57:06 +0000 (UTC) From: rafaelweingartner To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request #1878: CLOUDSTACK-9717: [VMware] RVRs have mismatchi... Content-Type: text/plain Message-Id: <20170313145706.EFF15DFF12@git1-us-west.apache.org> Date: Mon, 13 Mar 2017 14:57:06 +0000 (UTC) archived-at: Mon, 13 Mar 2017 14:57:10 -0000 Github user rafaelweingartner commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1878#discussion_r105676576 --- Diff: engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java --- @@ -302,4 +309,17 @@ public int countNicsForStartingVms(long networkId) { List results = customSearch(sc, null); return results.get(0); } + + @Override + public Long getPeerRouterId(String publicMacAddress, final long routerId) { + final SearchCriteria sc = PeerRouterSearch.create(); + sc.setParameters("instanceId", routerId); + sc.setParameters("macAddress", publicMacAddress); + sc.setParameters("vmType", VirtualMachine.Type.DomainRouter); + NicVO nicVo = findOneBy(sc); + if (nicVo != null) { + return (new Long(nicVo.getInstanceId())); --- End diff -- Let the auto-boxing and auto-unboxing do this for you. When you do this manually the pool of String/numbers of java will not be used. You just need to return `nicVo.getInstanceId()` --- 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. ---