Yair Zaslavsky has posted comments on this change.
Change subject: findbugs: When implementing compareTo implement Object.equals
as well
......................................................................
Patch Set 2: (1 inline comment)
I think Mike raised an important point about the way we implement equals, see
my inline comment.
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java
Line 30: if (this == obj)
Line 31: return true;
Line 32: if (obj == null)
Line 33: return false;
Line 34: if (getClass() != obj.getClass())
I support MIke's opinion here.
Concrete example - Hibernate Proxifies entities. getClass() != obj.getClass()
may yield that 2 objects are not equal.
I know we're not using hibernate, but there are other frameworks using proxies
(see cglib for example).
Line 35: return false;
Line 36: NetworkStatistics other = (NetworkStatistics) obj;
Line 37: if (id == null) {
Line 38: if (other.id != null)
--
To view, visit http://gerrit.ovirt.org/14039
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I69d3ee3cded96c33c4e833fdca09461b7825cf07
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Shahar Havivi <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches