Martin Mucha has posted comments on this change. Change subject: core: util for removing overlaps in ranges ......................................................................
Patch Set 5: (1 comment) answers. http://gerrit.ovirt.org/#/c/26403/5/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/RangesWithoutOverlaps.java File backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/RangesWithoutOverlaps.java: Line 37: throw new IllegalArgumentException("badly defined range"); Line 38: } Line 39: Line 40: for(int i = 0; i < result.size(); i++) { Line 41: Pair<Long, Long> existingRange = result.get(i); > Using org.apache.commons.lang.math.LongRange will save you most of this met Thanks for pointing me to this class (will use it in future, when needed and if appropriate), but it will save just some code, not most; If I'm looking correctly, there are not methods for range joining. Neither simple LongRange.overlapsRange would not be no good for me, since I need to know *how* they overlap. Replacement for Pair<Long, Long> would be fine. If this class is modifiable. So either I'm leaving it in current state or introducing home-brewed range implementation. Line 42: long existingLeft = existingRange.getFirst(); Line 43: long existingRight = existingRange.getSecond(); Line 44: Line 45: -- To view, visit http://gerrit.ovirt.org/26403 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7dbacd11b610a5885d574356a695c6e879dcdbc Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <[email protected]> Gerrit-Reviewer: Martin Mucha <[email protected]> Gerrit-Reviewer: Mike Kolesnik <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
