Change in ovirt-engine[master]: core: Don't check equality in BE setters

Allon Mureinik has submitted this change and it was merged. Change subject: core: Don't check equality in BE setters ...................................................................... core: Don't check equality in BE setters Some old business entities used the change-check idiom in their setters: public void setXXX (Object newValue) { if (!newValue.equals(dataMember) { dataMember = newValue; } } This was probably produced by the C# conversion, but is completely useless in Java - in any event, at the end of the setXXX method the dataMember's value will be equal to the one passed, and the equality check is more expensive than just assigning the new value. This patch removes this old idiom from the code. As a nice side-bonus, it also removes a couple of StringHelper usages from the code, as part of the ongoing effort to get rid of this class. Change-Id: Iafac9ca646c6c988470bf49d0596d973531c4616 Signed-off-by: Allon Mureinik <amureini@redhat.com> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbUser.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage_domains.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/vm_pools.java 4 files changed, 4 insertions(+), 15 deletions(-) Approvals: Allon Mureinik: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/11638 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iafac9ca646c6c988470bf49d0596d973531c4616 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Alissa Bonas <abonas@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Daniel Erez <derez@redhat.com> Gerrit-Reviewer: Liron Aravot <laravot@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipchuk@redhat.com> Gerrit-Reviewer: Tal Nisan <tnisan@redhat.com> Gerrit-Reviewer: Vered Volansky <vvolansk@redhat.com>
participants (1)
-
amureini@redhat.com