File tree Expand file tree Collapse file tree
experimental/types/src/main/java/io/serverlessworkflow/api/types/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,14 +100,18 @@ public static Class<?> loadCapturingClass(String capturingClass) throws ClassNot
100100 }
101101
102102 public static Class <?> loadClass (String className ) throws ClassNotFoundException {
103+ return Class .forName (className , false , getClassLoader ());
104+ }
105+
106+ private static ClassLoader getClassLoader () {
103107 ClassLoader cl = Thread .currentThread ().getContextClassLoader ();
104108 if (cl == null ) {
105109 cl = ReflectionUtils .class .getClassLoader ();
106110 if (cl == null ) {
107111 cl = ClassLoader .getSystemClassLoader ();
108112 }
109113 }
110- return cl . loadClass ( className ) ;
114+ return cl ;
111115 }
112116
113117 public static Object functionFromSerialized (SerializedLambda sl )
@@ -126,8 +130,7 @@ public static Optional<MethodType> methodType(Object fn) {
126130 public static MethodType inferMethodType (SerializedLambda sl ) {
127131 // getInstantiatedMethodType() provides the exact generic signature resolved
128132 // by the compiler, completely bypassing captured variables and method kind switches!
129- return MethodType .fromMethodDescriptorString (
130- sl .getInstantiatedMethodType (), sl .getClass ().getClassLoader ());
133+ return MethodType .fromMethodDescriptorString (sl .getInstantiatedMethodType (), getClassLoader ());
131134 }
132135
133136 public static SerializedLambda serializedLambda (Object fn )
You can’t perform that action at this time.
0 commit comments