Skip to content

Commit

Permalink
Fix #11956
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Jun 25, 2024
1 parent 82ab704 commit efc2089
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ByteBufferAccumulator()

public ByteBufferAccumulator(ByteBufferPool bufferPool, boolean direct)
{
_bufferPool = (bufferPool == null) ? new ByteBufferPool.NonPooling() : bufferPool;
_bufferPool = (bufferPool == null) ? ByteBufferPool.NON_POOLING : bufferPool;
_direct = direct;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@Deprecated (forRemoval = true, since = "12.1.0")
public class ChunkAccumulator
{
private static final ByteBufferPool NON_POOLING = new ByteBufferPool.NonPooling();
private static final ByteBufferPool NON_POOLING = ByteBufferPool.NON_POOLING;
private final List<Chunk> _chunks = new ArrayList<>();
private int _length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public interface RetainableByteBuffer extends Retainable
*
* @param byteBuffer the {@code ByteBuffer} to wrap
* @return a {@link FixedCapacity} buffer wrapping the passed {@link ByteBuffer}
* @see ByteBufferPool.NonPooling
* @see ByteBufferPool#NON_POOLING
*/
static RetainableByteBuffer wrap(ByteBuffer byteBuffer)
{
Expand All @@ -104,7 +104,7 @@ static RetainableByteBuffer wrap(ByteBuffer byteBuffer)
* @param byteBuffer the {@code ByteBuffer} to wrap
* @param retainable the associated {@link Retainable}.
* @return a {@link FixedCapacity} buffer wrapping the passed {@link ByteBuffer}
* @see ByteBufferPool.NonPooling
* @see ByteBufferPool#NON_POOLING
*/
static RetainableByteBuffer wrap(ByteBuffer byteBuffer, Retainable retainable)
{
Expand Down Expand Up @@ -1417,7 +1417,7 @@ public DynamicCapacity(ByteBufferPool pool, boolean direct, long maxSize, int ag
private DynamicCapacity(List<RetainableByteBuffer> buffers, ByteBufferPool pool, boolean direct, long maxSize, int aggregationSize, int minRetainSize)
{
super();
_pool = pool == null ? new ByteBufferPool.NonPooling() : pool;
_pool = pool == null ? ByteBufferPool.NON_POOLING : pool;
_direct = direct;
_maxSize = maxSize < 0 ? Long.MAX_VALUE : maxSize;
_buffers = buffers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Data is read from the {@link InputStream} into a buffer that is optionally acquired
* from a {@link ByteBufferPool}, and converted to a {@link Content.Chunk} that is
* returned from {@link #read()}. If no {@link ByteBufferPool} is provided, then
* a {@link ByteBufferPool.NonPooling} is used.
* a {@link ByteBufferPool#NON_POOLING} is used.
* </p>
*/
public class InputStreamContentSource implements Content.Source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public void testLargeFrame()
expected.put(toBuffer(Integer.MAX_VALUE));
expected.flip();

Parser parser = new Parser(new ByteBufferPool.NonPooling());
Parser parser = new Parser(ByteBufferPool.NON_POOLING);
assertNull(parser.parse(expected));
assertThat(parser.getPayloadLength(), equalTo(Integer.MAX_VALUE));
}
Expand All @@ -265,7 +265,7 @@ public void testFrameTooLarge()
expected.put(toBuffer(Integer.MAX_VALUE + 1L));
expected.flip();

Parser parser = new Parser(new ByteBufferPool.NonPooling());
Parser parser = new Parser(ByteBufferPool.NON_POOLING);
assertThrows(MessageTooLargeException.class, () -> parser.parse(expected));
}

Expand All @@ -280,7 +280,7 @@ public void testLargestFrame()
expected.put(new byte[]{(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF});
expected.flip();

Parser parser = new Parser(new ByteBufferPool.NonPooling());
Parser parser = new Parser(ByteBufferPool.NON_POOLING);
assertThrows(MessageTooLargeException.class, () -> parser.parse(expected));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class OutgoingMessageCapture extends CoreSession.Empty implements CoreSes
public BlockingQueue<ByteBuffer> binaryMessages = new LinkedBlockingDeque<>();
public BlockingQueue<String> events = new LinkedBlockingDeque<>();

private final ByteBufferPool bufferPool = new ByteBufferPool.NonPooling();
private final ByteBufferPool bufferPool = ByteBufferPool.NON_POOLING;
private final MethodHandle wholeTextHandle;
private final MethodHandle wholeBinaryHandle;
private MessageSink messageSink;
Expand Down

0 comments on commit efc2089

Please sign in to comment.