samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 243 forks source link

SamReaderFactory should use current defaults when makeDefault() is called #1666

Open lbergelson opened 1 year ago

lbergelson commented 1 year ago

Currently SamReaderFactory stores a DEFAULT factory as a static variable. Certain operations update this default so when SamReaderFactory.makeDefault() is called it returns different values. However, some default values are set through other mechanisms like BlockGunzipper.setDefaultInflaterFactory which can lead to unexpected results when they are not propagated through calls to make default.