Skip to content

Commit c01ec4d

Browse files
committed
Fix java.nio.ByteBuffer.clear() error
1 parent f53f309 commit c01ec4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/broadinstitute/hellbender/utils/nio/SeekableByteChannelPrefetcher.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.broadinstitute.hellbender.utils.nio;
22

33
import com.google.common.base.Stopwatch;
4+
5+
import java.nio.Buffer;
46
import java.util.concurrent.ThreadFactory;
57
import org.broadinstitute.hellbender.exceptions.GATKException;
68

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

143145
public WorkUnit resetForIndex(long blockIndex) {
144146
this.blockIndex = blockIndex;
145-
buf.clear();
147+
((Buffer) buf).clear(); // for Java 11, see https://github.com/jruby/jruby/issues/5450
146148
futureBuf = null;
147149
return this;
148150
}

0 commit comments

Comments
 (0)