Prevent listeners being added multiple times on restart

(and at other times potentially - e.g. if 2 contexts share a parent).

Plus some general tidy up on compiler warnings.

Fixes gh-613
This commit is contained in:
Dave Syer
2019-12-17 16:31:11 +00:00
parent 4cc23b4b71
commit bfbadec0f0
9 changed files with 85 additions and 44 deletions

View File

@@ -59,7 +59,7 @@ public class RestartIntegrationTests {
then(this.context.getParent().getParent()).isNull();
RestartEndpoint next = this.context.getBean(RestartEndpoint.class);
then(next).isNotSameAs(endpoint);
then(next).isSameAs(endpoint);
this.context = next.doRestart();
then(this.context).isNotNull();