Commit 8f5a753e authored by Paweł Doleciński's avatar Paweł Doleciński Committed by Andy Wilkinson

Fix propagation of local.mongo.port up the context hierarchy

Previously, a StackOverflowError would occur when using a random port
for embedded mongo as the logic for propagating the property up the
context hierarchy would repeatedly use the leaf context's parent.

This commit updates the logic to look to see if the current context
has a parent, only calling the method again if it does.

Closes gh-3956
parent b79ca614
......@@ -173,8 +173,8 @@ public class EmbeddedMongoAutoConfiguration {
}
map.put("local.mongo.port", port);
}
if (this.context.getParent() != null) {
setPortProperty(this.context.getParent(), port);
if (context.getParent() != null) {
setPortProperty(context.getParent(), port);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment