From 2eaa0f8c67871802bd83d361ed26bc00c2f893c1 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 9 Feb 2021 12:26:08 +0000 Subject: [PATCH] HHH-14447 Remove unneccessary type check --- .../action/internal/EntityDeleteAction.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/action/internal/EntityDeleteAction.java b/hibernate-core/src/main/java/org/hibernate/action/internal/EntityDeleteAction.java index 8eb41190f3..fbe0a12a4c 100644 --- a/hibernate-core/src/main/java/org/hibernate/action/internal/EntityDeleteAction.java +++ b/hibernate-core/src/main/java/org/hibernate/action/internal/EntityDeleteAction.java @@ -184,23 +184,13 @@ public class EntityDeleteAction extends EntityAction { final EventListenerGroup eventListeners = getFastSessionServices() .eventListenerGroup_POST_COMMIT_DELETE; if (success) { - eventListeners.fireLazyEventOnEachListener( this::newPostDeleteEvent, EntityDeleteAction::postCommitDeleteOnSuccess ); + eventListeners.fireLazyEventOnEachListener( this::newPostDeleteEvent, PostDeleteEventListener::onPostDelete ); } else { 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) { if ( listener instanceof PostCommitDeleteEventListener ) { ( (PostCommitDeleteEventListener) listener ).onPostDeleteCommitFailed( event );