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

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 computeIfAbsent
......................................................................


core: CommandsFactory computeIfAbsent

Use the JDK's Map#computeIfAbsent method instead of reinventing the
wheel.

Besides making the code a tad more elegant, in the edge case where
two threads try to load the same command for the first time, this
variation of code should perform a tad faster, as the findClass
lambda is guaranteed to execute only once.

Change-Id: I85d7c02f3c984919b1a73bd913e0b57f992bc3b8
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandsFactory.java
1 file changed, 7 insertions(+), 10 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
  Idan Shaby: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85d7c02f3c984919b1a73bd913e0b57f992bc3b8
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: Idan Shaby <ishaby 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