Gilad Chaplik has posted comments on this change. Change subject: WIP core: fix businessentity hashCode/equals errors ......................................................................
Patch Set 3: (2 inline comments) .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/QuotaStorage.java Line 139: int result = 1; Line 140: result = prime * result + ((quotaId == null) ? 0 : quotaId.hashCode()); Line 141: result = prime * result + ((quotaStorageId == null) ? 0 : quotaStorageId.hashCode()); Line 142: result = prime * result + ((storageId == null) ? 0 : storageId.hashCode()); Line 143: result = prime * result + ((storageLimitGigaByteUsage == null) ? 0 : storageLimitGigaByteUsage.hashCode()); Doron, hashCode() is used in HashTable to generate hash code for the stored object. In quota cahce, the quota instances are stored in hash tables, but the hash key for those tables is the quota id hashCode. Basically this code is never used. Line 144: result = prime * result + ((storageLimitGigaByte == null) ? 0 : storageLimitGigaByte.hashCode()); Line 145: return result; Line 146: } Line 147: Line 140: result = prime * result + ((quotaId == null) ? 0 : quotaId.hashCode()); Line 141: result = prime * result + ((quotaStorageId == null) ? 0 : quotaStorageId.hashCode()); Line 142: result = prime * result + ((storageId == null) ? 0 : storageId.hashCode()); Line 143: result = prime * result + ((storageLimitGigaByteUsage == null) ? 0 : storageLimitGigaByteUsage.hashCode()); Line 144: result = prime * result + ((storageLimitGigaByte == null) ? 0 : storageLimitGigaByte.hashCode()); is storageName missing? Line 145: return result; Line 146: } Line 147: Line 148: @Override -- To view, visit http://gerrit.ovirt.org/12539 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic83c16ab9bbbb95f45bfcd91920f8137890e63d8 Gerrit-PatchSet: 3 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: Noam Slomianko <[email protected]> Gerrit-Reviewer: ofri masad <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
