Skip to content

Commit 863570a

Browse files
committed
Perform setParent's Environment merging for ClassPathXmlApplicationContext etc constructors with parent argument as well
Issue: SPR-11068 (cherry picked from commit c5fcf19)
1 parent 70907fd commit 863570a

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
@@ -217,16 +217,16 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
217217
* Create a new AbstractApplicationContext with no parent.
218218
*/
219219
public AbstractApplicationContext() {
220-
this(null);
220+
this.resourcePatternResolver = getResourcePatternResolver();
221221
}
222222

223223
/**
224224
* Create a new AbstractApplicationContext with the given parent context.
225225
* @param parent the parent context
226226
*/
227227
public AbstractApplicationContext(ApplicationContext parent) {
228-
this.parent = parent;
229-
this.resourcePatternResolver = getResourcePatternResolver();
228+
this();
229+
setParent(parent);
230230
}
231231

232232

0 commit comments

Comments
 (0)