Mike Kolesnik has posted comments on this change.
Change subject: engine: Added sorting to host NICs query
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/GetVdsInterfacesByVdsIdQuery.java
Line 65: }
Line 66: }
Line 67: }
Line 68:
Line 69: Collections.sort(interfaces, new
Comparator<VdsNetworkInterface>() {
Why not extend LexoNumericComparator ?
Line 70:
Line 71: private boolean isBond(VdsNetworkInterface nic) {
Line 72: return (nic.getBonded() != null && nic.getBonded());
Line 73: }
Line 93: * "parent bond" and the VLAN bond).
Line 94: */
Line 95: @Override
Line 96: public int compare(VdsNetworkInterface nic1,
VdsNetworkInterface nic2) {
Line 97: int compRes =
LexoNumericComparator.comp(extractBondName(nic1), extractBondName(nic2));
If you'd extend LexoNumericComparator then you coupld use it's compare method
which is more OO
Line 98: if (compRes != 0) {
Line 99: if (extractBondName(nic1) == null) {
Line 100: return 1;
Line 101: }
--
To view, visit http://gerrit.ovirt.org/11997
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2cb5b00230d7957dd3375b093e73d2a4a51d72b9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches