Small code cleanups

This commit is contained in:
Andrew Steinborn
2020-09-01 03:25:15 -04:00
parent 5a26b4e03d
commit 5d287306c2
31 changed files with 42 additions and 93 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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 {