|
16 | 16 |
|
17 | 17 | import org.apache.commons.lang3.StringUtils; |
18 | 18 | import org.checkerframework.checker.nullness.qual.NonNull; |
| 19 | +import org.checkerframework.checker.nullness.qual.Nullable; |
19 | 20 | import org.reactfx.value.SuspendableVar; |
20 | 21 | import org.reactfx.value.Val; |
21 | 22 | import org.reactfx.value.Var; |
@@ -76,6 +77,8 @@ public class ASTManagerImpl implements ASTManager { |
76 | 77 |
|
77 | 78 | private final Var<Map<String, String>> ruleProperties = Var.newSimpleVar(Collections.emptyMap()); |
78 | 79 |
|
| 80 | + private @Nullable ClassLoader currentClassloader; |
| 81 | + |
79 | 82 | public ASTManagerImpl(DesignerRoot owner) { |
80 | 83 | this.designerRoot = owner; |
81 | 84 |
|
@@ -233,12 +236,14 @@ private LanguageProcessorRegistry refreshRegistry(LanguageVersion version, Class |
233 | 236 | langProperties, |
234 | 237 | NOOP_REPORTER); |
235 | 238 | lpRegistry.setValue(newRegistry); |
| 239 | + currentClassloader = classLoader; |
236 | 240 | return newRegistry; |
237 | 241 | } |
238 | 242 |
|
239 | 243 | // already created, need to check that the version is the same |
240 | 244 | if (!current.getLanguages().getLanguages().contains(version.getLanguage()) |
241 | | - || !current.getProcessor(version.getLanguage()).getLanguageVersion().equals(version)) { |
| 245 | + || !current.getProcessor(version.getLanguage()).getLanguageVersion().equals(version) |
| 246 | + || !Objects.equals(currentClassloader, classLoader) ) { |
242 | 247 | // current is invalid, recreate it |
243 | 248 | current.close(); |
244 | 249 | lpRegistry.setValue(null); |
|
0 commit comments