Convert to Netty 5, sans ByteBuf -> Buffer migration

Since `ByteBuf` is everywhere in the codebase, moving to the `Buffer` interface will be the most difficult part of the migration.

The main causality is the HAProxy support, which seems to have not been pushed up to Maven Central or Sonatype snapshots.
This commit is contained in:
Andrew Steinborn
2022-03-19 18:31:23 -04:00
parent 302b15d3bc
commit 81e302e6d2
110 changed files with 360 additions and 373 deletions

View File

@@ -19,7 +19,7 @@ license {
dependencies {
implementation "com.google.guava:guava:${guavaVersion}"
implementation "io.netty:netty-handler:${nettyVersion}"
implementation "io.netty:netty5-handler:${nettyVersion}"
implementation "org.checkerframework:checker-qual:${checkerFrameworkVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"

View File

@@ -17,7 +17,7 @@
package com.velocitypowered.natives.compression;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
import java.util.zip.DataFormatException;
class CompressorUtils {

View File

@@ -23,7 +23,7 @@ import static com.velocitypowered.natives.compression.CompressorUtils.ZLIB_BUFFE
import static com.velocitypowered.natives.compression.CompressorUtils.ensureMaxSize;
import com.velocitypowered.natives.util.BufferPreference;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
import java.nio.ByteBuffer;
import java.util.zip.DataFormatException;
import java.util.zip.Deflater;

View File

@@ -19,7 +19,7 @@ package com.velocitypowered.natives.compression;
import com.google.common.base.Preconditions;
import com.velocitypowered.natives.util.BufferPreference;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
import java.util.zip.DataFormatException;
public class LibdeflateVelocityCompressor implements VelocityCompressor {

View File

@@ -19,7 +19,7 @@ package com.velocitypowered.natives.compression;
import com.velocitypowered.natives.Disposable;
import com.velocitypowered.natives.Native;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
import java.util.zip.DataFormatException;
/**

View File

@@ -19,7 +19,7 @@ package com.velocitypowered.natives.encryption;
import com.google.common.base.Preconditions;
import com.velocitypowered.natives.util.BufferPreference;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
import java.security.GeneralSecurityException;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;

View File

@@ -19,7 +19,7 @@ package com.velocitypowered.natives.encryption;
import com.google.common.base.Preconditions;
import com.velocitypowered.natives.util.BufferPreference;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
import java.security.GeneralSecurityException;
import javax.crypto.SecretKey;

View File

@@ -19,7 +19,7 @@ package com.velocitypowered.natives.encryption;
import com.velocitypowered.natives.Disposable;
import com.velocitypowered.natives.Native;
import io.netty.buffer.ByteBuf;
import io.netty5.buffer.ByteBuf;
public interface VelocityCipher extends Disposable, Native {
void process(ByteBuf source);

View File

@@ -18,8 +18,8 @@
package com.velocitypowered.natives.util;
import com.velocitypowered.natives.Native;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufAllocator;
public class MoreByteBufUtils {
private MoreByteBufUtils() {

View File

@@ -17,8 +17,8 @@
package com.velocitypowered.natives.util;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.Unpooled;
import java.util.function.BooleanSupplier;
public class NativeConstraints {

View File

@@ -24,9 +24,9 @@ import static org.junit.jupiter.api.condition.OS.LINUX;
import com.velocitypowered.natives.util.BufferPreference;
import com.velocitypowered.natives.util.Natives;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufUtil;
import io.netty5.buffer.Unpooled;
import java.io.IOException;
import java.util.Random;
import java.util.function.Supplier;

View File

@@ -22,9 +22,9 @@ import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.condition.OS.LINUX;
import com.velocitypowered.natives.util.Natives;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty5.buffer.ByteBuf;
import io.netty5.buffer.ByteBufUtil;
import io.netty5.buffer.Unpooled;
import java.security.GeneralSecurityException;
import java.util.Random;
import java.util.function.Supplier;