Allon Mureinik has uploaded a new change for review. Change subject: core: Don't use Version.OpEquality in RunVmCommand ......................................................................
core: Don't use Version.OpEquality in RunVmCommand In all the (three) places Version.OpEquality is used in RunVmCommand, at least one of the Version's can be deduced to be non-null. Under these circumstances, using version.equals(version2) is better, as it's the standard Java way of doing things, and is easier to read. Also, note it has a slight theoretical performance benefit, as nullability is no longer checked on the first operand, but it's doubtful that this will be be noticeable. Change-Id: I1e77770ace7f0e6fd06dcea502c427cb202c0f66 Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/21393/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java index 5e53127..e4f92bb 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java @@ -735,8 +735,8 @@ if (bestClusterVer != null && (vmToolsClusterVersion == null - || vmToolsClusterVersion.compareTo(bestClusterVer) < 0 || (Version - .OpEquality(vmToolsClusterVersion, bestClusterVer) && getVm().getHasAgent() && + || vmToolsClusterVersion.compareTo(bestClusterVer) < 0 || (vmToolsClusterVersion.equals(bestClusterVer) + && getVm().getHasAgent() && getVm().getGuestAgentVersion().getBuild() < bestToolVer))) { // Vm has no tools or there are new tools selectedToolsVersion = (Integer.toString(bestToolVer)); -- To view, visit http://gerrit.ovirt.org/21393 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e77770ace7f0e6fd06dcea502c427cb202c0f66 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
