Allon Mureinik has posted comments on this change. Change subject: core: Enhance RO need to update check ......................................................................
Patch Set 3: Code-Review-1 (1 comment) http://gerrit.ovirt.org/#/c/35456/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java: Line 593: } Line 594: Line 595: protected boolean updateReadOnlyRequested() { Line 596: Boolean readOnlyNewValue = getNewDisk().getReadOnly(); Line 597: return readOnlyNewValue != null && !vmDeviceForVm.getIsReadOnly().equals(readOnlyNewValue); Why do we need the "!= condition"? If vmDeviceForVm.getIsReadOnly() is trusted to be not-null (as the current code implies), why not just do "vmDeviceForVm.getIsReadOnly().equals(getNewDisk.getReadOnly())"? Alternatively, if neither can be trusted to be not null, you could use "Objects.equals(vmDeviceForVm.getIsReadOnly(), getNewDisk.getReadOnly())" Line 598: } Line 599: Line 600: protected boolean isAtLeastOneVmIsNotDown(List<VM> vmsDiskPluggedTo) { Line 601: for (VM vm : vmsDiskPluggedTo) { -- To view, visit http://gerrit.ovirt.org/35456 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bbfc60c3e9bda0133eec9b1db116f8e7bad9d1d Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Vered Volansky <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: Vered Volansky <[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
