-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ApplicationListenerMethodAdapter#supportsEventType check
This commit fixes the check by avoiding a fallback to eventType's hasUnresolvableGenerics(). This could previously lead to checking a generic event type `A<T>` against a listener which accepts unrelated `B` and return `true` despite the inconsistency. Note that this wouldn't necessarily surface to the user because there is a `catch (ClassCastException e)` down the line, which was primarily put in place to deal with lambda-based listeners but happens to catch an exception thrown due to the bad result of `supportsEventType`. The `supportsEventType` now matches generic `PayloadApplicationEvent` types with a raw counterpart, using the above fallback only in that case and otherwise ultimately returning `false`. Closes gh-30399
- Loading branch information
1 parent
aefcb9d
commit c733ae0
Showing
2 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters