Laszlo Hornyak has posted comments on this change.
Change subject: core: simplify businessentity equals() methods [part 2]
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java
Line 79: return false;
Line 80: }
Line 81: VdsStatistics other = (VdsStatistics) obj;
Line 82: return (ObjectUtils.objectsEqual(id, other.id)
Line 83: && ObjectUtils.objectsEqual(cpu_idle, other.cpu_idle)
The problem here is that
new BigDecimal("0").equals(new BigDecimal("0.0"))
will return false. When you persist to DB and read back it will, the original
was 0 and the value from jdbc is 0.0, that's why it breaks the junit test.
Line 84: && ObjectUtils.objectsEqual(cpu_load, other.cpu_load)
Line 85: && ObjectUtils.objectsEqual(cpu_sys, other.cpu_sys)
Line 86: && ObjectUtils.objectsEqual(cpu_user, other.cpu_user)
Line 87: && ObjectUtils.objectsEqual(mem_available,
other.mem_available)
--
To view, visit http://gerrit.ovirt.org/12416
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8e77ebc95015105b54fbb09472e38a2d36492278
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches