Skip to content

Commit 2e7be80

Browse files
authored
Fix when "Unloading DSL model" is logged (#5411)
Fix #5350 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
1 parent 4ad6899 commit 2e7be80

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bundles/org.openhab.core.model.core/src/main/java/org/openhab/core/model/core/internal/ModelRepositoryImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public boolean addOrRefreshModel(String name, final InputStream originalInputStr
127127
}
128128
if (!valid) {
129129
logger.warn("DSL model '{}' has errors, therefore ignoring it: {}", name, String.join("\n", newErrors));
130-
removeModel(name);
130+
removeResource(name);
131131
return false;
132132
}
133133
if (!newWarnings.isEmpty()) {
@@ -184,6 +184,10 @@ public boolean addOrRefreshModel(String name, final InputStream originalInputStr
184184
@Override
185185
public boolean removeModel(String name) {
186186
logger.info("Unloading DSL model '{}'", name);
187+
return removeResource(name);
188+
}
189+
190+
private boolean removeResource(String name) {
187191
Resource resource = getResource(name);
188192
if (resource != null) {
189193
synchronized (resourceSet) {

0 commit comments

Comments
 (0)