Greg Padgett has uploaded a new change for review.

Change subject: core: fix missing/extra fields in equals() methods
......................................................................

core: fix missing/extra fields in equals() methods

While refactoring businessentity equals() methods, some missing and
extraneous fields were discovered.  Add/remove these fields as needed.

(The change to remove fields from VmPool.equals() was borrowed from
I17b92858345de398dbc89d9141468ccea67963fe.)

Change-Id: I7477f8ee854ca303d0f9de1ea405e1c77a99360d
Signed-off-by: Greg Padgett <gpadg...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaStorage.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaVdsGroup.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Role.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java
4 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/56/12456/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaStorage.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaStorage.java
index a253ad7..32be7a4 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaStorage.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaStorage.java
@@ -159,6 +159,7 @@
         return (ObjectUtils.objectsEqual(quotaId, other.quotaId)
                 && ObjectUtils.objectsEqual(quotaStorageId, 
other.quotaStorageId)
                 && ObjectUtils.objectsEqual(storageId, other.storageId)
+                && ObjectUtils.objectsEqual(storageLimitGigaByteUsage, 
other.storageLimitGigaByteUsage)
                 && ObjectUtils.objectsEqual(storageLimitGigaByte, 
other.storageLimitGigaByte));
     }
 
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaVdsGroup.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaVdsGroup.java
index f2aeca3..9f7e96b 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaVdsGroup.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaVdsGroup.java
@@ -212,7 +212,9 @@
                 && ObjectUtils.objectsEqual(quotaVdsGroupId, 
other.quotaVdsGroupId)
                 && ObjectUtils.objectsEqual(vdsGroupId, other.vdsGroupId)
                 && ObjectUtils.objectsEqual(virtualCpu, other.virtualCpu)
-                && ObjectUtils.objectsEqual(memSizeMB, other.memSizeMB));
+                && ObjectUtils.objectsEqual(virtualCpuUsage, 
other.virtualCpuUsage)
+                && ObjectUtils.objectsEqual(memSizeMB, other.memSizeMB)
+                && ObjectUtils.objectsEqual(memSizeMBUsage, 
other.memSizeMBUsage));
     }
 
     /**
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Role.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Role.java
index 6119e3a..732cee5 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Role.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Role.java
@@ -68,6 +68,7 @@
         return (ObjectUtils.objectsEqual(id, other.id)
                 && ObjectUtils.objectsEqual(description, other.description)
                 && readOnly == other.readOnly
+                && allowsViewingChildren == other.allowsViewingChildren
                 && ObjectUtils.objectsEqual(name, other.name)
                 && type == other.type);
     }
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 1416e09..c516f1f 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
@@ -86,9 +86,9 @@
             return false;
         }
         VmPool other = (VmPool) obj;
+        // Don't use defaultStartTime and defaultEndTime in equals method
+        // as they will never match because of how they are initialized.
         return (ObjectUtils.objectsEqual(id, other.id)
-                && ObjectUtils.objectsEqual(defaultEndTime, 
other.defaultEndTime)
-                && ObjectUtils.objectsEqual(defaultStartTime, 
other.defaultStartTime)
                 && defaultTimeInDays == other.defaultTimeInDays
                 && ObjectUtils.objectsEqual(parameters, other.parameters)
                 && ObjectUtils.objectsEqual(vdsGroupId, other.vdsGroupId)


--
To view, visit http://gerrit.ovirt.org/12456
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7477f8ee854ca303d0f9de1ea405e1c77a99360d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadg...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to