diff --git a/buffer-api/src/main/java/io/netty/buffer/api/BufferAllocator.java b/buffer-api/src/main/java/io/netty/buffer/api/BufferAllocator.java index ad275e3..16e847b 100644 --- a/buffer-api/src/main/java/io/netty/buffer/api/BufferAllocator.java +++ b/buffer-api/src/main/java/io/netty/buffer/api/BufferAllocator.java @@ -28,8 +28,8 @@ public interface BufferAllocator extends AutoCloseable { * Check that the given {@code size} argument is a valid buffer size, or throw an {@link IllegalArgumentException}. * * @param size The size to check. - * @throws IllegalArgumentException if the size is not possitive, or if the size is too big (over ~2 GB) for a - * buffer to accomodate. + * @throws IllegalArgumentException if the size is not positive, or if the size is too big (over ~2 GB) for a + * buffer to accommodate. */ static void checkSize(long size) { if (size < 1) { diff --git a/buffer-api/src/main/java/io/netty/buffer/api/CompositeBuffer.java b/buffer-api/src/main/java/io/netty/buffer/api/CompositeBuffer.java index 5d0d8e1..d9746e3 100644 --- a/buffer-api/src/main/java/io/netty/buffer/api/CompositeBuffer.java +++ b/buffer-api/src/main/java/io/netty/buffer/api/CompositeBuffer.java @@ -145,7 +145,7 @@ public final class CompositeBuffer extends ResourceSupport... sends) { @@ -321,7 +321,7 @@ public final class CompositeBuffer extends ResourceSupport MAX_CAPACITY) { throw new IllegalArgumentException( "Combined size of the constituent buffers is too big. " + - "The maximum buffer capacity is " + MAX_CAPACITY + " (Interger.MAX_VALUE - 8), " + + "The maximum buffer capacity is " + MAX_CAPACITY + " (Integer.MAX_VALUE - 8), " + "but the sum of the constituent buffer capacities was " + cap + '.'); } capacity = (int) cap; diff --git a/buffer-api/src/main/java/io/netty/buffer/api/bytebuffer/NioBuffer.java b/buffer-api/src/main/java/io/netty/buffer/api/bytebuffer/NioBuffer.java index 8fa5a7e..90a2684 100644 --- a/buffer-api/src/main/java/io/netty/buffer/api/bytebuffer/NioBuffer.java +++ b/buffer-api/src/main/java/io/netty/buffer/api/bytebuffer/NioBuffer.java @@ -52,7 +52,7 @@ class NioBuffer extends ResourceSupport implements Buffer, Re private boolean constBuffer; NioBuffer(ByteBuffer base, ByteBuffer memory, AllocatorControl control, Drop drop) { - super(new MakeInaccisbleOnDrop(ArcDrop.wrap(drop))); + super(new MakeInaccessibleOnDrop(ArcDrop.wrap(drop))); this.base = base; rmem = memory; wmem = memory; @@ -63,7 +63,7 @@ class NioBuffer extends ResourceSupport implements Buffer, Re * Constructor for {@linkplain BufferAllocator#constBufferSupplier(byte[]) const buffers}. */ NioBuffer(NioBuffer parent) { - super(new MakeInaccisbleOnDrop(new ArcDrop<>(ArcDrop.acquire(parent.unsafeGetDrop())))); + super(new MakeInaccessibleOnDrop(new ArcDrop<>(ArcDrop.acquire(parent.unsafeGetDrop())))); control = parent.control; base = parent.base; rmem = bbslice(parent.rmem, 0, parent.rmem.capacity()); // Need to slice to get independent byte orders. @@ -75,10 +75,10 @@ class NioBuffer extends ResourceSupport implements Buffer, Re constBuffer = true; } - private static final class MakeInaccisbleOnDrop implements Drop { + private static final class MakeInaccessibleOnDrop implements Drop { final Drop delegate; - private MakeInaccisbleOnDrop(Drop delegate) { + private MakeInaccessibleOnDrop(Drop delegate) { this.delegate = delegate; } @@ -98,19 +98,19 @@ class NioBuffer extends ResourceSupport implements Buffer, Re @Override public String toString() { - return "MemSegDrop(" + delegate + ')'; + return "MakeInaccessibleOnDrop(" + delegate + ')'; } } @Override protected Drop unsafeGetDrop() { - MakeInaccisbleOnDrop drop = (MakeInaccisbleOnDrop) super.unsafeGetDrop(); + MakeInaccessibleOnDrop drop = (MakeInaccessibleOnDrop) super.unsafeGetDrop(); return drop.delegate; } @Override protected void unsafeSetDrop(Drop replacement) { - super.unsafeSetDrop(new MakeInaccisbleOnDrop(replacement)); + super.unsafeSetDrop(new MakeInaccessibleOnDrop(replacement)); } @Override diff --git a/buffer-api/src/main/java/io/netty/buffer/api/internal/LifecycleTracer.java b/buffer-api/src/main/java/io/netty/buffer/api/internal/LifecycleTracer.java index cd43de1..4dace3a 100644 --- a/buffer-api/src/main/java/io/netty/buffer/api/internal/LifecycleTracer.java +++ b/buffer-api/src/main/java/io/netty/buffer/api/internal/LifecycleTracer.java @@ -165,7 +165,7 @@ public abstract class LifecycleTracer { public void attach(E throwable, long timestamp) { Trace recv = received; - String message = sent && recv == null? name + " (sent but not received)" : name; + String message = sent && recv == null ? name + " (sent but not received)" : name; message += " (current acquires = " + acquires + ") T" + (this.timestamp - timestamp) / 1000 + "µs."; Traceback exception = new Traceback(message); StackTraceElement[] stackTrace = new StackTraceElement[frames.length]; diff --git a/buffer-api/src/main/java/io/netty/buffer/api/unsafe/UnsafeBuffer.java b/buffer-api/src/main/java/io/netty/buffer/api/unsafe/UnsafeBuffer.java index 8f875f0..d970478 100644 --- a/buffer-api/src/main/java/io/netty/buffer/api/unsafe/UnsafeBuffer.java +++ b/buffer-api/src/main/java/io/netty/buffer/api/unsafe/UnsafeBuffer.java @@ -59,7 +59,7 @@ class UnsafeBuffer extends ResourceSupport implements Buff UnsafeBuffer(UnsafeMemory memory, long offset, int size, AllocatorControl allocatorControl, Drop drop) { - super(new MakeInaccisbleOnDrop(ArcDrop.wrap(drop))); + super(new MakeInaccessibleOnDrop(ArcDrop.wrap(drop))); this.memory = memory; base = memory.base; baseOffset = offset; @@ -71,7 +71,7 @@ class UnsafeBuffer extends ResourceSupport implements Buff } UnsafeBuffer(UnsafeBuffer parent) { - super(new MakeInaccisbleOnDrop(new ArcDrop<>(ArcDrop.acquire(parent.unsafeGetDrop())))); + super(new MakeInaccessibleOnDrop(new ArcDrop<>(ArcDrop.acquire(parent.unsafeGetDrop())))); control = parent.control; memory = parent.memory; base = parent.base; @@ -1254,19 +1254,19 @@ class UnsafeBuffer extends ResourceSupport implements Buff @Override protected Drop unsafeGetDrop() { - MakeInaccisbleOnDrop drop = (MakeInaccisbleOnDrop) super.unsafeGetDrop(); + MakeInaccessibleOnDrop drop = (MakeInaccessibleOnDrop) super.unsafeGetDrop(); return drop.delegate; } @Override protected void unsafeSetDrop(Drop replacement) { - super.unsafeSetDrop(new MakeInaccisbleOnDrop(replacement)); + super.unsafeSetDrop(new MakeInaccessibleOnDrop(replacement)); } - private static final class MakeInaccisbleOnDrop implements Drop { + private static final class MakeInaccessibleOnDrop implements Drop { final Drop delegate; - private MakeInaccisbleOnDrop(Drop delegate) { + private MakeInaccessibleOnDrop(Drop delegate) { this.delegate = delegate; } @@ -1286,7 +1286,7 @@ class UnsafeBuffer extends ResourceSupport implements Buff @Override public String toString() { - return "UnsafeDrop(" + delegate + ')'; + return "MakeInaccessibleOnDrop(" + delegate + ')'; } } diff --git a/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferCompositionTest.java b/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferCompositionTest.java index f4ded93..5d396fe 100644 --- a/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferCompositionTest.java +++ b/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferCompositionTest.java @@ -550,7 +550,7 @@ public class BufferCompositionTest extends BufferTestSupport { } @Test - public void splitComponentsCeilMustGiveBufferWithFirstComponenForOffsetInFirstComponent() { + public void splitComponentsCeilMustGiveBufferWithFirstComponentForOffsetInFirstComponent() { try (BufferAllocator allocator = BufferAllocator.heap(); CompositeBuffer composite = CompositeBuffer.compose(allocator, allocator.allocate(8).send(), diff --git a/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferPrimitiveRelativeAccessorsTest.java b/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferPrimitiveRelativeAccessorsTest.java index 1b7c349..b950a5f 100644 --- a/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferPrimitiveRelativeAccessorsTest.java +++ b/buffer-tests/src/test/java/io/netty/buffer/api/tests/BufferPrimitiveRelativeAccessorsTest.java @@ -1194,7 +1194,7 @@ public class BufferPrimitiveRelativeAccessorsTest extends BufferTestSupport { @ParameterizedTest @MethodSource("allocators") - void relativeReadOfDoubleReadOnllyMustBoundsCheckWhenReadOffsetAndSizeIsBeyondWriteOffset(Fixture fixture) { + void relativeReadOfDoubleReadOnlyMustBoundsCheckWhenReadOffsetAndSizeIsBeyondWriteOffset(Fixture fixture) { try (BufferAllocator allocator = fixture.createAllocator(); Buffer buf = allocator.allocate(8)) { assertEquals(0, buf.readableBytes()); diff --git a/buffer-tests/src/test/java/io/netty/buffer/api/tests/adaptor/AbstractByteBufTest.java b/buffer-tests/src/test/java/io/netty/buffer/api/tests/adaptor/AbstractByteBufTest.java index a6b58cd..cd5083d 100644 --- a/buffer-tests/src/test/java/io/netty/buffer/api/tests/adaptor/AbstractByteBufTest.java +++ b/buffer-tests/src/test/java/io/netty/buffer/api/tests/adaptor/AbstractByteBufTest.java @@ -2119,7 +2119,7 @@ public abstract class AbstractByteBufTest { public void testSWARIndexOf() { ByteBuf buffer = newBuffer(16); buffer.clear(); - // Ensure the buffer is completely zero'ed. + // Ensure the buffer is completely zeroed. buffer.setZero(0, buffer.capacity()); buffer.writeByte((byte) 0); // 0 buffer.writeByte((byte) 0); @@ -2148,7 +2148,7 @@ public abstract class AbstractByteBufTest { @Test public void testIndexOf() { buffer.clear(); - // Ensure the buffer is completely zero'ed. + // Ensure the buffer is completely zeroed. buffer.setZero(0, buffer.capacity()); buffer.writeByte((byte) 1);