Utility
This commit is contained in:
@@ -141,8 +141,7 @@ public final class Utility {
|
||||
Function<String, ThreadFactory> virtualThreadFactoryFunction0 = null;
|
||||
|
||||
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
{ // Jdk21Inners
|
||||
try {
|
||||
try { // Jdk21Inners
|
||||
String virtualName = "org.redkale.util.Jdk21Inners";
|
||||
Class virtualClazz = loader.loadClass(virtualName);
|
||||
Method method = virtualClazz.getMethod("createExecutor");
|
||||
@@ -163,9 +162,8 @@ public final class Utility {
|
||||
} catch (Throwable t) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
try {
|
||||
{ // String-LATIN1
|
||||
// String-LATIN1
|
||||
MethodHandles.Lookup lookup = defaultLookup;
|
||||
VarHandle compactHandle = lookup.findStaticVarHandle(String.class, "COMPACT_STRINGS", boolean.class);
|
||||
final boolean compact = (Boolean) compactHandle.get(null);
|
||||
@@ -174,8 +172,8 @@ public final class Utility {
|
||||
// LATIN1:0 UTF16:1
|
||||
strLatin1Function0 = compact ? (String t) -> (Byte) coderHandle.get(t) == 0 : (String t) -> false;
|
||||
strByteFunction0 = (String t) -> (byte[]) valueHandle.get(t);
|
||||
}
|
||||
{ // signalShutdown
|
||||
|
||||
// signalShutdown
|
||||
Class<Consumer<Consumer<String>>> shutdownClazz1 = null;
|
||||
try {
|
||||
shutdownClazz1 = (Class) loader.loadClass("org.redkale.util.SignalShutDown");
|
||||
@@ -194,7 +192,6 @@ public final class Utility {
|
||||
RedkaleClassLoader.putReflectionDeclaredConstructors(shutdownClazz1, shutdownClazz1.getName());
|
||||
signalShutdownConsumer0 = shutdownClazz1.getConstructor().newInstance();
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) { // 不会发生
|
||||
// do nothing
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user