Changed SAMRecord.toString() to emit the SAM format string with all fields#1762
Open
Changed SAMRecord.toString() to emit the SAM format string with all fields#1762
Conversation
nh13
reviewed
Apr 4, 2026
Member
nh13
left a comment
There was a problem hiding this comment.
- can you verify there's no newline, and if there is, strip it (he says knowingly)
- are there tools (picard, igv, gatk, fgbio, others) that rely on the
toStringreturned format (I know I know), but it is a public so a breaking change... - Should you add at least one regression test?
toStringwas previously lock free, but looking at getSAMString we have somesynchronizedmethods...- the previous method was lighter-weight, is this a concern?
- are there tests that (shudders) compared outputs using
toString? - is it time to remove the
formatdeprecated method?
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.
Description
SAMRecord has historically output an abbreviated format in toString(). I think more often than not this is confusing to users, since a SAMRecord has a well defined String format. Moreover the toString() method is used extensively by TestNG to display when two SAMRecord instances are not equal - and the vast majority of the time the toString() output did not contain the differences.
Things to think about before submitting: