Skip to content

Commit

Permalink
HHH-14447 Remove unneccessary type check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne authored and dreab8 committed Feb 9, 2021
1 parent f6844e4 commit f8fd7a7
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,13 @@ protected void postCommitDelete(boolean success) {
final EventListenerGroup<PostDeleteEventListener> 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 );
Expand Down

0 comments on commit f8fd7a7

Please # to comment.