test_class.file: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/BufferTest.java
test_class.identifier: BufferTest
test_case.body: @Test
  	public void testgetNioBufferThreadSafe() {
  		final MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(1024);
  		final BufferRecycler recycler = Mockito.mock(BufferRecycler.class);
  
  		Buffer buffer = new Buffer(segment, recycler);
  
  		ByteBuffer buf1 = buffer.getNioBuffer();
  		ByteBuffer buf2 = buffer.getNioBuffer();
  
  		assertNotNull(buf1);
  		assertNotNull(buf2);
  
  		assertTrue("Repeated call to getNioBuffer() returns the same nio buffer", buf1 != buf2);
  	}
test_case.class_method_signature: BufferTest.testgetNioBufferThreadSafe()
test_case.full_signature: @Test public void testgetNioBufferThreadSafe()
test_case.identifier: testgetNioBufferThreadSafe
test_case.invocations: allocateUnpooledSegment mock getNioBuffer getNioBuffer assertNotNull assertNotNull assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testgetNioBufferThreadSafe()
focal_class.declarator: memorySegment
focal_class.modifier: private final
focal_class.original_string: private final MemorySegment memorySegment;
focal_class.type: MemorySegment
focal_class.var_name: memorySegment
focal_class.declarator: recycleLock = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object recycleLock = new Object();
focal_class.type: Object
focal_class.var_name: recycleLock
focal_class.declarator: recycler
focal_class.modifier: private final
focal_class.original_string: private final BufferRecycler recycler;
focal_class.type: BufferRecycler
focal_class.var_name: recycler
focal_class.declarator: isBuffer
focal_class.modifier: private
focal_class.original_string: private boolean isBuffer;
focal_class.type: boolean
focal_class.var_name: isBuffer
focal_class.declarator: referenceCount = 1
focal_class.modifier: private
focal_class.original_string: private int referenceCount = 1;
focal_class.type: int
focal_class.var_name: referenceCount
focal_class.declarator: currentSize
focal_class.modifier: private
focal_class.original_string: private int currentSize;
focal_class.type: int
focal_class.var_name: currentSize
focal_class.file: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/Buffer.java
focal_class.identifier: Buffer
focal_class.class_method_signature: Buffer.Buffer(MemorySegment memorySegment, BufferRecycler recycler)
focal_class.full_signature: public  Buffer(MemorySegment memorySegment, BufferRecycler recycler)
focal_class.identifier: Buffer
focal_class.modifiers: public
focal_class.parameters: (MemorySegment memorySegment, BufferRecycler recycler)
focal_class.signature:  Buffer(MemorySegment memorySegment, BufferRecycler recycler)
focal_class.class_method_signature: Buffer.Buffer(MemorySegment memorySegment, BufferRecycler recycler, boolean isBuffer)
focal_class.full_signature: public  Buffer(MemorySegment memorySegment, BufferRecycler recycler, boolean isBuffer)
focal_class.identifier: Buffer
focal_class.modifiers: public
focal_class.parameters: (MemorySegment memorySegment, BufferRecycler recycler, boolean isBuffer)
focal_class.signature:  Buffer(MemorySegment memorySegment, BufferRecycler recycler, boolean isBuffer)
focal_class.class_method_signature: Buffer.isBuffer()
focal_class.full_signature: public boolean isBuffer()
focal_class.identifier: isBuffer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isBuffer()
focal_class.class_method_signature: Buffer.tagAsEvent()
focal_class.full_signature: public void tagAsEvent()
focal_class.identifier: tagAsEvent
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void tagAsEvent()
focal_class.class_method_signature: Buffer.getMemorySegment()
focal_class.full_signature: public MemorySegment getMemorySegment()
focal_class.identifier: getMemorySegment
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: MemorySegment
focal_class.signature: MemorySegment getMemorySegment()
focal_class.class_method_signature: Buffer.getNioBuffer()
focal_class.full_signature: public ByteBuffer getNioBuffer()
focal_class.identifier: getNioBuffer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer getNioBuffer()
focal_class.class_method_signature: Buffer.getRecycler()
focal_class.full_signature: public BufferRecycler getRecycler()
focal_class.identifier: getRecycler
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BufferRecycler
focal_class.signature: BufferRecycler getRecycler()
focal_class.class_method_signature: Buffer.getSize()
focal_class.full_signature: public int getSize()
focal_class.identifier: getSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getSize()
focal_class.class_method_signature: Buffer.setSize(int newSize)
focal_class.full_signature: public void setSize(int newSize)
focal_class.identifier: setSize
focal_class.modifiers: public
focal_class.parameters: (int newSize)
focal_class.return: void
focal_class.signature: void setSize(int newSize)
focal_class.class_method_signature: Buffer.recycle()
focal_class.full_signature: public void recycle()
focal_class.identifier: recycle
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void recycle()
focal_class.class_method_signature: Buffer.retain()
focal_class.full_signature: public Buffer retain()
focal_class.identifier: retain
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Buffer
focal_class.signature: Buffer retain()
focal_class.class_method_signature: Buffer.isRecycled()
focal_class.full_signature: public boolean isRecycled()
focal_class.identifier: isRecycled
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isRecycled()
focal_class.class_method_signature: Buffer.ensureNotRecycled()
focal_class.full_signature: private void ensureNotRecycled()
focal_class.identifier: ensureNotRecycled
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void ensureNotRecycled()
focal_class.class_method_signature: Buffer.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public ByteBuffer getNioBuffer() {
  		synchronized (recycleLock) {
  			ensureNotRecycled();
  			// the memory segment returns a distinct buffer every time
  			return memorySegment.wrap(0, currentSize);
  		}
  	}
focal_method.class_method_signature: Buffer.getNioBuffer()
focal_method.full_signature: public ByteBuffer getNioBuffer()
focal_method.identifier: getNioBuffer
focal_method.invocations: ensureNotRecycled wrap
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: ByteBuffer
focal_method.signature: ByteBuffer getNioBuffer()