Skip to content

Commit d22b65f

Browse files
committed
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 <laszlo.hornyak@gmail.com>
1 parent 3e3ded7 commit d22b65f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ public boolean parseDomainXML(String domXML) {
145145
if ((bandwidth != null) && (bandwidth.getLength() != 0)) {
146146
Integer inbound = Integer.valueOf(getAttrValue("inbound", "average", (Element)bandwidth.item(0)));
147147
Integer outbound = Integer.valueOf(getAttrValue("outbound", "average", (Element)bandwidth.item(0)));
148-
if (inbound == outbound)
148+
if (inbound.equals(outbound)) {
149149
networkRateKBps = inbound;
150+
}
150151
}
151152
if (type.equalsIgnoreCase("network")) {
152153
String network = getAttrValue("source", "network", nic);

0 commit comments

Comments
 (0)