Skip to content

Commit 6e40e55

Browse files
committed
Use Thread ContextClassLoader in ConfigurableObjectInputStream
Issue: SWF-1690
1 parent b5dd6a8 commit 6e40e55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-webflow/src/main/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshot.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ private static class ConfigurableObjectInputStream extends ObjectInputStream {
248248

249249
public ConfigurableObjectInputStream(InputStream in, ClassLoader classLoader) throws IOException {
250250
super(in);
251-
this.classLoader = classLoader;
251+
this.classLoader = initClassLoader(classLoader);
252+
}
253+
254+
private static ClassLoader initClassLoader(ClassLoader defaultClassLoader) {
255+
ClassLoader result = Thread.currentThread().getContextClassLoader();
256+
return result != null ? result : defaultClassLoader;
252257
}
253258

254259
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {

0 commit comments

Comments
 (0)