Change in ovirt-engine[master]: core: CommandsFactory generics

Code Review gerrit at ovirt.org
Fri May 26 10:12:30 UTC 2017


>From Allon Mureinik <amureini at redhat.com>:

Allon Mureinik has submitted this change and it was merged.

Change subject: core: CommandsFactory generics
......................................................................


core: CommandsFactory generics

CommandsFactory#commandsCache holds instances of both command and
query classes. Its generic specification is just plain wrong, and the
code only works due to the runtime type erasure.

Any class returned from this class' methods is either used regardless
of its generic specification, or instantiated and then cast to the
right type, making the generic specification somewhat of a mute
point.

This patch replaces it with a straight-forward Class<?> in order to
both avoid the confusion of the first paragraph and set up the
following patches.

Change-Id: I79d387829d524d8285dddad370a54e427ca3ff5e
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandsFactory.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommandCtorsTest.java
3 files changed, 16 insertions(+), 20 deletions(-)

Approvals:
  Tal Nisan: Looks good to me, approved
  Ravi Nori: Looks good to me, but someone else must approve
  Allon Mureinik: Verified; Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I79d387829d524d8285dddad370a54e427ca3ff5e
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list