DATACMNS-1735 - Polishing.
Use mutated object as guard for synchronization. Copy discovered callbacks to cached callbacks. Reduce concurrency in unit test to reduce test load. Guard synchronization with timeouts. Original pull request: #446.
This commit is contained in:
@@ -384,10 +384,11 @@ class EntityCallbackDiscoverer {
|
||||
if (this.entityCallbackBeans.isEmpty()) {
|
||||
|
||||
if (cachedEntityCallbacks.size() != entityCallbacks.size()) {
|
||||
List<EntityCallback<?>> entityCallbacks = new ArrayList<>(this.entityCallbacks.size());
|
||||
|
||||
List<EntityCallback<?>> entityCallbacks = new ArrayList<>(this.entityCallbacks);
|
||||
AnnotationAwareOrderComparator.sort(entityCallbacks);
|
||||
|
||||
synchronized(this) {
|
||||
synchronized (cachedEntityCallbacks) {
|
||||
cachedEntityCallbacks.clear();
|
||||
cachedEntityCallbacks.addAll(entityCallbacks);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user