Allon Mureinik has uploaded a new change for review.
Change subject: core: Version.Op[In]Equality in UpdateStoragePool
......................................................................
core: Version.Op[In]Equality in UpdateStoragePool
Replaced calls to Version.OpEquality and Version.OpInequality with
version.equals(version2), as it's the standard Java way of doing
things, and is easier to read.
This can be done since oldSpmVersion is known to be not null be the
following logic:
1. It's retrieved from _oldStoragePool, which is assumed to be
not-null under the CURRENT implementation.
2. This member is retrieved from the database, where the storage_pool
table has a NOT NULL constraint on the compatibility_version
column.
note that this also 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: Id36fc037c3597bb01c041850c4eb231a366f79da
Signed-off-by: Allon Mureinik <[email protected]>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
2 files changed, 3 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/94/21394/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 e4f92bb..2aeff5f 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
@@ -698,7 +698,7 @@
Version vmToolsClusterVersion = null;
if (getVm().getHasAgent()) {
Version clusterVer = getVm().getPartialVersion();
- if (Version.OpEquality(clusterVer, new Version("4.4"))) {
+ if (new Version("4.4").equals(clusterVer)) {
vmToolsClusterVersion = new Version("2.1");
} else {
vmToolsClusterVersion = clusterVer;
@@ -724,8 +724,7 @@
|| (clusterVer.compareTo(bestClusterVer) > 0))
{
bestToolVer = toolVersion;
bestClusterVer = clusterVer;
- } else if ((Version.OpEquality(clusterVer,
bestClusterVer))
- && (toolVersion > bestToolVer)) {
+ } else if (clusterVer.equals(bestClusterVer) &&
toolVersion > bestToolVer) {
bestToolVer = toolVersion;
bestClusterVer = clusterVer;
}
diff --git
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
index 3e74bea..9be168b 100644
---
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
+++
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
@@ -93,7 +93,7 @@
final Version spVersion = storagePool.getcompatibility_version();
final Version oldSpVersion =
_oldStoragePool.getcompatibility_version();
- if (Version.OpEquality(spVersion, oldSpVersion)) {
+ if (oldSpVersion.equals(spVersion)) {
return;
}
--
To view, visit http://gerrit.ovirt.org/21394
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id36fc037c3597bb01c041850c4eb231a366f79da
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