Asaf Shakarchi has posted comments on this change.
Change subject: restapi: A check for possible NPE BackendVmsResource:remove
method
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
Line 362: getEntity(id);
Line 363: boolean forceRemove = action != null && action.isSetForce() ?
action.isForce() : false;
Line 364: RemoveVmParameters params = new
RemoveVmParameters(asGuid(id), forceRemove);
Line 365: // If detach only is set we do not remove the VM disks
Line 366: if (action != null && action.isSetVm() &&
action.getVm().isSetDisks() && action.getVm().getDisks().isSetDetachOnly()) {
Michael, true, and it never happened, this is raised in findbugs report that we
would like to clean it. merging.
Line 367: params.setRemoveDisks(false);
Line 368: }
Line 369: return performAction(VdcActionType.RemoveVm, params);
Line 370: }
Line 362: getEntity(id);
Line 363: boolean forceRemove = action != null && action.isSetForce() ?
action.isForce() : false;
Line 364: RemoveVmParameters params = new
RemoveVmParameters(asGuid(id), forceRemove);
Line 365: // If detach only is set we do not remove the VM disks
Line 366: if (action != null && action.isSetVm() &&
action.getVm().isSetDisks() && action.getVm().getDisks().isSetDetachOnly()) {
Usually it doesn't make sense to repeat a condition twice but giving a meaning
name to the boolean will make the line longer.
Line 367: params.setRemoveDisks(false);
Line 368: }
Line 369: return performAction(VdcActionType.RemoveVm, params);
Line 370: }
--
To view, visit http://gerrit.ovirt.org/10958
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Idbf51b03bb170b34e1b6bba3d37e62c967fdd5d6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches