The refresh() method of AnnotationConfigApplicationContext is not thread safe anymore.
It works fine in 3.1.2. The regression has bean introduce with the 3.1.3 release.
-create 2 application contexts
-register the same configuration class
-call the refresh method on application context simultaneously
Now, there is a good chance that both application context share the same beans.
A small Java program is attached to reproduce the issue.