Skip to content

Make span() throw for empty TreeRangeMap.subRangeMap views with an empty restriction. - #8907

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1022760521
Nov 24, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1022760521

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Make span() throw for empty TreeRangeMap.subRangeMap views with an empty restriction.

If the restriction passed to subRangeMap was an empty range (e.g. Range.closedOpen(5, 5)) lying inside a stored entry, span() returned that empty range instead of throwing NoSuchElementException as RangeMap.span() specifies for an empty map.

Fixes #8855
Fixes #8856

RELNOTES=collect: Fixed TreeRangeMap.subRangeMap(emptyRange).span() to throw NoSuchElementException instead of returning an empty range.

…n empty restriction.

If the restriction passed to `subRangeMap` was an empty range (e.g. `Range.closedOpen(5, 5)`) lying inside a stored entry, `span()` returned that empty range instead of throwing `NoSuchElementException` as `RangeMap.span()` specifies for an empty map.

Fixes #8855
Fixes #8856

RELNOTES=`collect`: Fixed `TreeRangeMap.subRangeMap(emptyRange).span()` to throw `NoSuchElementException` instead of returning an empty range.
PiperOrigin-RevId: 1029069843
@copybara-service
copybara-service Bot merged commit d0e7d9a into master Nov 24, 2026
3 checks passed
@copybara-service
copybara-service Bot deleted the test_1022760521 branch November 24, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty TreeRangeMap restriction returns a span instead of throwing

1 participant