Fail clearly when a CRAM query needs to seek but cannot - #1791
Conversation
CRAMFileReader can be constructed from an InputStream together with an index. If that stream is not a SeekableStream, getSeekableStreamOrFailWithRTE -- despite its name -- returned null instead of failing, and the null surfaced later as a bare NullPointerException from whichever query call the user made. Throw an IllegalStateException naming the actual constraint: query and index operations need a File, a Path, or a SeekableStream. Sequential iteration does not seek and is unaffected, which the test pins down.
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Three test classes added in #1789, #1791 and #1792 used snake_case method names without the conventional test prefix, which is neither idiomatic Java nor what this repo does: of 2417 test methods, 2020 start with "test" and only 199 contain an underscore at all. Rename the nine offending methods in these three classes to testXxx camelCase. Test bodies are untouched; this is naming only.
Three test classes added in #1789, #1791 and #1792 used snake_case method names without the conventional test prefix, which is neither idiomatic Java nor what this repo does: of 2417 test methods, 2020 start with "test" and only 199 contain an underscore at all. Rename the nine offending methods in these three classes to testXxx camelCase. Test bodies are untouched; this is naming only.
Closes #426.
CRAMFileReadercan be constructed from anInputStreamtogether with an index. If that stream is not aSeekableStream,getSeekableStreamOrFailWithRTE— despite its name — returnednullrather than failing, and thenullsurfaced later as a bareNullPointerExceptionfrom whichever query call the user made.It now throws an
IllegalStateExceptionnaming the actual constraint: query and index operations need aFile, aPath, or aSeekableStream.Sequential iteration does not seek and is unaffected, which one of the tests pins down. I also confirmed the test genuinely covers the bug by reverting the fix and watching it fail with the original
NullPointerException.