#9410 Improved toString() and javadoc

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2023-03-01 17:25:32 +01:00
parent 8fe3dbad16
commit 45db74eee0
3 changed files with 14 additions and 1 deletions

View File

@ -73,6 +73,6 @@ public abstract class AbstractRetainableByteBuffer implements RetainableByteBuff
@Override
public String toString()
{
return "%s@%x[r=%d,%s]".formatted(getClass().getSimpleName(), hashCode(), refCount.get(), BufferUtil.toDetailString(byteBuffer));
return "%s@%x[rc=%d,%s]".formatted(getClass().getSimpleName(), hashCode(), refCount.get(), BufferUtil.toDetailString(byteBuffer));
}
}

View File

@ -333,6 +333,7 @@ public class Content
* the content reader reads a content chunk, via an {@link Chunk.Error} instance.</p>
* <p>If {@link #read()} has returned a last chunk, this is a no operation.</p>
* <p>Typical failure: the content being aborted by user code, or idle timeouts.</p>
* <p>If this method has already been called, then it is a no operation.</p>
*
* @param failure the cause of the failure
*/

View File

@ -82,6 +82,12 @@ public abstract class ByteBufferChunk implements Content.Chunk
{
return references.release();
}
@Override
public String toString()
{
return "%s[rc=%d]".formatted(super.toString(), references.get());
}
}
public static class ReleasedByRunnable extends ByteBufferChunk.WithReferenceCount
@ -159,5 +165,11 @@ public abstract class ByteBufferChunk implements Content.Chunk
{
return retainable.release();
}
@Override
public String toString()
{
return "%s[%s]".formatted(super.toString(), retainable);
}
}
}