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

juan.hernandez at redhat.com juan.hernandez at redhat.com
Wed Dec 2 14:33:10 UTC 2015


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 at 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 at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list