Allon Mureinik has uploaded a new change for review. Change subject: core: Remove Guid.OpEquals(Guid, Guid) ......................................................................
core: Remove Guid.OpEquals(Guid, Guid) OpEquals was only used in two places in the codebase, and both have at least one value known to be non-null. Hence, this method could be removed, and replaced by a simple call to Guid.equals(Object). Change-Id: I3c0f79f2161f4beca5b048ca74acaf63c11753e3 Signed-off-by: Allon Mureinik <amure...@redhat.com> --- M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Guid.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalExistingVmModelBehavior.java 3 files changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/90/15690/1 diff --git a/backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Guid.java b/backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Guid.java index 432345b..643e28b 100644 --- a/backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Guid.java +++ b/backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Guid.java @@ -35,9 +35,4 @@ return new Guid(candidate); } } - - public static boolean OpEquality(Guid g1, Guid g2) { - return (g1 == null && g2 == null) || (g1 != null && g1.equals(g2)); - } - } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java index 52cc0cc..3797820 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java @@ -643,7 +643,7 @@ private boolean isBlankTemplate(Object selectedItem) { return selectedItem != null && selectedItem instanceof VmTemplate && - Guid.OpEquality(((VmTemplate) selectedItem).getId(), NGuid.Empty); + NGuid.Empty.equals(((VmTemplate) selectedItem).getId()); } @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalExistingVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalExistingVmModelBehavior.java index 111c842..21fc0a1 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalExistingVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalExistingVmModelBehavior.java @@ -13,7 +13,6 @@ import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.queries.IdQueryParameters; import org.ovirt.engine.core.common.queries.VdcQueryType; -import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.compat.NGuid; import org.ovirt.engine.ui.frontend.AsyncQuery; import org.ovirt.engine.ui.frontend.Frontend; @@ -87,7 +86,7 @@ { filteredList.add(cluster); - if (Guid.OpEquality(cluster.getId(), vm.getVdsGroupId().getValue())) + if (vm.getVdsGroupId().getValue().equals(cluster.getId())) { listContainsVmCluster = true; } -- To view, visit http://gerrit.ovirt.org/15690 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c0f79f2161f4beca5b048ca74acaf63c11753e3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amure...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches