It seems that onApplicationEvent could be invoked concurrently, at least events map could be written and read concurrently.
Replace event map with ConcurrentHashMap. Details in jdk - HashMap.java - L89
Note that this implementation is not synchronized. If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally.