Alona Kaplan has posted comments on this change. Change subject: core: refactor: renamed variables + extracted creating map ......................................................................
Patch Set 39: (3 comments) https://gerrit.ovirt.org/#/c/36145/39//COMMIT_MSG Commit Message: Line 5: CommitDate: 2015-06-06 18:16:44 +0200 Line 6: Line 7: core: refactor: renamed variables + extracted creating map Line 8: Line 9: • Map<String, List<NetworkType>> nicsToNetworks —> Map<String, List<NetworkType>> nicNameToNetworkTypesMap The lines are too long. Please shorten them to fit the gerrit view (general view). Line 10: • Entry<String, List<NetworkType>> nicToNetworkTypes —> Entry<String, List<NetworkType>> nicNameToNetworkTypes Line 11: • extracted code creating map into method createNicNameToNetworkTypesMap Line 12: Line 13: Change-Id: I7e0a7875a3f5356455f132af23d56d62f00d1989 https://gerrit.ovirt.org/#/c/36145/39/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkAttachmentsValidator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkAttachmentsValidator.java: Line 55: } Line 56: return violatedNics; Line 57: } Line 58: Line 59: //TODO MM: is there a possibility, that network attachment will be present twice in list each time with different network (of different type); if so, what about duplicates in that list? IIUC, you get to this point after verifying attachment list is ok. So there is no possibility for network attachment to appear twice in the list. Line 60: private Map<String, List<NetworkType>> createNicNameToNetworkTypesMap() { Line 61: Map<String, List<NetworkType>> nicNameToNetworkTypes = new HashMap<>(); Line 62: for (NetworkAttachment attachment : attachmentsToConfigure) { Line 63: String nicName = attachment.getNicName(); Line 60: private Map<String, List<NetworkType>> createNicNameToNetworkTypesMap() { Line 61: Map<String, List<NetworkType>> nicNameToNetworkTypes = new HashMap<>(); Line 62: for (NetworkAttachment attachment : attachmentsToConfigure) { Line 63: String nicName = attachment.getNicName(); Line 64: //TODO MM: use MultiValueMapUtils Was done in a latter patch? Line 65: if (!nicNameToNetworkTypes.containsKey(nicName)) { Line 66: nicNameToNetworkTypes.put(nicName, new ArrayList<NetworkType>()); Line 67: } Line 68: -- To view, visit https://gerrit.ovirt.org/36145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e0a7875a3f5356455f132af23d56d62f00d1989 Gerrit-PatchSet: 39 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches