Add Java 25-ea to GitHub Actions
This commit is contained in:
parent
442ff808f3
commit
68f4f6bd40
4
.github/workflows/maven.yml
vendored
4
.github/workflows/maven.yml
vendored
@ -4,12 +4,12 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
java: [8, 11, 17, 21]
|
java: [8, 11, 17, 21, 25-ea]
|
||||||
|
|
||||||
name: Java ${{ matrix.java }}
|
name: Java ${{ matrix.java }}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package net.md_5.bungee.jni;
|
package net.md_5.bungee.jni;
|
||||||
|
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import io.netty.buffer.Unpooled;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -93,7 +95,31 @@ public final class NativeCode<T>
|
|||||||
return loaded;
|
return loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean hasDirectBuffers()
|
||||||
|
{
|
||||||
|
ByteBuf directBuffer = null;
|
||||||
|
boolean hasMemoryAddress = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
directBuffer = Unpooled.directBuffer();
|
||||||
|
hasMemoryAddress = directBuffer.hasMemoryAddress();
|
||||||
|
} finally
|
||||||
|
{
|
||||||
|
if ( directBuffer != null )
|
||||||
|
{
|
||||||
|
directBuffer.release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasMemoryAddress;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isSupported()
|
public static boolean isSupported()
|
||||||
|
{
|
||||||
|
return isSupportedPlatformAndArch() && hasDirectBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isSupportedPlatformAndArch()
|
||||||
{
|
{
|
||||||
return "Linux".equals( System.getProperty( "os.name" ) ) && ( isAmd64() || isAarch64() );
|
return "Linux".equals( System.getProperty( "os.name" ) ) && ( isAmd64() || isAarch64() );
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,6 @@ import com.google.common.collect.Sets;
|
|||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.buffer.ByteBuf;
|
|
||||||
import io.netty.buffer.Unpooled;
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelException;
|
import io.netty.channel.ChannelException;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
@ -74,6 +72,7 @@ import net.md_5.bungee.compress.CompressFactory;
|
|||||||
import net.md_5.bungee.conf.Configuration;
|
import net.md_5.bungee.conf.Configuration;
|
||||||
import net.md_5.bungee.conf.YamlConfig;
|
import net.md_5.bungee.conf.YamlConfig;
|
||||||
import net.md_5.bungee.forge.ForgeConstants;
|
import net.md_5.bungee.forge.ForgeConstants;
|
||||||
|
import net.md_5.bungee.jni.NativeCode;
|
||||||
import net.md_5.bungee.log.BungeeLogger;
|
import net.md_5.bungee.log.BungeeLogger;
|
||||||
import net.md_5.bungee.log.LoggingForwardHandler;
|
import net.md_5.bungee.log.LoggingForwardHandler;
|
||||||
import net.md_5.bungee.log.LoggingOutputStream;
|
import net.md_5.bungee.log.LoggingOutputStream;
|
||||||
@ -232,32 +231,19 @@ public class BungeeCord extends ProxyServer
|
|||||||
|
|
||||||
if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) )
|
if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) )
|
||||||
{
|
{
|
||||||
ByteBuf directBuffer = null;
|
if ( !NativeCode.hasDirectBuffers() )
|
||||||
boolean hasMemoryAddress = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
directBuffer = Unpooled.directBuffer();
|
|
||||||
hasMemoryAddress = directBuffer.hasMemoryAddress();
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
if ( directBuffer != null )
|
|
||||||
{
|
|
||||||
directBuffer.release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( !hasMemoryAddress )
|
|
||||||
{
|
{
|
||||||
logger.warning( "Memory addresses are not available in direct buffers" );
|
logger.warning( "Memory addresses are not available in direct buffers" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( hasMemoryAddress && EncryptionUtil.nativeFactory.load() )
|
if ( EncryptionUtil.nativeFactory.load() )
|
||||||
{
|
{
|
||||||
logger.info( "Using mbed TLS based native cipher." );
|
logger.info( "Using mbed TLS based native cipher." );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
logger.info( "Using standard Java JCE cipher." );
|
logger.info( "Using standard Java JCE cipher." );
|
||||||
}
|
}
|
||||||
if ( hasMemoryAddress && CompressFactory.zlib.load() )
|
if ( CompressFactory.zlib.load() )
|
||||||
{
|
{
|
||||||
logger.info( "Using zlib based native compressor." );
|
logger.info( "Using zlib based native compressor." );
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user