Change in ovirt-engine[master]: core: Optimize equals/hashCode in infra classes

mperina at redhat.com mperina at redhat.com
Tue Dec 1 14:18:01 UTC 2015


Martin Peřina has submitted this change and it was merged.

Change subject: core: Optimize equals/hashCode in infra classes
......................................................................


core: Optimize equals/hashCode in infra classes

1. Optimizes equals method to contain recommended functionality as
   described in Effective Java 2nd edition

2. Optimizes objects comparison in equals method to use Objects.equals()

3. Optimizes hashCode method to use Objects.hash()/hashCode() methods

Change-Id: I55ec2906b99bfd6656d782357ec8fdfda125ecd3
Signed-off-by: Martin Perina <mperina at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ValidationResult.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/DirectoryEntryKey.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/DefaultCompensationContext.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/aaa/DirectoryEntry.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/aaa/DirectoryUser.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/ExternalVariable.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/asynctasks/EntityInfo.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionVersionMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AdditionalFeature.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTask.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskEntity.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AuditLog.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Bookmark.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntitySnapshot.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/CommandAssociatedEntity.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/CommandEntity.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/EngineBackupLog.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/EngineBackupLogId.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/EngineSession.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Erratum.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/FencingPolicy.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/RoleGroupMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/RoleGroupMapId.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/SubjectEntity.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/SupportedAdditionalClusterFeature.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Tags.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/TagsTemplateMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/TagsUserGroupMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/TagsUserMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/TagsVdsMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/TagsVmMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/TagsVmPoolMap.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroup.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroupHostsAndVMs.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdcOption.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsKdumpStatus.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatic.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/aaa/DbGroup.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/aaa/DbUser.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/event_notification_hist.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/event_subscriber.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/event_subscriber_id.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/pm/FenceAgent.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/eventqueue/Event.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/job/ExternalSystem.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/job/Job.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/job/Step.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/Pair.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/PairQueryable.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/customprop/ValidationError.java
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Guid.java
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/KeyValuePairCompat.java
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/RpmVersion.java
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Version.java
M backend/manager/modules/extensions-api-root/extensions-api/src/main/java/org/ovirt/engine/api/extensions/ExtKey.java
M backend/manager/modules/extensions-api-root/extensions-api/src/main/java/org/ovirt/engine/api/extensions/ExtMap.java
M backend/manager/modules/extensions-api-root/extensions-api/src/main/java/org/ovirt/engine/api/extensions/ExtUUID.java
M backend/manager/modules/restapi/metamodel/concepts/src/main/java/org/ovirt/api/metamodel/concepts/Name.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/MappingLocator.java
M backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/collections/CopyOnAccessMapTest.java
M backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializationEntitiesTest.java
M backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonSerializablePojo.java
M backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FirstMatchSimpleFilter.java
67 files changed, 862 insertions(+), 1,253 deletions(-)

Approvals:
  Martin Peřina: Verified
  Jenkins CI: Passed CI tests
  Moti Asayag: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/48837
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I55ec2906b99bfd6656d782357ec8fdfda125ecd3
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list