Allon Mureinik has posted comments on this change. Change subject: core: Fix run VM with locked disk msg ......................................................................
Patch Set 5: I would prefer that you didn't submit this (4 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java Line 513: return returnValue; Line 514: } Line 515: Line 516: private static void addDiskLockedMessage(List<String> lockedDisksAliases, List<String> messages) Line 517: { Move the "{" up a line. Line 518: int numOfDisks = lockedDisksAliases.size(); Line 519: if (numOfDisks > 0) Line 520: { Line 521: VdcBllMessages message = (numOfDisks == 1 ? VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED : Line 516: private static void addDiskLockedMessage(List<String> lockedDisksAliases, List<String> messages) Line 517: { Line 518: int numOfDisks = lockedDisksAliases.size(); Line 519: if (numOfDisks > 0) Line 520: { Move the "{" up a line. Line 521: VdcBllMessages message = (numOfDisks == 1 ? VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED : Line 522: VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ARE_LOCKED); Line 523: ListUtils.nullSafeAdd(messages, message.toString()); Line 524: Line 521: VdcBllMessages message = (numOfDisks == 1 ? VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED : Line 522: VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ARE_LOCKED); Line 523: ListUtils.nullSafeAdd(messages, message.toString()); Line 524: Line 525: String aliases = (numOfDisks == 1 ? "diskAlias" : "diskAliases"); I'm not a big fan of these ternary expression, especially if you have the same one twice a couple of rows apart. Why not have a main if statement on the numOfDisks, intiialize the two variables, and proceed from there? Line 526: messages.add(String.format("$%1$s %2$s", aliases, StringUtils.join(lockedDisksAliases, ", "))); Line 527: } Line 528: } Line 529: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java Line 341 Line 342 Line 343 Line 344 Line 345 can you explain why removing this block is OK? I vaugely recall it is, but please explain. -- To view, visit http://gerrit.ovirt.org/8693 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7c56d9d2926eaf34b4a279c8d61a8cb166524da9 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Vered Volansky <vvola...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches