Rename package from io.netty to io.netty5

This commit is contained in:
Andrea Cavalli 2021-09-04 01:58:45 +02:00
parent 73fd9c9392
commit 70f4906902
286 changed files with 1033 additions and 1474 deletions

View File

@ -33,32 +33,32 @@ Netty can be used in modular JDK9+ applications as a collection of automatic mod
reverse-DNS style, and are derived from subproject names rather than root packages due to historical reasons. They
are listed below:
* `io.netty.all`
* `io.netty.buffer`
* `io.netty.codec`
* `io.netty.codec.dns`
* `io.netty.codec.haproxy`
* `io.netty.codec.http`
* `io.netty.codec.http2`
* `io.netty.codec.memcache`
* `io.netty.codec.mqtt`
* `io.netty.codec.redis`
* `io.netty.codec.smtp`
* `io.netty.codec.socks`
* `io.netty.codec.stomp`
* `io.netty.codec.xml`
* `io.netty.common`
* `io.netty.handler`
* `io.netty.handler.proxy`
* `io.netty.resolver`
* `io.netty.resolver.dns`
* `io.netty.transport`
* `io.netty.transport.epoll` (`native` omitted - reserved keyword in Java)
* `io.netty.transport.kqueue` (`native` omitted - reserved keyword in Java)
* `io.netty.transport.unix.common` (`native` omitted - reserved keyword in Java)
* `io.netty.transport.rxtx`
* `io.netty.transport.sctp`
* `io.netty.transport.udt`
* `io.netty5.all`
* `io.netty5.buffer`
* `io.netty5.codec`
* `io.netty5.codec.dns`
* `io.netty5.codec.haproxy`
* `io.netty5.codec.http`
* `io.netty5.codec.http2`
* `io.netty5.codec.memcache`
* `io.netty5.codec.mqtt`
* `io.netty5.codec.redis`
* `io.netty5.codec.smtp`
* `io.netty5.codec.socks`
* `io.netty5.codec.stomp`
* `io.netty5.codec.xml`
* `io.netty5.common`
* `io.netty5.handler`
* `io.netty5.handler.proxy`
* `io.netty5.resolver`
* `io.netty5.resolver.dns`
* `io.netty5.transport`
* `io.netty5.transport.epoll` (`native` omitted - reserved keyword in Java)
* `io.netty5.transport.kqueue` (`native` omitted - reserved keyword in Java)
* `io.netty5.transport.unix.common` (`native` omitted - reserved keyword in Java)
* `io.netty5.transport.rxtx`
* `io.netty5.transport.sctp`
* `io.netty5.transport.udt`

View File

@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-parent</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</parent>
@ -37,7 +37,7 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
@ -156,7 +156,7 @@
</goals>
<configuration>
<classifier>sources</classifier>
<includes>io/netty/**</includes>
<includes>io/netty5/**</includes>
<includeScope>runtime</includeScope>
<includeGroupIds>${project.groupId}</includeGroupIds>
<outputDirectory>${generatedSourceDir}</outputDirectory>
@ -171,8 +171,8 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludes>io/netty/internal/tcnative/**,io/netty/example/**,META-INF/native/libnetty_tcnative*,META-INF/native/include/**,META-INF/native/**/*.a</excludes>
<includes>io/netty/**,META-INF/native/**,META-INF/native-image/**</includes>
<excludes>io/netty5/internal/tcnative/**,io/netty5/example/**,META-INF/native/libnetty_tcnative*,META-INF/native/include/**,META-INF/native/**/*.a</excludes>
<includes>io/netty5/**,META-INF/native/**,META-INF/native-image/**</includes>
<includeScope>runtime</includeScope>
<includeGroupIds>${project.groupId}</includeGroupIds>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
@ -285,7 +285,7 @@
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Automatic-Module-Name>io.netty.all</Automatic-Module-Name>
<Automatic-Module-Name>io.netty5.all</Automatic-Module-Name>
</manifestEntries>
<index>true</index>
</archive>

View File

@ -16,14 +16,15 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<relativePath />
</parent>
<distributionManagement>
<repository>
<id>mchv-snapshot</id>
<name>MCHV Apache Snapshot Maven Packages Distribution</name>
<url>https://mvn.mchv.eu/repository/mchv-snapshot</url>
</repository>
</distributionManagement>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-bom</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<packaging>pom</packaging>
@ -67,22 +68,22 @@
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-buffer</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-common</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-dev-tools</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-all</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>

View File

@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<groupId>io.netty5</groupId>
<artifactId>netty-parent</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</parent>

View File

@ -15,6 +15,10 @@
*/
package io.netty5.buffer;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
import io.netty5.util.AsciiString;
import io.netty5.util.ByteProcessor;
import io.netty5.util.CharsetUtil;
@ -25,7 +29,6 @@ import io.netty5.util.internal.StringUtil;
import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -36,10 +39,6 @@ import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import java.nio.charset.Charset;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
/**
* A skeletal implementation of a buffer.
*/

