Fix when "Unloading DSL model" is logged (#5411)

Fix #5350

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo
2026-03-08 16:53:18 +01:00
committed by GitHub
parent 4ad6899161
commit 2e7be80e21
@@ -127,7 +127,7 @@ public class ModelRepositoryImpl implements ModelRepository {
}
if (!valid) {
logger.warn("DSL model '{}' has errors, therefore ignoring it: {}", name, String.join("\n", newErrors));
removeModel(name);
removeResource(name);
return false;
}
if (!newWarnings.isEmpty()) {
@@ -184,6 +184,10 @@ public class ModelRepositoryImpl implements ModelRepository {
@Override
public boolean removeModel(String name) {
logger.info("Unloading DSL model '{}'", name);
return removeResource(name);
}
private boolean removeResource(String name) {
Resource resource = getResource(name);
if (resource != null) {
synchronized (resourceSet) {