Michael Kublin has posted comments on this change.
Change subject: core: GetAllDisksBySD - fetch disks snapshots
......................................................................
Patch Set 4: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetAllDisksByStorageDomainIdQuery.java
Line 24:
Line 25: // Get active diskImages
Line 26: for (DiskImage diskImage : diskImages) {
Line 27: if (diskImage.getactive()) {
Line 28:
diskImage.getSnapshots().add(DiskImage.copyOf(diskImage));
why need copy here?
Line 29: diskImagesMap.put(diskImage.getId(), diskImage);
Line 30: }
Line 31: }
Line 32:
Line 29: diskImagesMap.put(diskImage.getId(), diskImage);
Line 30: }
Line 31: }
Line 32:
Line 33: // Update diskImages' snapshots
These is weird. These is the same loop as at line 26. If else can work fine, no
reason for second loop.
By the way line 36 it is NPE
Line 34: for (DiskImage diskImage : diskImages) {
Line 35: if (!diskImage.getactive()) {
Line 36:
diskImagesMap.get(diskImage.getId()).getSnapshots().add(diskImage);
Line 37: }
--
To view, visit http://gerrit.ovirt.org/11640
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I055e317ea21a9eabea126e9ca17af61db659cd10
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches