Skip to content

Commit

Permalink
add core classloader to parents array
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jul 3, 2024
1 parent 82b0e35 commit c0f692d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public static Object createProxy(Object defaultValue, PageContext pc, Component

public static Object createProxy(PageContext pc, final Component cfc, Class extendz, Class... interfaces) throws PageException, IOException {
PageContextImpl pci = (PageContextImpl) pc;
ClassLoader[] parents = extractClassLoaders(null, interfaces);
ClassLoader[] parents = extractClassLoaders(cfc.getClass().getClassLoader(), extendz, interfaces);

if (extendz == null) extendz = Object.class;
if (interfaces == null) interfaces = new Class[0];
Expand Down Expand Up @@ -304,7 +304,6 @@ public static Object createProxy(PageContext pc, final Component cfc, Class exte

// inline
// ComponentLoader.loadInline((CIPage)(new cf(this.getPageSource())), pc);

// this.cfc = ThreadLocalPageContext.get().loadComponent(className);
String name = cfc.getAbsName();
String sub = ((ComponentImpl) cfc).getSubName();
Expand Down Expand Up @@ -422,12 +421,16 @@ public static Object createProxy(PageContext pc, final Component cfc, Class exte
* // adapter.returnValue(); adapter.endMethod(); }
*/

private static ClassLoader[] extractClassLoaders(ClassLoader cl, Class... classes) {
private static ClassLoader[] extractClassLoaders(ClassLoader cl, Class extendz, Class... classes) {
HashSet<ClassLoader> set = new HashSet<>();
if (cl != null) {
set.add(cl);
cl = null;
}
if (extendz != null) {
set.add(ClassUtil.getClassLoader(extendz));
}

if (classes != null) {
for (int i = 0; i < classes.length; i++) {
set.add(ClassUtil.getClassLoader(classes[i]));
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.1.1.20-SNAPSHOT"/>
<property name="version" value="6.1.1.21-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.1.1.20-SNAPSHOT</version>
<version>6.1.1.21-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit c0f692d

Please sign in to comment.