View File

@ -17,7 +17,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.ObjectPool.Handle;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

View File

@ -16,9 +16,8 @@
package io.netty5.buffer;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import io.netty5.util.internal.ReferenceCountUpdater;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
/**
* Abstract base class for {@link ByteBuf} implementations that count references.

View File

@ -15,8 +15,9 @@
*/
package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import io.netty5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -27,8 +28,6 @@ import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import java.nio.charset.Charset;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
abstract class AbstractUnpooledSlicedByteBuf extends AbstractDerivedByteBuf {
private final ByteBuf buffer;
private final int adjustment;

View File

@ -15,12 +15,11 @@
*/
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteOrder;
import static io.netty5.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteOrder;
/**
* Special {@link SwappedByteBuf} for {@link ByteBuf}s that is using unsafe.
*/

View File

@ -22,7 +22,6 @@ import io.netty5.util.ResourceLeakTracker;
import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -18,7 +18,6 @@ package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import io.netty5.util.ResourceLeakTracker;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -17,7 +17,6 @@ package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import io.netty5.util.ReferenceCounted;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -15,12 +15,11 @@
*/
package io.netty5.buffer;
import static java.util.Objects.requireNonNull;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
import io.netty5.util.ReferenceCounted;
import io.netty5.util.internal.StringUtil;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.EOFException;

View File

@ -18,7 +18,6 @@ package io.netty5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty5.util.CharsetUtil;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@ -15,6 +15,12 @@
*/
package io.netty5.buffer;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.netty5.util.internal.StringUtil.NEWLINE;
import static io.netty5.util.internal.StringUtil.isSurrogate;
import static java.util.Objects.requireNonNull;
import io.netty5.util.AsciiString;
import io.netty5.util.ByteProcessor;
import io.netty5.util.CharsetUtil;
@ -28,7 +34,6 @@ import io.netty5.util.internal.StringUtil;
import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
@ -43,12 +48,6 @@ import java.nio.charset.CodingErrorAction;
import java.util.Arrays;
import java.util.Locale;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.netty5.util.internal.StringUtil.NEWLINE;
import static io.netty5.util.internal.StringUtil.isSurrogate;
import static java.util.Objects.requireNonNull;
/**
* A collection of utility methods that is related with handling {@link ByteBuf},
* such as the generation of hex dump and swapping an integer's byte order.

View File

@ -22,7 +22,6 @@ import io.netty5.util.IllegalReferenceCountException;
import io.netty5.util.ReferenceCountUtil;
import io.netty5.util.internal.EmptyArrays;
import io.netty5.util.internal.RecyclableArrayList;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -23,7 +23,6 @@ import io.netty5.util.ByteProcessor;
import io.netty5.util.internal.EmptyArrays;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.StringUtil;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;

View File

@ -17,7 +17,6 @@ package io.netty5.buffer;
import io.netty5.util.internal.EmptyArrays;
import io.netty5.util.internal.RecyclableArrayList;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,9 +16,10 @@
package io.netty5.buffer;
import static java.lang.Math.max;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.StringUtil;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
@ -26,8 +27,6 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.LongAdder;
import static java.lang.Math.max;
abstract class PoolArena<T> extends SizeClasses implements PoolArenaMetric {
static final boolean HAS_UNSAFE = PlatformDependent.hasUnsafe();

View File

@ -17,7 +17,6 @@ package io.netty5.buffer;
import io.netty5.util.internal.LongLongHashMap;
import io.netty5.util.internal.LongPriorityQueue;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
import java.util.Deque;

View File

@ -16,17 +16,16 @@
package io.netty5.buffer;
import io.netty5.util.internal.StringUtil;
import static java.lang.Math.max;
import static java.lang.Math.min;
import io.netty5.util.internal.StringUtil;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static java.lang.Math.*;
import java.nio.ByteBuffer;
final class PoolChunkList<T> implements PoolChunkListMetric {
private static final Iterator<PoolChunkMetric> EMPTY_METRICS = Collections.<PoolChunkMetric>emptyList().iterator();
private final PoolArena<T> arena;

View File

@ -16,10 +16,10 @@
package io.netty5.buffer;
import static io.netty5.buffer.PoolChunk.IS_SUBPAGE_SHIFT;
import static io.netty5.buffer.PoolChunk.IS_USED_SHIFT;
import static io.netty5.buffer.PoolChunk.RUN_OFFSET_SHIFT;
import static io.netty5.buffer.PoolChunk.SIZE_SHIFT;
import static io.netty5.buffer.PoolChunk.IS_USED_SHIFT;
import static io.netty5.buffer.PoolChunk.IS_SUBPAGE_SHIFT;
final class PoolSubpage<T> implements PoolSubpageMetric {

View File

@ -26,7 +26,6 @@ import io.netty5.util.internal.ObjectPool.Handle;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

View File

@ -17,7 +17,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

View File

@ -28,7 +28,6 @@ import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.ThreadExecutorMap;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.StringUtil;
import java.util.List;
/**

View File

@ -18,7 +18,6 @@ package io.netty5.buffer;
import io.netty5.util.internal.ObjectPool;
import io.netty5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -19,7 +19,6 @@ package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import io.netty5.util.internal.ObjectPool;
import io.netty5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -17,7 +17,6 @@ package io.netty5.buffer;
import io.netty5.util.internal.ObjectPool;
import io.netty5.util.internal.ObjectPool.Handle;
import io.netty5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,10 +16,11 @@
package io.netty5.buffer;
import static io.netty5.buffer.AbstractUnpooledSlicedByteBuf.checkSliceOutOfBounds;
import io.netty5.util.ByteProcessor;
import io.netty5.util.internal.ObjectPool;
import io.netty5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -28,8 +29,6 @@ import java.nio.channels.FileChannel;
import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import static io.netty5.buffer.AbstractUnpooledSlicedByteBuf.checkSliceOutOfBounds;
final class PooledSlicedByteBuf extends AbstractPooledDerivedByteBuf {
private static final ObjectPool<PooledSlicedByteBuf> RECYCLER = ObjectPool.newPool(PooledSlicedByteBuf::new);

View File

@ -19,7 +19,6 @@ package io.netty5.buffer;
import io.netty5.util.internal.ObjectPool;
import io.netty5.util.internal.ObjectPool.Handle;
import io.netty5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.StringUtil;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -18,9 +18,8 @@ package io.netty5.buffer;
import static java.util.Objects.requireNonNull;
import java.nio.ByteBuffer;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;
/**

View File

@ -20,7 +20,6 @@ import static java.util.Objects.requireNonNull;
import io.netty5.util.ResourceLeakDetector;
import io.netty5.util.ResourceLeakTracker;
import java.nio.ByteOrder;
class SimpleLeakAwareByteBuf extends WrappedByteBuf {

View File

@ -18,7 +18,6 @@ package io.netty5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty5.util.ResourceLeakTracker;
import java.nio.ByteOrder;
class SimpleLeakAwareCompositeByteBuf extends WrappedCompositeByteBuf {

View File

@ -15,7 +15,7 @@
*/
package io.netty5.buffer;
import static io.netty5.buffer.PoolThreadCache.*;
import static io.netty5.buffer.PoolThreadCache.log2;
/**
* SizeClasses requires {@code pageShifts} to be defined prior to inclusion,

View File

@ -18,7 +18,6 @@ package io.netty5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -20,7 +20,6 @@ import static java.util.Objects.requireNonNull;
import io.netty5.buffer.CompositeByteBuf.ByteWrapper;
import io.netty5.util.CharsetUtil;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.CharBuffer;
@ -36,7 +35,7 @@ import java.util.Arrays;
* This classes is intended to be used with Java 5 static import statement:
*
* <pre>
* import static io.netty.buffer.{@link Unpooled}.*;
* import static io.netty5.buffer.{@link Unpooled}.*;
*
* {@link ByteBuf} heapBuffer = buffer(128);
* {@link ByteBuf} directBuffer = directBuffer(256);

View File

@ -17,7 +17,6 @@ package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.StringUtil;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.LongAdder;

View File

@ -19,7 +19,6 @@ import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
import io.netty5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -19,7 +19,6 @@ import static java.util.Objects.requireNonNull;
import io.netty5.util.internal.EmptyArrays;
import io.netty5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;
class UnpooledUnsafeNoCleanerDirectByteBuf extends UnpooledUnsafeDirectByteBuf {

View File

@ -15,8 +15,11 @@
*/
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import static io.netty5.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
import static java.util.Objects.requireNonNull;
import io.netty5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -24,10 +27,6 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException;
import static io.netty5.util.internal.MathUtil.isOutOfBounds;
import static io.netty5.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
import static java.util.Objects.requireNonNull;
/**
* All operations get and set as {@link ByteOrder#BIG_ENDIAN}.
*/

View File

@ -20,7 +20,6 @@ import static java.util.Objects.requireNonNull;
import io.netty5.util.ByteProcessor;
import io.netty5.util.internal.StringUtil;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;
final class WrappedUnpooledUnsafeDirectByteBuf extends UnpooledUnsafeDirectByteBuf {

View File

@ -16,7 +16,6 @@
package io.netty5.buffer.api;
import io.netty5.buffer.api.pool.PooledBufferAllocator;
import java.util.function.Supplier;
/**

View File

@ -15,14 +15,13 @@
*/
package io.netty5.buffer.api;
import static java.lang.invoke.MethodHandles.lookup;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.api.internal.Statics;
import java.lang.invoke.VarHandle;
import java.util.Objects;
import static java.lang.invoke.MethodHandles.lookup;
/**
* The {@link BufferHolder} is an abstract class that simplifies the implementation of objects that themselves contain
* a {@link Buffer} instance.

View File

@ -15,9 +15,12 @@
*/
package io.netty5.buffer.api;
import static io.netty5.buffer.api.internal.Statics.bufferIsClosed;
import static io.netty5.buffer.api.internal.Statics.bufferIsReadOnly;
import static java.lang.Math.addExact;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.api.internal.Statics;
import java.nio.ByteBuffer;
import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
@ -27,10 +30,6 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Stream;
import static io.netty5.buffer.api.internal.Statics.bufferIsClosed;
import static io.netty5.buffer.api.internal.Statics.bufferIsReadOnly;
import static java.lang.Math.addExact;
/**
* The {@code CompositeBuffer} is a concrete {@link Buffer} implementation that make a number of other buffers appear
* as one. A composite buffer behaves the same as a normal, non-composite buffer in every way, so you normally don't

View File

@ -14,14 +14,6 @@
*/
package io.netty5.buffer.api;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.util.Locale;
import java.util.function.Supplier;
import static io.netty5.buffer.api.BufferAllocator.offHeapPooled;
import static io.netty5.buffer.api.BufferAllocator.offHeapUnpooled;
import static io.netty5.buffer.api.BufferAllocator.onHeapPooled;
@ -30,6 +22,13 @@ import static io.netty5.util.internal.ObjectUtil.checkNotNullWithIAE;
import static io.netty5.util.internal.PlatformDependent.directBufferPreferred;
import static java.lang.Runtime.getRuntime;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.util.Locale;
import java.util.function.Supplier;
/**
* A {@link BufferAllocator} which is {@link #close() disposed} when the {@link Runtime} is shutdown.
*/

View File

@ -15,13 +15,12 @@
*/
package io.netty5.buffer.api;
import io.netty5.buffer.api.internal.Statics;
import java.util.function.Supplier;
import static io.netty5.buffer.api.internal.Statics.NO_OP_DROP;
import static io.netty5.buffer.api.internal.Statics.allocatorClosedException;
import io.netty5.buffer.api.internal.Statics;
import java.util.function.Supplier;
class ManagedBufferAllocator implements BufferAllocator, AllocatorControl {
private final MemoryManager manager;
private final AllocationType allocationType;

View File

@ -20,7 +20,6 @@ import io.netty5.buffer.api.internal.MemoryManagerOverride;
import io.netty5.util.internal.UnstableApi;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.lang.ref.Cleaner;
import java.util.Optional;
import java.util.ServiceConfigurationError;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer.api;
import io.netty5.buffer.api.internal.SendFromSupplier;
import java.util.function.Function;
import java.util.function.Supplier;

View File

@ -15,9 +15,9 @@
*/
package io.netty5.buffer.api.adaptor;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufConvertible;
import io.netty5.util.ReferenceCounted;
import io.netty5.buffer.ByteBuf;
/**
* Interfaces that are required for an object to stand-in for a {@link ByteBuf} in Netty.

View File

@ -29,7 +29,6 @@ import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.ByteProcessor;
import io.netty5.util.IllegalReferenceCountException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -15,6 +15,8 @@
*/
package io.netty5.buffer.api.adaptor;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufAllocator;
import io.netty5.buffer.CompositeByteBuf;
@ -22,9 +24,6 @@ import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.internal.AdaptableBuffer;
import io.netty5.util.internal.PlatformDependent;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import java.util.Objects;
public class ByteBufAllocatorAdaptor implements ByteBufAllocator, AutoCloseable {

View File

@ -22,7 +22,6 @@ import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.api.StandardAllocationTypes;
import io.netty5.buffer.api.internal.Statics;
import java.lang.ref.Cleaner;
import java.nio.ByteBuffer;

View File

@ -30,7 +30,6 @@ import io.netty5.buffer.api.internal.AdaptableBuffer;
import io.netty5.buffer.api.internal.ArcDrop;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer.api.internal;
import io.netty5.buffer.api.Drop;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer.api.internal;
import io.netty5.buffer.api.Drop;
import java.lang.ref.Cleaner;
import java.util.concurrent.atomic.AtomicReference;

View File

@ -18,7 +18,6 @@ package io.netty5.buffer.api.internal;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.Resource;
import java.util.ArrayDeque;
import java.util.Set;
import java.util.function.Function;

View File

@ -16,7 +16,6 @@
package io.netty5.buffer.api.internal;
import io.netty5.buffer.api.MemoryManager;
import java.util.ServiceLoader;
import java.util.ServiceLoader.Provider;
import java.util.stream.Stream;

View File

@ -19,7 +19,6 @@ import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.api.bytebuffer.ByteBufferMemoryManager;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Map;

View File

@ -19,7 +19,6 @@ import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.Resource;
import io.netty5.buffer.api.Send;
import java.util.Objects;
/**

View File

@ -15,16 +15,15 @@
*/
package io.netty5.buffer.api.internal;
import static io.netty5.buffer.api.internal.Statics.findVarHandle;
import static java.lang.invoke.MethodHandles.lookup;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.Resource;
import io.netty5.buffer.api.Send;
import java.lang.invoke.VarHandle;
import static io.netty5.buffer.api.internal.Statics.findVarHandle;
import static java.lang.invoke.MethodHandles.lookup;
public class SendFromOwned<I extends Resource<I>, T extends ResourceSupport<I, T>> implements Send<I> {
private static final VarHandle RECEIVED = findVarHandle(lookup(), SendFromOwned.class, "received", boolean.class);
private final Owned<T> outgoing;

View File

@ -15,16 +15,15 @@
*/
package io.netty5.buffer.api.internal;
import static io.netty5.buffer.api.internal.Statics.findVarHandle;
import static java.lang.invoke.MethodHandles.lookup;
import io.netty5.buffer.api.Resource;
import io.netty5.buffer.api.Send;
import java.lang.invoke.VarHandle;
import java.util.Objects;
import java.util.function.Supplier;
import static io.netty5.buffer.api.internal.Statics.findVarHandle;
import static java.lang.invoke.MethodHandles.lookup;
public class SendFromSupplier<T extends Resource<T>> implements Send<T> {
private static final VarHandle GATE = findVarHandle(lookup(), SendFromSupplier.class, "gate", boolean.class);
private final Class<T> concreteObjectType;

View File

@ -19,7 +19,6 @@ import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferClosedException;
import io.netty5.buffer.api.BufferReadOnlyException;
import io.netty5.buffer.api.Drop;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;

View File

@ -15,12 +15,14 @@
*/
package io.netty5.buffer.api.pool;
import static io.netty5.buffer.api.pool.PoolChunk.isSubpage;
import static java.lang.Math.max;
import io.netty5.buffer.api.AllocationType;
import io.netty5.buffer.api.AllocatorControl;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.MemoryManager;
import io.netty5.util.internal.StringUtil;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.ArrayList;
@ -28,9 +30,6 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.LongAdder;
import static io.netty5.buffer.api.pool.PoolChunk.isSubpage;
import static java.lang.Math.max;
class PoolArena extends SizeClasses implements PoolArenaMetric, AllocatorControl {
private static final VarHandle SUBPAGE_ARRAY = MethodHandles.arrayElementVarHandle(PoolSubpage[].class);
enum SizeClass {

View File

@ -15,16 +15,15 @@
*/
package io.netty5.buffer.api.pool;
import io.netty5.buffer.api.internal.CleanerDrop;
import io.netty5.buffer.api.AllocatorControl.UntetheredMemory;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.api.internal.ArcDrop;
import io.netty5.buffer.api.internal.CleanerDrop;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.internal.LongLongHashMap;
import io.netty5.util.internal.LongPriorityQueue;
import java.util.PriorityQueue;
/**

View File

@ -15,17 +15,16 @@
*/
package io.netty5.buffer.api.pool;
import static java.lang.Math.max;
import static java.lang.Math.min;
import io.netty5.buffer.api.AllocatorControl.UntetheredMemory;
import io.netty5.util.internal.StringUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static java.lang.Math.max;
import static java.lang.Math.min;
final class PoolChunkList implements PoolChunkListMetric {
private static final Iterator<PoolChunkMetric> EMPTY_METRICS = Collections.emptyIterator();
private final PoolArena arena;

View File

@ -15,6 +15,8 @@
*/
package io.netty5.buffer.api.pool;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import io.netty5.buffer.api.AllocatorControl.UntetheredMemory;
import io.netty5.buffer.api.pool.PoolArena.SizeClass;
import io.netty5.util.internal.MathUtil;
@ -23,13 +25,10 @@ import io.netty5.util.internal.ObjectPool.Handle;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
/**
* Acts a Thread cache for allocations. This implementation is modelled after
* <a href="https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf">jemalloc</a> and the described

View File

@ -15,6 +15,9 @@
*/
package io.netty5.buffer.api.pool;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
import io.netty5.buffer.api.AllocationType;
import io.netty5.buffer.api.AllocatorControl.UntetheredMemory;
import io.netty5.buffer.api.Buffer;
@ -32,16 +35,12 @@ import io.netty5.util.internal.SystemPropertyUtil;
import io.netty5.util.internal.ThreadExecutorMap;
import io.netty5.util.internal.logging.InternalLogger;
import io.netty5.util.internal.logging.InternalLoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import static io.netty5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
public class PooledBufferAllocator implements BufferAllocator, BufferAllocatorMetricProvider {
private static final InternalLogger logger = InternalLoggerFactory.getInstance(PooledBufferAllocator.class);

View File

@ -16,7 +16,6 @@
package io.netty5.buffer.api.pool;
import io.netty5.util.internal.StringUtil;
import java.util.List;
/**

View File

@ -16,11 +16,11 @@
package io.netty5.buffer.api.pool;
import io.netty5.buffer.api.AllocationType;
import io.netty5.buffer.api.AllocatorControl.UntetheredMemory;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.buffer.api.AllocatorControl.UntetheredMemory;
@SuppressWarnings("unchecked")
class UnpooledUnthetheredMemory implements UntetheredMemory {

View File

@ -29,7 +29,6 @@ import io.netty5.buffer.api.internal.AdaptableBuffer;
import io.netty5.buffer.api.internal.ArcDrop;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.internal.PlatformDependent;
import java.lang.ref.Reference;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

View File

@ -19,7 +19,6 @@ import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.internal.PlatformDependent;
import java.lang.ref.Cleaner;
public class UnsafeCleanerDrop implements Drop<Buffer> {

View File

@ -23,7 +23,6 @@ import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.api.StandardAllocationTypes;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.internal.PlatformDependent;
import java.lang.ref.Cleaner;
public class UnsafeMemoryManager implements MemoryManager {

View File

@ -16,7 +16,6 @@ package io.netty5.buffer.search;
import io.netty5.util.ByteProcessor;
import io.netty5.util.internal.PlatformDependent;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -12,4 +12,4 @@
# License for the specific language governing permissions and limitations
# under the License.
Args = --initialize-at-run-time=io.netty.buffer.PooledByteBufAllocator,io.netty.buffer.ByteBufAllocator,io.netty.buffer.ByteBufUtil,io.netty.buffer.AbstractReferenceCountedByteBuf
Args = --initialize-at-run-time=io.netty5.buffer.PooledByteBufAllocator,io.netty5.buffer.ByteBufAllocator,io.netty5.buffer.ByteBufUtil,io.netty5.buffer.AbstractReferenceCountedByteBuf

View File

@ -13,24 +13,15 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.buffer.AbstractByteBufAllocator;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufAllocatorMetric;
import io.netty5.buffer.ByteBufAllocatorMetricProvider;
import io.netty5.buffer.SimpleLeakAwareByteBuf;
import io.netty5.buffer.UnpooledDirectByteBuf;
import io.netty5.buffer.UnpooledHeapByteBuf;
import io.netty5.buffer.UnpooledUnsafeDirectByteBuf;
import io.netty5.buffer.UnpooledUnsafeHeapByteBuf;
import org.junit.jupiter.api.Test;
package io.netty5.buffer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import io.netty5.util.internal.PlatformDependent;
import org.junit.jupiter.api.Test;
public abstract class AbstractByteBufAllocatorTest<T extends AbstractByteBufAllocator> extends ByteBufAllocatorTest {
@Override

View File

@ -13,19 +13,32 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import static io.netty5.buffer.Unpooled.LITTLE_ENDIAN;
import static io.netty5.buffer.Unpooled.buffer;
import static io.netty5.buffer.Unpooled.copiedBuffer;
import static io.netty5.buffer.Unpooled.directBuffer;
import static io.netty5.buffer.Unpooled.unreleasableBuffer;
import static io.netty5.buffer.Unpooled.wrappedBuffer;
import static io.netty5.util.internal.EmptyArrays.EMPTY_BYTES;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import io.netty5.util.ByteProcessor;
import io.netty5.util.CharsetUtil;
import io.netty5.util.IllegalReferenceCountException;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufUtil;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -53,26 +66,10 @@ import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import static io.netty5.buffer.Unpooled.LITTLE_ENDIAN;
import static io.netty5.buffer.Unpooled.buffer;
import static io.netty5.buffer.Unpooled.copiedBuffer;
import static io.netty5.buffer.Unpooled.directBuffer;
import static io.netty5.buffer.Unpooled.unreleasableBuffer;
import static io.netty5.buffer.Unpooled.wrappedBuffer;
import static io.netty5.util.internal.EmptyArrays.EMPTY_BYTES;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
/**
* An abstract test class for channel buffers

View File

@ -13,31 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.util.ReferenceCountUtil;
import io.netty5.buffer.AbstractDerivedByteBuf;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufAllocator;
import io.netty5.buffer.ByteBufUtil;
import io.netty5.buffer.CompositeByteBuf;
import io.netty5.buffer.PooledByteBufAllocator;
import io.netty5.buffer.Unpooled;
import io.netty5.buffer.UnpooledByteBufAllocator;
import io.netty5.buffer.WrappedCompositeByteBuf;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.concurrent.ThreadLocalRandom;
package io.netty5.buffer;
import static io.netty5.buffer.Unpooled.EMPTY_BUFFER;
import static io.netty5.buffer.Unpooled.buffer;
@ -58,6 +34,20 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import io.netty5.util.ReferenceCountUtil;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.concurrent.ThreadLocalRandom;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
/**
* An abstract test class for composite channel buffers
*/

View File

@ -13,11 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.PooledByteBuf;
import org.junit.jupiter.api.Test;
package io.netty5.buffer;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@ -27,6 +23,8 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
public abstract class AbstractPooledByteBufTest extends AbstractByteBufTest {
protected abstract ByteBuf alloc(int length, int maxCapacity);

View File

@ -13,14 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import io.netty5.util.IllegalReferenceCountException;
import io.netty5.buffer.AbstractReferenceCountedByteBuf;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufAllocator;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -29,11 +29,7 @@ import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.Test;
public class AbstractReferenceCountedByteBufTest {

View File

@ -13,19 +13,15 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import static io.netty5.buffer.Unpooled.*;
import static io.netty5.buffer.Unpooled.compositeBuffer;
import static io.netty5.buffer.Unpooled.wrappedBuffer;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import io.netty5.buffer.AdvancedLeakAwareByteBuf;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.CompositeByteBuf;
import io.netty5.buffer.SimpleLeakAwareByteBuf;
import org.junit.jupiter.api.Test;
import io.netty5.util.CharsetUtil;
import io.netty5.util.ResourceLeakTracker;
import org.junit.jupiter.api.Test;
public class AdvancedLeakAwareByteBufTest extends SimpleLeakAwareByteBufTest {

View File

@ -13,14 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import io.netty5.util.ResourceLeakTracker;
import io.netty5.buffer.AdvancedLeakAwareByteBuf;
import io.netty5.buffer.AdvancedLeakAwareCompositeByteBuf;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.CompositeByteBuf;
import io.netty5.buffer.SimpleLeakAwareCompositeByteBuf;
public class AdvancedLeakAwareCompositeByteBufTest extends SimpleLeakAwareCompositeByteBufTest {

View File

@ -13,9 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.buffer.PooledByteBufAllocator;
package io.netty5.buffer;
public class AlignedPooledByteBufAllocatorTest extends PooledByteBufAllocatorTest {
@Override

View File

@ -13,9 +13,8 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import io.netty5.buffer.Unpooled;
import org.junit.jupiter.api.Test;
/**

View File

@ -13,17 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.UnpooledByteBufAllocator;
import io.netty5.buffer.UnpooledDirectByteBuf;
import java.nio.ByteOrder;
import org.junit.jupiter.api.Test;
/**

View File

@ -13,17 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.Unpooled;
import io.netty5.buffer.UnpooledByteBufAllocator;
import io.netty5.buffer.UnpooledHeapByteBuf;
import org.junit.jupiter.api.Test;
package io.netty5.buffer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
/**
* Tests big-endian heap channel buffers
*/

View File

@ -13,13 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.UnpooledByteBufAllocator;
import io.netty5.buffer.UnpooledUnsafeDirectByteBuf;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeEach;

View File

@ -13,12 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import io.netty5.util.internal.PlatformDependent;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.UnpooledByteBufAllocator;
import io.netty5.buffer.UnpooledUnsafeNoCleanerDirectByteBuf;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeEach;

View File

@ -13,15 +13,12 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufAllocator;
import io.netty5.buffer.CompositeByteBuf;
import org.junit.jupiter.api.Test;
package io.netty5.buffer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public abstract class ByteBufAllocatorTest {
protected abstract int defaultMaxCapacity();

View File

@ -14,21 +14,18 @@
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import io.netty5.buffer.AbstractUnpooledSlicedByteBuf;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.DuplicatedByteBuf;
import io.netty5.buffer.ReadOnlyByteBuf;
import io.netty5.buffer.SwappedByteBuf;
import io.netty5.buffer.Unpooled;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.sameInstance;
import java.nio.ByteOrder;
import java.util.Random;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import org.junit.jupiter.api.Test;
/**
* Tests wrapping a wrapped buffer does not go way too deep chaining.

View File

@ -13,18 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufInputStream;
import io.netty5.buffer.ByteBufOutputStream;
import io.netty5.buffer.Unpooled;
import org.junit.jupiter.api.Test;
import java.io.EOFException;
import java.nio.charset.Charset;
import static io.netty5.util.internal.EmptyArrays.*;
import static io.netty5.util.internal.EmptyArrays.EMPTY_BYTES;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
@ -34,6 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.EOFException;
import java.nio.charset.Charset;
import org.junit.jupiter.api.Test;
/**
* Tests channel buffer streams
*/

View File

@ -13,31 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import io.netty5.util.AsciiString;
import io.netty5.util.CharsetUtil;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufUtil;
import io.netty5.buffer.CompositeByteBuf;
import io.netty5.buffer.PooledByteBufAllocator;
import io.netty5.buffer.SwappedByteBuf;
import io.netty5.buffer.Unpooled;
import io.netty5.buffer.WrappedByteBuf;
import io.netty5.buffer.WrappedCompositeByteBuf;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
package io.netty5.buffer;
import static io.netty5.buffer.Unpooled.unreleasableBuffer;
import static org.hamcrest.MatcherAssert.assertThat;
@ -51,6 +27,21 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import io.netty5.util.AsciiString;
import io.netty5.util.CharsetUtil;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
public class ByteBufUtilTest {
private static final String PARAMETERIZED_NAME = "bufferType = {0}";

View File

@ -14,14 +14,12 @@
* under the License.
*/
package io.netty.buffer;
package io.netty5.buffer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.netty5.util.ByteProcessor;
import io.netty5.util.CharsetUtil;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.Unpooled;
import org.junit.jupiter.api.Test;
public class ByteProcessorTest {

Some files were not shown because too many files have changed in this diff Show More