diff --git a/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java b/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java index bdb03ff4ac..25f90ac6e7 100644 --- a/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java +++ b/core/src/main/java/lucee/runtime/CFMLFactoryImpl.java @@ -292,7 +292,7 @@ public void releaseLuceePageContext(PageContext pc, boolean unregisterFromThread ThreadLocalPageContext.getLog(config, "application").error("release page context", e); } if (tmpRegister) ThreadLocalPageContext.register(beforePC); - if (unregisterFromThread) ThreadLocalPageContext.release(); + else if (unregisterFromThread) ThreadLocalPageContext.release(); runningPcs.remove(Integer.valueOf(pc.getId())); if (parent != null) { diff --git a/core/src/main/java/lucee/runtime/engine/ThreadLocalPageContext.java b/core/src/main/java/lucee/runtime/engine/ThreadLocalPageContext.java index fcae5a2095..43be8f5c2d 100644 --- a/core/src/main/java/lucee/runtime/engine/ThreadLocalPageContext.java +++ b/core/src/main/java/lucee/runtime/engine/ThreadLocalPageContext.java @@ -106,7 +106,7 @@ public static Config getConfig() { /** * release the pagecontext for the current thread */ - public static void release() {// print.ds(Thread.currentThread().getName()); + public static void release() { pcThreadLocal.set(null); pcThreadLocalInheritable.set(null); } diff --git a/core/src/main/java/lucee/runtime/listener/ModernAppListener.java b/core/src/main/java/lucee/runtime/listener/ModernAppListener.java index 78bdc25980..6699e120fd 100755 --- a/core/src/main/java/lucee/runtime/listener/ModernAppListener.java +++ b/core/src/main/java/lucee/runtime/listener/ModernAppListener.java @@ -349,14 +349,14 @@ public void onSessionEnd(CFMLFactory factory, String applicationName, String cfi if (scope instanceof JSession) app = ((JSession) scope).getComponent(); if (app == null || !app.containsKey(ON_SESSION_END)) return; PageContextImpl pc = null; + PageContext existing = ThreadLocalPageContext.get(); try { pc = createPageContext(factory, app, applicationName, cfid, ON_SESSION_END, true, -1); call(app, pc, ON_SESSION_END, new Object[] { pc.sessionScope(false), pc.applicationScope() }, true); } finally { - if (pc != null) { - factory.releaseLuceePageContext(pc, true); - } + factory.releaseLuceePageContext(pc, true); + if (existing != null) ThreadLocalPageContext.register(existing); } } catch (Throwable t) { diff --git a/core/src/main/java/lucee/runtime/reflection/pairs/ConstructorInstance.java b/core/src/main/java/lucee/runtime/reflection/pairs/ConstructorInstance.java index f758356f81..4950465ae9 100644 --- a/core/src/main/java/lucee/runtime/reflection/pairs/ConstructorInstance.java +++ b/core/src/main/java/lucee/runtime/reflection/pairs/ConstructorInstance.java @@ -58,7 +58,7 @@ public Object invoke() throws PageException, InstantiationException, IllegalAcce try { return ((BiFunction) getResult().getValue()).apply(null, args); } - catch (IncompatibleClassChangeError | IllegalStateException e) { + catch (LinkageError | IllegalStateException e) { if (!Clazz.allowReflection()) throw e; LogUtil.log("direct", e); DynamicInvoker di = DynamicInvoker.getExistingInstance(); diff --git a/core/src/main/java/lucee/runtime/reflection/pairs/MethodInstance.java b/core/src/main/java/lucee/runtime/reflection/pairs/MethodInstance.java index 980219f6d7..1516fbfb94 100644 --- a/core/src/main/java/lucee/runtime/reflection/pairs/MethodInstance.java +++ b/core/src/main/java/lucee/runtime/reflection/pairs/MethodInstance.java @@ -63,7 +63,7 @@ else if ("equals".equals(methodName.getString()) && args.length == 1) { try { return ((BiFunction) getResult().getValue()).apply(o, args); } - catch (IncompatibleClassChangeError | ClassCastException e) { // java.lang.ClassCastException + catch (LinkageError | ClassCastException e) { // java.lang.ClassCastException if (!Clazz.allowReflection()) throw e; LogUtil.log("dynamic", e); DynamicInvoker di = DynamicInvoker.getExistingInstance(); diff --git a/core/src/main/java/lucee/runtime/type/util/KeyConstants.java b/core/src/main/java/lucee/runtime/type/util/KeyConstants.java index ea02cf48a6..ba1f1e8844 100644 --- a/core/src/main/java/lucee/runtime/type/util/KeyConstants.java +++ b/core/src/main/java/lucee/runtime/type/util/KeyConstants.java @@ -636,6 +636,7 @@ public class KeyConstants { public static final Key _this = KeyImpl._const("this"); public static final Key _thistag = KeyImpl._const("thistag"); public static final Key _thread = KeyImpl._const("thread"); + public static final Key _THREAD = KeyImpl._const("THREAD"); public static final Key _time = KeyImpl._const("time"); public static final Key _timers = KeyImpl._const("timers"); public static final Key _timespan = KeyImpl._const("timespan"); diff --git a/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java b/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java index 3bd77b44c5..d82b335fea 100644 --- a/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java +++ b/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java @@ -27,7 +27,6 @@ import org.objectweb.asm.commons.GeneratorAdapter; import org.objectweb.asm.commons.Method; -import lucee.aprint; import lucee.commons.io.log.LogUtil; import lucee.commons.lang.ClassException; import lucee.commons.lang.StringUtil; @@ -579,14 +578,11 @@ static Type _writeOutFirstBIF(BytecodeContext bc, BIF bif, int mode, boolean las if (vt.index != -1) names[vt.index] = null; index++; // if (!Types.toType(bc, vt.type).equals(argTypes[index])) - // throw new TransformerException(bc, "argument type missmatch[" + vt.type + "->" + Types.toType(bc, - // vt.type) + "!=" + argTypes[index] + "]", line); - if (!Types.toType(bc, vt.type).equals(argTypes[index])) - aprint.e("argument type missmatch[" + vt.type + "->" + Types.toType(bc, vt.type) + "!=" + argTypes[index] + "]"); + // aprint.e("argument type missmatch[" + vt.type + "->" + Types.toType(bc, vt.type) + "!=" + + // argTypes[index] + "]"); if (vt.value == null) ASMConstants.NULL(bc.getAdapter()); else vt.value.writeOut(bc, Types.isPrimitiveType(argTypes[index]) ? MODE_VALUE : MODE_REF); } - for (int y = 0; y < names.length; y++) { if (names[y] != null) { TransformerException bce = new TransformerException(bc, "argument [" + names[y] + "] is not allowed for function [" + bif.getFlf().getName() + "]", diff --git a/loader/build.xml b/loader/build.xml index a574e2c18a..f761d971e8 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 1fe0957a7f..6c7ae977b6 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.2.0.109-SNAPSHOT + 6.2.0.110-SNAPSHOT jar Lucee Loader Build diff --git a/test/tickets/LDEV3116.cfc b/test/tickets/LDEV3116.cfc index 497e64b77c..965c154321 100644 --- a/test/tickets/LDEV3116.cfc +++ b/test/tickets/LDEV3116.cfc @@ -18,6 +18,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="thread" { it( title="without child thread", body= function(){ thread name="test_without" action="run" { + thread.testing = 'bloh'; [1].each(function(key){ var test = key; }, false); @@ -25,6 +26,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="thread" { thread.testing = 'blah'; } thread action="join" name="test_without"; + systemOutput(cfthread.test_without,1,1); expect( cfthread.test_without ).notToHaveKey( "error", cfthread.test_without.error.stacktrace?: '???' ); expect( cfthread.test_without.testing ).toBe( "blah" ); } );