diff --git a/java/memory/memory-netty/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java b/java/memory/memory-netty/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java index 870114d7db1b5..a6b7d0eec163d 100644 --- a/java/memory/memory-netty/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java +++ b/java/memory/memory-netty/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java @@ -161,8 +161,7 @@ public InnerAllocator() { } private UnsafeDirectLittleEndian newDirectBufferL(int initialCapacity, int maxCapacity) { - PoolArenasCache cache = threadCache(); - PoolArena directArena = cache.directArena; + PoolArena directArena = threadCache().directArena; if (directArena != null) { @@ -178,7 +177,7 @@ private UnsafeDirectLittleEndian newDirectBufferL(int initialCapacity, int maxCa hugeBufferSize); } else { // within chunk, use arena. - ByteBuf buf = directArena.allocate(cache, initialCapacity, maxCapacity); + ByteBuf buf = directArena.allocate(threadCache(), initialCapacity, maxCapacity); if (!(buf instanceof PooledUnsafeDirectByteBuf)) { fail(); }