@@ -9,6 +9,7 @@ import java.nio.channels.FileChannel
9
9
import java .nio .channels .FileChannel .MapMode
10
10
import java .nio .charset .Charset
11
11
import java .nio .file .StandardOpenOption
12
+ import java .util .concurrent .CountDownLatch
12
13
import scala .annotation .unused
13
14
import scala .collection .mutable .WrappedArray
14
15
import scala .io ._
@@ -1095,14 +1096,14 @@ class ZstdSpec extends AnyFlatSpec with ScalaCheckPropertyChecks {
1095
1096
assert(largeBuf6.array.length >= 10 )
1096
1097
}
1097
1098
1098
- " Zstd" should " validate when extracting backing arrays from ByteBuffers " in {
1099
+ " Zstd" should " validate when ByteBuffers from the BufferPool " in {
1099
1100
val directPoolLatch = new CountDownLatch (1 )
1100
1101
val directPool = new BufferPool {
1101
1102
override def get (capacity : Int ): ByteBuffer = {
1102
1103
ByteBuffer .allocateDirect(capacity)
1103
1104
}
1104
1105
1105
- override def release (buffer : ByteBuffer ) = {
1106
+ override def release (buffer : ByteBuffer ): Unit = {
1106
1107
directPoolLatch.countDown();
1107
1108
}
1108
1109
}
@@ -1114,12 +1115,12 @@ class ZstdSpec extends AnyFlatSpec with ScalaCheckPropertyChecks {
1114
1115
val slicingPoolLatch = new CountDownLatch (1 )
1115
1116
val slicingPool = new BufferPool {
1116
1117
override def get (capacity : Int ): ByteBuffer = {
1117
- ByteBuffer .allocate(capacity);
1118
- buf .putInt(1 );
1118
+ var buffer = ByteBuffer .allocate(capacity);
1119
+ buffer .putInt(1 );
1119
1120
buffer.slice
1120
1121
}
1121
1122
1122
- override def release (buffer : ByteBuffer ) = {
1123
+ override def release (buffer : ByteBuffer ): Unit = {
1123
1124
slicingPoolLatch.countDown();
1124
1125
}
1125
1126
}
0 commit comments