Change in ovirt-engine[master]: core: sorted getJsonDiskDescription()

Allon Mureinik has submitted this change and it was merged. Change subject: core: sorted getJsonDiskDescription() ...................................................................... core: sorted getJsonDiskDescription() ImagesHandler.getJsonDiskDescription() used a HashMap to serialize a Disk's Alias and Description. Since the order of iteration of a HashMap cannot be trusted, it made the method's behavior unpredictable in different environments, specifically breaking the unit tests on the default JDK8 supplied with Fedora 21. This patch replaces the internal implementation from using a HashMap to use a TreeMap, ensuring the keys are iterated by order, and thus producing a reliable output: {"DiskAlias":"some_alias","DiskDescription":"some_description}. The unit tests have been fixed accordingly, making them agnostic to JDK upgrades. Change-Id: Ic8496858a2cb5715ab9f84b8ae77f62b3e6097d4 Bug-Url: https://bugzilla.redhat.com/1180522 Signed-off-by: Allon Mureinik <amureini@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImagesHandlerTest.java 2 files changed, 5 insertions(+), 4 deletions(-) Approvals: Tal Nisan: Looks good to me, approved Allon Mureinik: Verified -- To view, visit http://gerrit.ovirt.org/36753 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8496858a2cb5715ab9f84b8ae77f62b3e6097d4 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipchuk@redhat.com> Gerrit-Reviewer: Tal Nisan <tnisan@redhat.com> Gerrit-Reviewer: automation@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server
participants (1)
-
amureini@redhat.com