Change in ovirt-engine[master]: restapi: BackendVmsResource template ID checking

Juan Hernandez has submitted this change and it was merged. Change subject: restapi: BackendVmsResource template ID checking ...................................................................... restapi: BackendVmsResource template ID checking Two separate places in this class compare IDs from business entities (which are Guids) with IDs from API entities (which are Strings). Since different types of objects cannot (or at least, should not) equal each other in Java, these equality checks return false as long as at least one of these values is not null, which is probably not what this code intended. This patch converts both values to Strings before comparing them. Using ObjectUtils.equals hints to a concern that these values may be nulls, so the null-safe Objects.toString is used to convert the Guids to Strings instead of a straight-forward call to toString(). Change-Id: I94222e61ceebcd79168d62dd6449fb27730ea258 Signed-off-by: Allon Mureinik <amureini@redhat.com> --- M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Juan Hernandez: Looks good to me, approved Jenkins CI: Passed CI tests Allon Mureinik: Verified -- To view, visit https://gerrit.ovirt.org/49320 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94222e61ceebcd79168d62dd6449fb27730ea258 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Arik Hadas <ahadas@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Juan Hernandez <juan.hernandez@redhat.com> Gerrit-Reviewer: gerrit-hooks <automation@ovirt.org>
participants (1)
-
juan.hernandez@redhat.com