Skip to content

Commit c66db1e

Browse files
normanmaurerluben
authored andcommitted
Fix
1 parent 9c75768 commit c66db1e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/test/scala/Zstd.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import java.nio.channels.FileChannel
99
import java.nio.channels.FileChannel.MapMode
1010
import java.nio.charset.Charset
1111
import java.nio.file.StandardOpenOption
12+
import java.util.concurrent.CountDownLatch
1213
import scala.annotation.unused
1314
import scala.collection.mutable.WrappedArray
1415
import scala.io._
@@ -1095,14 +1096,14 @@ class ZstdSpec extends AnyFlatSpec with ScalaCheckPropertyChecks {
10951096
assert(largeBuf6.array.length >= 10)
10961097
}
10971098

1098-
"Zstd" should "validate when extracting backing arrays from ByteBuffers" in {
1099+
"Zstd" should "validate when ByteBuffers from the BufferPool" in {
10991100
val directPoolLatch = new CountDownLatch(1)
11001101
val directPool = new BufferPool {
11011102
override def get(capacity: Int): ByteBuffer = {
11021103
ByteBuffer.allocateDirect(capacity)
11031104
}
11041105

1105-
override def release(buffer: ByteBuffer) = {
1106+
override def release(buffer: ByteBuffer): Unit = {
11061107
directPoolLatch.countDown();
11071108
}
11081109
}
@@ -1114,12 +1115,12 @@ class ZstdSpec extends AnyFlatSpec with ScalaCheckPropertyChecks {
11141115
val slicingPoolLatch = new CountDownLatch(1)
11151116
val slicingPool = new BufferPool {
11161117
override def get(capacity: Int): ByteBuffer = {
1117-
ByteBuffer.allocate(capacity);
1118-
buf.putInt(1);
1118+
var buffer = ByteBuffer.allocate(capacity);
1119+
buffer.putInt(1);
11191120
buffer.slice
11201121
}
11211122

1122-
override def release(buffer: ByteBuffer) = {
1123+
override def release(buffer: ByteBuffer): Unit = {
11231124
slicingPoolLatch.countDown();
11241125
}
11251126
}

0 commit comments

Comments
 (0)