Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.reactfx.value.SuspendableVar;
import org.reactfx.value.Val;
import org.reactfx.value.Var;
Expand Down Expand Up @@ -76,6 +77,8 @@ public class ASTManagerImpl implements ASTManager {

private final Var<Map<String, String>> ruleProperties = Var.newSimpleVar(Collections.emptyMap());

private @Nullable ClassLoader currentClassloader;

public ASTManagerImpl(DesignerRoot owner) {
this.designerRoot = owner;

Expand Down Expand Up @@ -233,12 +236,14 @@ private LanguageProcessorRegistry refreshRegistry(LanguageVersion version, Class
langProperties,
NOOP_REPORTER);
lpRegistry.setValue(newRegistry);
currentClassloader = classLoader;
return newRegistry;
}

// already created, need to check that the version is the same
if (!current.getLanguages().getLanguages().contains(version.getLanguage())
|| !current.getProcessor(version.getLanguage()).getLanguageVersion().equals(version)) {
|| !current.getProcessor(version.getLanguage()).getLanguageVersion().equals(version)
|| !Objects.equals(currentClassloader, classLoader)) {
// current is invalid, recreate it
current.close();
lpRegistry.setValue(null);
Expand Down