core: Fix VDS.hashCode()

VDS.hashCode() includes the hashCode() of vdsDynamic and vdsStatistics,
which are not present in VDS.eqauls(Object).

This behavior violates Java's contract that clearly states that if
a.equals(b) then it is required that a.hashCode() == b.hashCode().

This patch fixes the aforementioned bug by removing these two members
for the hashCode() calculation.

Change-Id: Ie006b12f59762bc92663007a37bf46325f8f9378
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Don't clone Guids in VDS.clone()

Since Guids are immutable, there is no need for VDS.clone() to create
new Guid instances, especially not by the expensive string-parsing
method.

This patch changes the new instance created by VDS.clone() to simply
hold references to the old one's Guid, thus improving performance.
As a nice side bonus, this will allow cloning of VDS instances that have
null VDS group or storage pool IDs.

This patch also contains a test to assert this functionality.

Change-Id: I0f7130f76525dda601ac0bc7322fbf96c961c5a6
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: GuidUtils code formatter

Apply code formatter on GuidUtils to shorten long javadoc lines.

Change-Id: I2dc1d6c5bb330c08bb4a3357c19e683f3d439f82
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: GuidUtils - remove TODO

Removed a useless TODO comment.

Change-Id: I41a9b5f63c80da62ed0317b128f572cade363721
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Guid.ToByteArray -> Guid.toByteArray

As per Java coding conventions.

Change-Id: I2457ba75fbe8c427b143b8b9d1bb9dac3c3c3053
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: GuidUtils initial StringBuilder capacity

The StringBuilder used in writeGUIDPartToStream is known to contain 2
characters.
This patch initializes it in the correct size instead of wasting the
additional 14 bytes done by the default initialization.

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