Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade janino to 3.1.12 #16148

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion logstash-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
api "com.fasterxml.jackson.core:jackson-databind:${jacksonDatabindVersion}"
api "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
implementation 'org.codehaus.janino:janino:3.1.0'
implementation 'org.codehaus.janino:janino:3.1.12'
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jacksonVersion}"
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.2'
implementation group: 'com.google.guava', name: 'guava', version: '32.1.2-jre'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public final class ComputeStepSyntaxElement<T extends Dataset> {

private static final Path SOURCE_DIR = debugDir();

private static final ThreadLocal<ISimpleCompiler> COMPILER = ThreadLocal.withInitial(SimpleCompiler::new);

/**
* Global cache of runtime compiled classes to prevent duplicate classes being compiled.
* across pipelines and workers.
Expand Down Expand Up @@ -99,9 +97,7 @@ public static int classCacheSize() {
* */
@VisibleForTesting
public static void cleanClassCache() {
synchronized (COMPILER) {
CLASS_CACHE.clear();
}
CLASS_CACHE.clear();
}

private ComputeStepSyntaxElement(
Expand Down Expand Up @@ -139,7 +135,7 @@ public T instantiate() {
private Class<? extends Dataset> compile() {
return CLASS_CACHE.computeIfAbsent(this, (__)->{
try {
final ISimpleCompiler compiler = COMPILER.get();
final ISimpleCompiler compiler = new SimpleCompiler();
final String name = String.format("CompiledDataset%d", DATASET_CLASS_INDEX.incrementAndGet());
final String code = CLASS_NAME_PLACEHOLDER_REGEX.matcher(normalizedSource).replaceAll(name);
if (SOURCE_DIR != null) {
Expand Down