Hello Shmuel Melamud,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/41903
to review the following change.
Change subject: core: Correct VmPool.hashCode() and equals()
......................................................................
core: Correct VmPool.hashCode() and equals()
Using the same set of fields for both hashCode() and equals() so two
VmPool objects considered equal will have equal hashcodes.
Change-Id: I70638a292a7d7ee0ee349721c3b2f8c6d6a0847f
Signed-off-by: Shmuel Melamud <[email protected]>
---
M
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java
1 file changed, 4 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/03/41903/1
diff --git
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java
index 5b11cdd..16b9284 100644
---
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java
+++
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java
@@ -77,18 +77,15 @@
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
- result = prime * result + ((defaultEndTime == null) ? 0 :
defaultEndTime.hashCode());
- result = prime * result + ((defaultStartTime == null) ? 0 :
defaultStartTime.hashCode());
result = prime * result + defaultTimeInDays;
result = prime * result + ((parameters == null) ? 0 :
parameters.hashCode());
result = prime * result + ((vdsGroupId == null) ? 0 :
vdsGroupId.hashCode());
result = prime * result + ((vdsGroupName == null) ? 0 :
vdsGroupName.hashCode());
- result = prime * result + vmPoolAssignedCount;
result = prime * result + ((description == null) ? 0 :
description.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + vmPoolRunningCount;
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + maxAssignedVmsPerUser;
+ result = prime * result + ((spiceProxy == null) ? 0 :
spiceProxy.hashCode());
return result;
}
@@ -110,10 +107,12 @@
&& defaultTimeInDays == other.defaultTimeInDays
&& ObjectUtils.objectsEqual(parameters, other.parameters)
&& ObjectUtils.objectsEqual(vdsGroupId, other.vdsGroupId)
+ && ObjectUtils.objectsEqual(vdsGroupName, other.vdsGroupName)
&& ObjectUtils.objectsEqual(description, other.description)
&& ObjectUtils.objectsEqual(name, other.name)
&& ObjectUtils.objectsEqual(type, other.type)
- && maxAssignedVmsPerUser == other.maxAssignedVmsPerUser);
+ && maxAssignedVmsPerUser == other.maxAssignedVmsPerUser
+ && ObjectUtils.objectsEqual(spiceProxy, other.spiceProxy));
}
public String getParameters() {
--
To view, visit https://gerrit.ovirt.org/41903
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70638a292a7d7ee0ee349721c3b2f8c6d6a0847f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shmuel Leib Melamud <[email protected]>
Gerrit-Reviewer: Shmuel Melamud <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches