Skip to content

Commit

Permalink
Fix java.nio.ByteBuffer.clear() error
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Sep 17, 2019
1 parent 560963b commit 15d6a63
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.broadinstitute.hellbender.utils.nio;

import com.google.common.base.Stopwatch;

import java.nio.Buffer;
import java.util.concurrent.ThreadFactory;
import org.broadinstitute.hellbender.exceptions.GATKException;

Expand Down Expand Up @@ -142,7 +144,7 @@ public ByteBuffer getBuf() throws ExecutionException, InterruptedException {

public WorkUnit resetForIndex(long blockIndex) {
this.blockIndex = blockIndex;
buf.clear();
((Buffer) buf).clear(); // for Java 11, see https://github.com/jruby/jruby/issues/5450
futureBuf = null;
return this;
}
Expand Down

0 comments on commit 15d6a63

Please sign in to comment.