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 <amureini(a)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 <amureini(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpastern(a)redhat.com>
Gerrit-Reviewer: Ori Liel <oliel(a)redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server