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 <amureini@redhat.com>
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 <amureini@redhat.com>
webadmin: rm Version.OpEquality from DC model

Replaced a call to Version.OpEquality with version.equals(version2),
as it's the standard Java way of doing things, and is easier to read.

This can be done since all the versions in getVersion().getItems()
are ultimately retrieved from
GetAvailableClusterVersionsByStoragePoolQuery, which is guaranteed to
return a List<Version> of non-null elements.

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: I9a02b827e4c2d1165cb7bdc69cb681df323d4c6f
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: optimize setVdsGroupCompatibilityVersion

VDS and VM methods setVdsGroupCompatibilityVersion(Version) contain a
false optimization that only updates the member if the value were to
change.

Since assignment in Java is much cheaper than equality checking, simply
updating the value of the member, regardless of whether it changed or
not, would be much faster than this so-called optimization.

Change-Id: I0166fccf2188360b2e8812b462eb5c79d25aebe4
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core,webadmin: Remove Version.Op[In]Equality

Removed the useless Version.OpEquality and Version.OpInequality methods
and replaced them with calls to the oVirt-engine standard
OjbectUtils.objectsEqual.

Change-Id: I7d911057368ca19e5ee82b76c23a4bc989433c8b
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: char literals in Version

Use char literals instead of string literals in the Version class
wherever possible to (slightly) improve performance.

Change-Id: I57b19b57f405cf83b219715f111f5167a4ffa3fb
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: TypeCompat: GetProperties -> getProperties

Renamed method to adhere to proper Java conventions.

Change-Id: If9f2069c43cad0233f2f9e4fbbad01b2bfb39e47
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Rename members in XML-handling classes

Renamed methods and data members to start with lower case, as per the
proper Java convention.

Change-Id: I0c42b439c6482650dadb40d08ab5fbf737e0fbdf
Signed-off-by: Allon Mureinik <amureini@redhat.com>