Repository navigation
4.x: Fix Streamable range traversal starts and maximum endpoints - #8337
Merged
Merged
Conversation
Use the same index-based step for asynchronous and enumerable consumption. Comparing the next index to the exclusive endpoint supports ranges ending at the primitive maximum without changing indexed collection. Generated-by: OpenAI Codex
akarnokd
approved these changes
Oct 23, 2026
🐷 TruffleHog + Entropy Beauty ScanAverage entropy of changed code: 4.644 bits/char Changed files entropy: ✅ No secrets or suspicious high-entropy strings found. Mid-4 beauty heuristic in action — powered by our entropy chats! 😊 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.x #8337 +/- ##
============================================
+ Coverage 98.62% 98.66% +0.03%
- Complexity 7167 7169 +2
============================================
Files 826 826
Lines 50972 50972
Branches 6944 6944
============================================
+ Hits 50271 50289 +18
+ Misses 477 463 -14
+ Partials 224 220 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Streamable.rangeLong(5, 2)yields[5, 6]normally, but addingfilter(_ -> true).collect(Collectors.toList())yields[1, 2, 3, 4, 5, 6]. The enumerable traversal starts from the defaultcurrentvalue instead of the requested start. Zero and negative starts are affected too.Separately, the same synchronous range implementations emit no values for valid two-element ranges ending at
Integer.MAX_VALUEorLong.MAX_VALUE, because their exclusive endpoint wraps and the traversal uses a signed ordering comparison.Use the same index-based step for
next()andnextSync(), and stop when the index equals the exclusive endpoint. This matches the existing wrap-safe approach inFlowableRangeLong. The indexedelementAt/limitpath and public range validation remain unchanged.Ten new test methods cover non-one long starts and both primitive endpoints via ordinary and filtered/enumerable consumption. On the base, eight fail (24 total entries, one inherited disabled test). After the fix, the range suite plus required validators pass: 323 entries, 28 skipped, no failures/errors, using Temurin JDK 26.0.2.1. Full
build javadocalso passes: JUnit 14,292 entries (878 skipped), TestNG 5,796 entries (1,795 skipped), zero failures. Checkstyle and Javadoc complete successfully. Test workers were limited to two to share local build resources.This was found by source inspection and local synthetic reproductions, not a reported production incident.
AI disclosure: OpenAI Codex performed the investigation, implementation, tests, and PR drafting. A separate AI session performs independent review; that is not human review. The reasoning was to check all synchronous range consumption paths and primitive boundaries, then share the index step to remove the divergence without changing public APIs.