HHH-14869 Fix CallbackRegistryImpl#registerCallbacks considering all given callbacks have the same type
This commit is contained in:
parent
965f5bd925
commit
8afce5b5ed
|
@ -41,13 +41,15 @@ final class CallbackRegistryImpl implements CallbackRegistryImplementor {
|
|||
return;
|
||||
}
|
||||
|
||||
final HashMap<Class, Callback[]> map = determineAppropriateCallbackMap( callbacks[0].getCallbackType() );
|
||||
for ( Callback callback : callbacks ) {
|
||||
final HashMap<Class, Callback[]> map = determineAppropriateCallbackMap( callback.getCallbackType() );
|
||||
Callback[] entityCallbacks = map.get( entityClass );
|
||||
|
||||
if ( entityCallbacks != null ) {
|
||||
callbacks = ArrayHelper.join( entityCallbacks, callbacks );
|
||||
if ( entityCallbacks == null ) {
|
||||
entityCallbacks = new Callback[0];
|
||||
}
|
||||
entityCallbacks = ArrayHelper.join( entityCallbacks, callback );
|
||||
map.put( entityClass, entityCallbacks );
|
||||
}
|
||||
map.put( entityClass, callbacks );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue