From d22b65f45f416e2da014f655a7e562cae2a5994a Mon Sep 17 00:00:00 2001 From: Laszlo Hornyak Date: Sun, 9 Feb 2014 18:39:03 +0100 Subject: [PATCH] replaced Integer reference comparsion with .equals By default only the Integers between -128..127 are cached (unless overridden by java.lang.Integer.IntegerCache.high system property) If the inbound or outbound values are higher, the reference comparison won't work. Signed-off-by: Laszlo Hornyak --- .../cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java index 9fb63ce2425..9cf6a90ffe5 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java @@ -145,8 +145,9 @@ public class LibvirtDomainXMLParser { if ((bandwidth != null) && (bandwidth.getLength() != 0)) { Integer inbound = Integer.valueOf(getAttrValue("inbound", "average", (Element)bandwidth.item(0))); Integer outbound = Integer.valueOf(getAttrValue("outbound", "average", (Element)bandwidth.item(0))); - if (inbound == outbound) + if (inbound.equals(outbound)) { networkRateKBps = inbound; + } } if (type.equalsIgnoreCase("network")) { String network = getAttrValue("source", "network", nic);