-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix an NPE in CRAMRecordReadFeatures.restoreReadBases #1655
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 merge after addressing minor comments
final SAMRecord cramRecordEmbedded = cramEmbeddedIterator.next(); | ||
Assert.assertEquals(cramRecordEmbedded, cramRecord); | ||
} | ||
Assert.assertEquals(count, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also assert that both iterators are exhausted after the loop
final SAMRecord cramRecord = cramIterator.next(); | ||
final SAMRecord cramRecordEmbedded = cramEmbeddedIterator.next(); | ||
Assert.assertEquals(cramRecordEmbedded, cramRecord); | ||
} | ||
Assert.assertTrue( count >0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add text message for when assertion fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I ran this in the debugger, and the reason the other embedded ref tests don't catch this issue is they have less interesting/varied read features than the other embedded ref tests (specifically this one has two read features with a gap between them). So I think this change is fine. We could use some better embedded ref tests.
@cmnbroad This is a bug related to handling embedded references.