Laszlo Hornyak has posted comments on this change.
Change subject: core: simplify businessentity equals() methods [part 1]
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Bookmark.java
Line 70: return false;
Line 71: }
Line 72: if (obj.getClass() != this.getClass()) {
Line 73: return false;
Line 74: }
I agree with the motivation. The difficulty there is that you have to return a
value and not execute the rest of the checks (since checking fields on a null
obj would cause NPE) so maybe it could return a Boolean (true if equals, false
if can't be equal, null if the rest of the checks needed to find out) but in
that way I am not sure it will look more simple. I give it a try and will ask
you for review. And of course please feel free to share your take on the issue!
Thx!
Line 75: Bookmark other = (Bookmark) obj;
Line 76: return (ObjectUtils.objectsEqual(id, other.id)
Line 77: && ObjectUtils.objectsEqual(name, other.name)
Line 78: && ObjectUtils.objectsEqual(value, other.value));
--
To view, visit http://gerrit.ovirt.org/12342
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9531a453a352619e8a6243ea1a5e4d0de4d1a45
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