Juan Hernandez has posted comments on this change.

Change subject: restapi: Fix NPE in request for CDROMs of wrong VM
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.ovirt.org/#/c/33977/1/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendReadOnlyDevicesResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendReadOnlyDevicesResource.java:

Line 45:         // when requesting the CDROMs of a VM this query will actually 
load a collection contain the VM, not the CDROMs.
Line 46:         // The result will be null if there is no such VM (if the user 
provided an incorrect id, or if the VM has been
Line 47:         // removed) and in that case we need to respond with the 404 
error code.
Line 48:         List<Q> collection = getBackendCollection(queryType, 
queryParams);
Line 49:         if (collection == null || collection.isEmpty()) {
> Consider using CollectionUtils.isEmpty
I would like to, but the version of comons-collections that we currently have 
in our root POM is 3.1, and it doesn't have that "isEmpty" method, it was added 
in 3.2. I will submit a patch to update it to 3.2.1, as that is the version 
used by JBoss 7.1.1.
Line 50:             throw new 
WebApplicationException(Response.Status.NOT_FOUND);
Line 51:         }
Line 52:         return mapCollection(collection);
Line 53:     }


-- 
To view, visit http://gerrit.ovirt.org/33977
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I55d4742649d8d260ae4d7c924c1a9b91efbcea6b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to