Oved Ourfali has posted comments on this change.

Change subject: findbugs: When implementing compareTo implement Object.equals 
as well
......................................................................


Patch Set 2: (2 inline comments)

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java
Line 15:     @Override
Line 16:     public int hashCode() {
Line 17:         final int prime = 31;
Line 18:         int result = 1;
Line 19:         result = prime * result + ((id == null) ? 0 : id.hashCode());
Mike - I think the auto-generated ones are good enough in this case.
Line 20:         result = prime * result + ((receiveDropRate == null) ? 0 : 
receiveDropRate.hashCode());
Line 21:         result = prime * result + ((receiveRate == null) ? 0 : 
receiveRate.hashCode());
Line 22:         result = prime * result + ((status == null) ? 0 : 
status.hashCode());
Line 23:         result = prime * result + ((transmitDropRate == null) ? 0 : 
transmitDropRate.hashCode());


Line 30:         if (this == obj)
Line 31:             return true;
Line 32:         if (obj == null)
Line 33:             return false;
Line 34:         if (getClass() != obj.getClass())
When reading online I saw that there is a lot of debate on that.
Not sure that we would like to consider them as equals in this case.
Is what you're suggesting the standard of what we usually do in "equals"?
Is it a configuration in eclipse whether to generate one or the other?
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>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to