Small code cleanups
This commit is contained in:
@@ -3,8 +3,6 @@ package com.velocitypowered.natives.encryption;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.velocitypowered.natives.util.BufferPreference;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import java.security.GeneralSecurityException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
|
@@ -3,8 +3,6 @@ package com.velocitypowered.natives.encryption;
|
||||
import com.velocitypowered.natives.Disposable;
|
||||
import com.velocitypowered.natives.Native;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import javax.crypto.ShortBufferException;
|
||||
|
||||
public interface VelocityCipher extends Disposable, Native {
|
||||
void process(ByteBuf source);
|
||||
|
@@ -27,19 +27,14 @@ public class NativeConstraints {
|
||||
|
||||
static final BooleanSupplier NATIVE_BASE = () -> NATIVES_ENABLED && CAN_GET_MEMORYADDRESS;
|
||||
|
||||
static final BooleanSupplier LINUX_X86_64 = () -> {
|
||||
return NATIVE_BASE.getAsBoolean()
|
||||
&& System.getProperty("os.name", "").equalsIgnoreCase("Linux")
|
||||
&& IS_AMD64;
|
||||
};
|
||||
static final BooleanSupplier LINUX_X86_64 = () -> NATIVE_BASE.getAsBoolean()
|
||||
&& System.getProperty("os.name", "").equalsIgnoreCase("Linux")
|
||||
&& IS_AMD64;
|
||||
|
||||
static final BooleanSupplier LINUX_AARCH64 = () -> {
|
||||
return NATIVE_BASE.getAsBoolean()
|
||||
&& System.getProperty("os.name", "").equalsIgnoreCase("Linux")
|
||||
&& IS_AARCH64;
|
||||
};
|
||||
static final BooleanSupplier LINUX_AARCH64 = () -> NATIVE_BASE.getAsBoolean()
|
||||
&& System.getProperty("os.name", "").equalsIgnoreCase("Linux")
|
||||
&& IS_AARCH64;
|
||||
|
||||
static final BooleanSupplier JAVA_11 = () -> {
|
||||
return Double.parseDouble(System.getProperty("java.specification.version")) >= 11;
|
||||
};
|
||||
static final BooleanSupplier JAVA_11 = () -> Double.parseDouble(
|
||||
System.getProperty("java.specification.version")) >= 11;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.condition.JRE;
|
||||
|
||||
class VelocityCompressorTest {
|
||||
|
||||
private static byte[] TEST_DATA = new byte[1 << 14];
|
||||
private static final byte[] TEST_DATA = new byte[1 << 14];
|
||||
|
||||
@BeforeAll
|
||||
static void checkNatives() throws IOException {
|
||||
|
Reference in New Issue
Block a user