From e72e3453e85b8afe20e2db7c8579afc9c6d117db Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 29 Mar 2021 21:42:22 -0700 Subject: [PATCH] Java client: ByteBuffer.clear supports higher JDK versions --- .../client/src/main/java/seaweedfs/client/ByteBufferPool.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java b/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java index 994bcaa2b..51053becd 100644 --- a/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java +++ b/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java @@ -3,6 +3,7 @@ package seaweedfs.client; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -34,7 +35,7 @@ public class ByteBufferPool { } public static synchronized void release(ByteBuffer obj) { - obj.clear(); + ((Buffer)obj).clear(); bufferList.add(0, obj); }