Skip to content

Commit c5fcf19

Browse files
committed
Perform setParent's Environment merging for ClassPathXmlApplicationContext etc constructors with parent argument as well
Issue: SPR-11068
1 parent 4ac6801 commit c5fcf19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
206206
* Create a new AbstractApplicationContext with no parent.
207207
*/
208208
public AbstractApplicationContext() {
209-
this(null);
209+
this.resourcePatternResolver = getResourcePatternResolver();
210210
}
211211

212212
/**
213213
* Create a new AbstractApplicationContext with the given parent context.
214214
* @param parent the parent context
215215
*/
216216
public AbstractApplicationContext(ApplicationContext parent) {
217-
this.parent = parent;
218-
this.resourcePatternResolver = getResourcePatternResolver();
217+
this();
218+
setParent(parent);
219219
}
220220

221221

0 commit comments

Comments
 (0)