X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FMutableUnsignedLongSet.java;h=d225033ebc9b02119cf6e76912666f7a6e174427;hb=99f80f27bee37bb23e345420bf14bb7bb4793c28;hp=b42a945519b97204352bb1afbd9c0fc34940c110;hpb=245165804cb8c11340fa5b225e5cccbe32c01337;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/MutableUnsignedLongSet.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/MutableUnsignedLongSet.java index b42a945519..d225033ebc 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/MutableUnsignedLongSet.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/MutableUnsignedLongSet.java @@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.datastore.utils; import com.google.common.annotations.Beta; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableRangeSet; +import com.google.common.collect.Range; import com.google.common.primitives.UnsignedLong; import java.util.NavigableSet; import java.util.TreeSet; @@ -185,7 +186,9 @@ public final class MutableUnsignedLongSet extends UnsignedLongSet implements Mut return Entry.of(lowerBits, newUpper); } + // Provides compatibility with RangeSet using [lower, upper + 1) public ImmutableRangeSet toRangeSet() { - return ImmutableRangeSet.copyOf(Collections2.transform(trustedRanges(), Entry::toUnsigned)); + return ImmutableRangeSet.copyOf(Collections2.transform(trustedRanges(), entry -> Range.closedOpen( + UnsignedLong.fromLongBits(entry.lowerBits), UnsignedLong.fromLongBits(entry.upperBits + 1)))); } }