Use Thread ContextClassLoader in ConfigurableObjectInputStream

Issue: SWF-1690
This commit is contained in:
Rossen Stoyanchev
2017-05-23 16:21:21 -04:00
parent ca86643099
commit ff2468556e

View File

@@ -248,7 +248,12 @@ public class SerializedFlowExecutionSnapshot extends FlowExecutionSnapshot imple
public ConfigurableObjectInputStream(InputStream in, ClassLoader classLoader) throws IOException {
super(in);
this.classLoader = classLoader;
this.classLoader = initClassLoader(classLoader);
}
private static ClassLoader initClassLoader(ClassLoader defaultClassLoader) {
ClassLoader result = Thread.currentThread().getContextClassLoader();
return result != null ? result : defaultClassLoader;
}
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {