Skip to content

Commit 2baa273

Browse files
committed
Fix longstanding bug so we use the Intel Inflater when it is requested
* We have been using the Java Inflater even when the Intel one was available and requested due to a bug in the configuration of the default inflater. The fix is fairly brittle because it depends on the order of initialization of various things. * This will be fixed more generally by samtools/htsjdk#1666
1 parent e67fe94 commit 2baa273

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/picard/cmdline/CommandLineProgram.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ public int instanceMain(final String[] argv) {
218218
this.defaultHeaders.add(new StringHeader("Started on: " + startDate));
219219

220220
Log.setGlobalLogLevel(VERBOSITY);
221-
SamReaderFactory.setDefaultValidationStringency(VALIDATION_STRINGENCY);
222221

223222
// Set the compression level everywhere we can think of
224223
BlockCompressedOutputStream.setDefaultCompressionLevel(COMPRESSION_LEVEL);
@@ -257,6 +256,10 @@ public int instanceMain(final String[] argv) {
257256
BlockGunzipper.setDefaultInflaterFactory(new IntelInflaterFactory());
258257
}
259258

259+
// This has to happen after the inflater factory is set because it causes a reinitialization of the static
260+
// default reader factory. At least until https://github.com/samtools/htsjdk/issues/1666 is resolved
261+
SamReaderFactory.setDefaultValidationStringency(VALIDATION_STRINGENCY);
262+
260263
if (!QUIET) {
261264
System.err.println("[" + new Date() + "] " + commandLine);
262265

0 commit comments

Comments
 (0)