Liron Aravot has posted comments on this change.
Change subject: core: Extract code to methods in ImagesHandler
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
Line 437: break;
Line 438: }
Line 439: return result;
Line 440: }
Line 441:
right, but now this method is exposed as public - so it can be called also by
someone who 'has' the entity and not only the id, furthermore..I usually prefer
to have method that perform one operation, this method perform 'load and
check', therefore I'd prefer to have it only check and perform the load itself
during the flow when needed.
Line 442:
Line 443: public static boolean isVmDown(VM vm) {
Line 444: return vm.getStatus() == VMStatus.Down;
Line 445: }
Line 444: return vm.getStatus() == VMStatus.Down;
Line 445: }
Line 446:
Line 447:
Line 448: public static boolean isStoragePoolValid(Guid storagePoolId) {
I honestly think that having a return lines is not more complex for
debugging..the value doesn't change here, we simply return.
Line 449: boolean isValid = true;
Line 450: storage_pool pool =
DbFacade.getInstance().getStoragePoolDao().get(storagePoolId);
Line 451: if (pool == null || pool.getstatus() != StoragePoolStatus.Up)
{
Line 452: isValid = false;
--
To view, visit http://gerrit.ovirt.org/10148
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I363f7bf24ca9b5d408a61ba9159b6e5f2a5c46e0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches