Skip to content

Commit

Permalink
test invalid access (same PS at the same time)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Dec 6, 2024
1 parent 6c01e13 commit ee211c0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion core/src/main/java/lucee/runtime/PageSourceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import lucee.print;
import lucee.commons.io.IOUtil;
import lucee.commons.io.log.Log;
import lucee.commons.io.log.LogUtil;
Expand Down Expand Up @@ -459,7 +462,16 @@ private boolean isLoad(byte load) {
return page != null && load == page.getLoadType();
}

private synchronized Page compile(ConfigWeb config, Resource classRootDir, Page existing, boolean returnValue, boolean ignoreScopes) throws TemplateException {
private static Map<String, String> datas = new ConcurrentHashMap<>();

private Page compile(ConfigWeb config, Resource classRootDir, Page existing, boolean returnValue, boolean ignoreScopes) throws TemplateException {
print.e("->" + getDisplayPath());
String st = datas.get(getDisplayPath());
if (st != null) {
print.e("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH");
print.ds(st);
}
datas.put(getDisplayPath(), ExceptionUtil.getStacktrace(new Throwable(), false));
try {
return _compile(config, classRootDir, existing, returnValue, ignoreScopes, false);
}
Expand All @@ -486,6 +498,10 @@ private synchronized Page compile(ConfigWeb config, Resource classRootDir, Page
if (t instanceof TemplateException) throw (TemplateException) t;
throw new PageRuntimeException(Caster.toPageException(t));
}
finally {
datas.remove(getDisplayPath());
print.e("<-" + getDisplayPath());
}
}

private Page _compile(ConfigWeb config, Resource classRootDir, Page existing, boolean returnValue, boolean ignoreScopes, boolean split)
Expand Down

0 comments on commit ee211c0

Please sign in to comment.