From 7debfd2bc9758c1e03c505461e05974c8d82df9a Mon Sep 17 00:00:00 2001 From: James Netherton Date: Thu, 18 Apr 2024 11:29:58 +0100 Subject: [PATCH] XALANJ-2664: Determine the parent ClassLoader for ByteArrayClassLoader --- .../src/main/java/org/apache/xalan/xsltc/compiler/XSLTC.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xalan/src/main/java/org/apache/xalan/xsltc/compiler/XSLTC.java b/xalan/src/main/java/org/apache/xalan/xsltc/compiler/XSLTC.java index c548538f0..1ea8610a2 100644 --- a/xalan/src/main/java/org/apache/xalan/xsltc/compiler/XSLTC.java +++ b/xalan/src/main/java/org/apache/xalan/xsltc/compiler/XSLTC.java @@ -860,7 +860,7 @@ public void dumpClass(JavaClass clazz) { // check that the, class to be serialized to filesystem, is of the valid format. // check with the native JVM class loader byte[] classByteArray = clazz.getBytes(); - ByteArrayClassLoader classLoader = new ByteArrayClassLoader(classByteArray); + ByteArrayClassLoader classLoader = new ByteArrayClassLoader(classByteArray, ObjectFactory.findClassLoader()); Class clz = classLoader.findClass(clazz.getClassName()); clazz.dump(new BufferedOutputStream( @@ -881,7 +881,8 @@ public class ByteArrayClassLoader extends ClassLoader { byte[] ba; - public ByteArrayClassLoader(byte[] bArray) { + public ByteArrayClassLoader(byte[] bArray, ClassLoader parent) { + super(parent); ba = bArray; }