HHH-14447 Remove unneccessary type check
This commit is contained in:
parent
81a9b87ec1
commit
2eaa0f8c67
|
@ -184,23 +184,13 @@ public class EntityDeleteAction extends EntityAction {
|
||||||
final EventListenerGroup<PostDeleteEventListener> eventListeners = getFastSessionServices()
|
final EventListenerGroup<PostDeleteEventListener> eventListeners = getFastSessionServices()
|
||||||
.eventListenerGroup_POST_COMMIT_DELETE;
|
.eventListenerGroup_POST_COMMIT_DELETE;
|
||||||
if (success) {
|
if (success) {
|
||||||
eventListeners.fireLazyEventOnEachListener( this::newPostDeleteEvent, EntityDeleteAction::postCommitDeleteOnSuccess );
|
eventListeners.fireLazyEventOnEachListener( this::newPostDeleteEvent, PostDeleteEventListener::onPostDelete );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
eventListeners.fireLazyEventOnEachListener( this::newPostDeleteEvent, EntityDeleteAction::postCommitDeleteOnUnsuccessful );
|
eventListeners.fireLazyEventOnEachListener( this::newPostDeleteEvent, EntityDeleteAction::postCommitDeleteOnUnsuccessful );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void postCommitDeleteOnSuccess(PostDeleteEventListener listener, PostDeleteEvent event) {
|
|
||||||
if ( listener instanceof PostCommitDeleteEventListener ) {
|
|
||||||
listener.onPostDelete( event );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//default to the legacy implementation that always fires the event
|
|
||||||
listener.onPostDelete( event );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void postCommitDeleteOnUnsuccessful(PostDeleteEventListener listener, PostDeleteEvent event) {
|
private static void postCommitDeleteOnUnsuccessful(PostDeleteEventListener listener, PostDeleteEvent event) {
|
||||||
if ( listener instanceof PostCommitDeleteEventListener ) {
|
if ( listener instanceof PostCommitDeleteEventListener ) {
|
||||||
( (PostCommitDeleteEventListener) listener ).onPostDeleteCommitFailed( event );
|
( (PostCommitDeleteEventListener) listener ).onPostDeleteCommitFailed( event );
|
||||||
|
|
Loading…
Reference in New Issue