findStaticVarHandle
This commit is contained in:
@@ -118,6 +118,7 @@ public final class Utility {
|
||||
|
||||
// private static final javax.net.ssl.SSLContext DEFAULTSSL_CONTEXT;
|
||||
// private static final javax.net.ssl.HostnameVerifier defaultVerifier = (s, ss) -> true;
|
||||
//
|
||||
static {
|
||||
System.setProperty("jdk.httpclient.allowRestrictedHeaders", "host");
|
||||
|
||||
@@ -139,8 +140,6 @@ public final class Utility {
|
||||
Function<Supplier, ThreadLocal> virtualThreadLocalFunction0 = null;
|
||||
Function<String, ThreadFactory> virtualThreadFactoryFunction0 = null;
|
||||
|
||||
//if (!NATIVE_IMAGE_ENV) { // not native-image
|
||||
try {
|
||||
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
{ // Jdk21Inners
|
||||
try {
|
||||
@@ -165,9 +164,10 @@ public final class Utility {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
try {
|
||||
{ // String-LATIN1
|
||||
MethodHandles.Lookup lookup = defaultLookup;
|
||||
VarHandle compactHandle = lookup.findVarHandle(String.class, "COMPACT_STRINGS", boolean.class);
|
||||
VarHandle compactHandle = lookup.findStaticVarHandle(String.class, "COMPACT_STRINGS", boolean.class);
|
||||
final boolean compact = (Boolean) compactHandle.get(null);
|
||||
VarHandle coderHandle = lookup.findVarHandle(String.class, "coder", byte.class);
|
||||
VarHandle valueHandle = lookup.findVarHandle(String.class, "value", byte[].class);
|
||||
@@ -192,15 +192,13 @@ public final class Utility {
|
||||
}.loadClass("org.redkale.util.SignalShutDown", classBytes);
|
||||
RedkaleClassLoader.putDynClass(shutdownClazz1.getName(), classBytes, shutdownClazz1);
|
||||
RedkaleClassLoader.putReflectionDeclaredConstructors(shutdownClazz1, shutdownClazz1.getName());
|
||||
signalShutdownConsumer0 =
|
||||
shutdownClazz1.getConstructor().newInstance();
|
||||
signalShutdownConsumer0 = shutdownClazz1.getConstructor().newInstance();
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) { // 不会发生
|
||||
// do nothing
|
||||
e.printStackTrace();
|
||||
}
|
||||
//}
|
||||
strByteFunction = strByteFunction0;
|
||||
strLatin1Function = strLatin1Function0;
|
||||
signalShutdownConsumer = signalShutdownConsumer0;
|
||||
|
||||
Reference in New Issue
Block a user