Allon Mureinik has submitted this change and it was merged. Change subject: engine: Remove instanceof from GetDomainListQuery ......................................................................
engine: Remove instanceof from GetDomainListQuery Runtime type checking is no way of passing parameters - if the internal domain should not be filtered, we can just pass false. This patch changes GetDomainListQuery to exclusively use the GetDomainListParameters class instead of allowing VdcQueryParameterBase to infer not filtering the internal domain. In addition, this patch introduces a test for GetDomainListQuery to ensure that no functionality was compromised. Advantages of this approach: 1. Explicit is better than implicit - the code is more readable, and its more obvious what the caller is doing. 2. Better performance - runtime type checking is expensive, where as function calls are cheap. Change-Id: I2e59b5053792e6a68030b8dcef604d9e5acdce80 Signed-off-by: Allon Mureinik <amure...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetDomainListQuery.java A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetDomainListQueryTest.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDomainsResource.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendUsersResourceBase.java M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendUsersResourceTest.java 5 files changed, 63 insertions(+), 14 deletions(-) Approvals: Allon Mureinik: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/18869 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e59b5053792e6a68030b8dcef604d9e5acdce80 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Ori Liel <ol...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches