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 <shav...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to