#262: Fixed NativeLibrary.load0 signature on JDK 9+ (NoSuchMethodError)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.DatagramChannel;
|
||||
import java.lang.management.ClassLoadingMXBean;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
class LoadLibraryTest {
|
||||
|
||||
@@ -10,16 +8,14 @@ class LoadLibraryTest {
|
||||
Thread.sleep(10);
|
||||
}
|
||||
|
||||
// Late load of libnet.so and libnio.so
|
||||
DatagramChannel ch = DatagramChannel.open();
|
||||
ch.bind(new InetSocketAddress(0));
|
||||
// Late load of libmanagement.so
|
||||
ClassLoadingMXBean bean = ManagementFactory.getClassLoadingMXBean();
|
||||
|
||||
ByteBuffer buf = ByteBuffer.allocateDirect(1000);
|
||||
InetSocketAddress target = new InetSocketAddress(InetAddress.getLoopbackAddress(), 1024);
|
||||
|
||||
while (true) {
|
||||
ch.send(buf, target);
|
||||
buf.clear();
|
||||
long n = 0;
|
||||
while (n >= 0) {
|
||||
n += bean.getLoadedClassCount();
|
||||
n += bean.getTotalLoadedClassCount();
|
||||
n += bean.getUnloadedClassCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user