#3126: Use suppliers instead of reflection for native impl generation.

This commit is contained in:
Janmm14
2021-06-26 00:01:30 +00:00
committed by GitHub
parent a8b2f5268d
commit cb738188de
6 changed files with 17 additions and 16 deletions

View File

@@ -31,7 +31,7 @@ public class EncryptionUtil
public static final KeyPair keys;
@Getter
private static final SecretKey secret = new SecretKeySpec( new byte[ 16 ], "AES" );
public static final NativeCode<BungeeCipher> nativeFactory = new NativeCode<>( "native-cipher", JavaCipher.class, NativeCipher.class );
public static final NativeCode<BungeeCipher> nativeFactory = new NativeCode<>( "native-cipher", JavaCipher::new, NativeCipher::new );
static
{

View File

@@ -8,5 +8,5 @@ import net.md_5.bungee.jni.zlib.NativeZlib;
public class CompressFactory
{
public static final NativeCode<BungeeZlib> zlib = new NativeCode<>( "native-compress", JavaZlib.class, NativeZlib.class );
public static final NativeCode<BungeeZlib> zlib = new NativeCode<>( "native-compress", JavaZlib::new, NativeZlib::new );
}