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 <[email protected]>
---
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 <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to