mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Prevent double-processing of <include>s when using AOT
Fixes gh-41081
This commit is contained in:
parent
76e2009bd8
commit
9817ff5622
@ -42,6 +42,7 @@ import ch.qos.logback.core.joran.spi.RuleStore;
|
||||
import ch.qos.logback.core.joran.util.PropertySetter;
|
||||
import ch.qos.logback.core.joran.util.beans.BeanDescription;
|
||||
import ch.qos.logback.core.model.ComponentModel;
|
||||
import ch.qos.logback.core.model.IncludeModel;
|
||||
import ch.qos.logback.core.model.Model;
|
||||
import ch.qos.logback.core.model.ModelUtil;
|
||||
import ch.qos.logback.core.model.processor.DefaultProcessor;
|
||||
@ -326,6 +327,7 @@ class SpringBootJoranConfigurator extends JoranConfigurator {
|
||||
try (ObjectInputStream input = new ObjectInputStream(modelInput)) {
|
||||
Model model = (Model) input.readObject();
|
||||
ModelUtil.resetForReuse(model);
|
||||
markIncludesAsHandled(model);
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@ -335,6 +337,15 @@ class SpringBootJoranConfigurator extends JoranConfigurator {
|
||||
}
|
||||
}
|
||||
|
||||
private void markIncludesAsHandled(Model model) {
|
||||
if (model instanceof IncludeModel) {
|
||||
model.markAsHandled();
|
||||
}
|
||||
for (Model submodel : model.getSubModels()) {
|
||||
markIncludesAsHandled(submodel);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final class PatternRules {
|
||||
|
Loading…
Reference in New Issue
Block a user