Change in ovirt-engine[master]: core: VmRunHandler: simplify isInternal evaluation

amureini at redhat.com amureini at redhat.com
Tue Feb 26 13:29:21 UTC 2013


Allon Mureinik has submitted this change and it was merged.

Change subject: core: VmRunHandler: simplify isInternal evaluation
......................................................................


core: VmRunHandler: simplify isInternal evaluation

Some of the checks in VmRunHandler are only evaluated in the following
condition:
!vm.isAutoStartup() || !runParams.getIsInternal() && vm.isAutoStartup()

Since java evaluated boolean conditions with short circuit logic, this
can be simplified.
The right hand of the || condition is only tested if
!vm.isAutoStartup() evaluates to false, which means vm.isAutoStartup()
evaluated to true - so there is no reason to test it again.

The added readability is a bonus.

Change-Id: I0aa0ce3b0ef22739014f31f4019a35b8d230aaee
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Allon Mureinik: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/12248
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0aa0ce3b0ef22739014f31f4019a35b8d230aaee
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Alissa Bonas <abonas at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk at redhat.com>



More information about the Engine-commits mailing list