3636import ch .qos .logback .classic .joran .JoranConfigurator ;
3737import ch .qos .logback .core .Context ;
3838import ch .qos .logback .core .CoreConstants ;
39- import ch .qos .logback .core .joran .spi .DefaultNestedComponentRegistry ;
4039import ch .qos .logback .core .joran .spi .ElementSelector ;
4140import ch .qos .logback .core .joran .spi .RuleStore ;
4241import ch .qos .logback .core .joran .util .beans .BeanDescription ;
43- import ch .qos .logback .core .joran .util .beans .BeanDescriptionCache ;
4442import ch .qos .logback .core .model .ComponentModel ;
4543import ch .qos .logback .core .model .Model ;
4644import ch .qos .logback .core .model .ModelUtil ;
4745import ch .qos .logback .core .model .processor .DefaultProcessor ;
46+ import ch .qos .logback .core .model .processor .ModelInterpretationContext ;
4847import ch .qos .logback .core .spi .ContextAware ;
4948import ch .qos .logback .core .spi .ContextAwareBase ;
5049
@@ -113,9 +112,7 @@ public void processModel(Model model) {
113112 super .processModel (model );
114113 if (!NativeDetector .inNativeImage () && isAotProcessingInProgress ()) {
115114 getContext ().putObject (BeanFactoryInitializationAotContribution .class .getName (),
116- new LogbackConfigurationAotContribution (model ,
117- getModelInterpretationContext ().getBeanDescriptionCache (),
118- getModelInterpretationContext ().getDefaultNestedComponentRegistry (), getContext ()));
115+ new LogbackConfigurationAotContribution (model , getModelInterpretationContext (), getContext ()));
119116 }
120117 }
121118
@@ -129,9 +126,9 @@ static final class LogbackConfigurationAotContribution implements BeanFactoryIni
129126
130127 private final PatternRules patternRules ;
131128
132- private LogbackConfigurationAotContribution (Model model , BeanDescriptionCache beanDescriptionCache ,
133- DefaultNestedComponentRegistry nestedComponentRegistry , Context context ) {
134- this .modelWriter = new ModelWriter (model , beanDescriptionCache , nestedComponentRegistry );
129+ private LogbackConfigurationAotContribution (Model model , ModelInterpretationContext interpretationContext ,
130+ Context context ) {
131+ this .modelWriter = new ModelWriter (model , interpretationContext );
135132 this .patternRules = new PatternRules (context );
136133 }
137134
@@ -150,15 +147,11 @@ private static final class ModelWriter {
150147
151148 private final Model model ;
152149
153- private final BeanDescriptionCache beanDescriptionCache ;
150+ private final ModelInterpretationContext modelInterpretationContext ;
154151
155- private final DefaultNestedComponentRegistry nestedComponentRegistry ;
156-
157- private ModelWriter (Model model , BeanDescriptionCache beanDescriptionCache ,
158- DefaultNestedComponentRegistry nestedComponentRegistry ) {
152+ private ModelWriter (Model model , ModelInterpretationContext modelInterpretationContext ) {
159153 this .model = model ;
160- this .beanDescriptionCache = beanDescriptionCache ;
161- this .nestedComponentRegistry = nestedComponentRegistry ;
154+ this .modelInterpretationContext = modelInterpretationContext ;
162155 }
163156
164157 private void writeTo (GenerationContext generationContext ) {
@@ -215,7 +208,8 @@ private Set<String> reflectionTypes(Model model) {
215208 }
216209 String tag = model .getTag ();
217210 if (tag != null ) {
218- String componentType = this .nestedComponentRegistry .findDefaultComponentTypeByTag (tag );
211+ String componentType = this .modelInterpretationContext .getDefaultNestedComponentRegistry ()
212+ .findDefaultComponentTypeByTag (tag );
219213 processComponent (componentType , reflectionTypes );
220214 }
221215 for (Model submodel : model .getSubModels ()) {
@@ -226,7 +220,8 @@ private Set<String> reflectionTypes(Model model) {
226220
227221 private void processComponent (String componentTypeName , Set <String > reflectionTypes ) {
228222 if (componentTypeName != null ) {
229- BeanDescription beanDescription = this .beanDescriptionCache
223+ componentTypeName = this .modelInterpretationContext .getImport (componentTypeName );
224+ BeanDescription beanDescription = this .modelInterpretationContext .getBeanDescriptionCache ()
230225 .getBeanDescription (loadComponentType (componentTypeName ));
231226 reflectionTypes .addAll (parameterTypesNames (beanDescription .getPropertyNameToAdder ().values ()));
232227 reflectionTypes .addAll (parameterTypesNames (beanDescription .getPropertyNameToSetter ().values ()));
0 commit comments