@@ -37,7 +37,7 @@ public AliasedEagerImportingStrategy(
3737 this .currentImportAlias = currentImportAlias ;
3838 maybeParentImportAlias =
3939 importingData .getOriginalInterpreter ().getContext ().getImportResourceAlias ();
40- if (maybeParentImportAlias . isPresent ( )) {
40+ if (isParentImportInProgress ( importingData . getOriginalInterpreter () )) {
4141 fullImportAlias =
4242 String .format ("%s.%s" , maybeParentImportAlias .get (), currentImportAlias );
4343 } else {
@@ -138,9 +138,7 @@ public String getFinalOutput(String output, JinjavaInterpreter child) {
138138
139139 @ SuppressWarnings ("unchecked" )
140140 private void constructFullAliasPathMap (JinjavaInterpreter child ) {
141- String [] allAliases = isParentImportInProgress (child )
142- ? fullImportAlias .split ("\\ ." )
143- : new String [] { currentImportAlias };
141+ String [] allAliases = fullImportAlias .split ("\\ ." );
144142 Map <String , Object > currentMap = child .getContext ().getParent ();
145143 for (int i = 0 ; i < allAliases .length - 1 ; i ++) {
146144 Object maybeNextMap = currentMap .get (allAliases [i ]);
@@ -164,10 +162,10 @@ private void constructFullAliasPathMap(JinjavaInterpreter child) {
164162 );
165163 }
166164
167- private boolean isParentImportInProgress (JinjavaInterpreter child ) {
165+ private boolean isParentImportInProgress (JinjavaInterpreter interpreter ) {
168166 return maybeParentImportAlias
169167 .map (MetaContextVariables ::getTemporaryImportAlias )
170- .map (child .getContext ()::containsKey )
168+ .map (interpreter .getContext ()::containsKey )
171169 .orElse (false );
172170 }
173171
0 commit comments