rafaelweingartner commented on issue #2298: CLOUDSTACK-9620: Enhancements for managed storage URL: https://github.com/apache/cloudstack/pull/2298#issuecomment-355687919 I understood that. It is good the way you did as well. What I meant previously was the following. You have this block of code: ``` if (canHandleSrc) { if (srcSnapshotInfo.getDataStore().getId() == destVolumeInfo.getDataStore().getId()) { handleCreateVolumeFromSnapshotBothOnStorageSystem(srcSnapshotInfo, destVolumeInfo, callback); } else { String errMsg = "To perform this operation, the source and destination primary storages must be the same."; handleError(errMsg, callback); } } else { handleCreateVolumeFromSnapshotOnSecondaryStorage(srcSnapshotInfo, destVolumeInfo, callback); } ``` This previous block is the same as: ``` if (!canHandleSrc) { handleCreateVolumeFromSnapshotOnSecondaryStorage(srcSnapshotInfo, destVolumeInfo, callback); } if (srcSnapshotInfo.getDataStore().getId() == destVolumeInfo.getDataStore().getId()) { handleCreateVolumeFromSnapshotBothOnStorageSystem(srcSnapshotInfo, destVolumeInfo, callback); } else { String errMsg = "To perform this operation, the source and destination primary storages must be the same."; handleError(errMsg, callback); } ``` Sorry the bad indentation here. So, the idea was to remove one IF inside the other. At least for me, the least nested conditions and operations, the better to read the code.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
