Gracefully skip non-assignable reactive lambda callbacks on Java 18+.

Closes #2808, #2809.
This commit is contained in:
Michael J. Simons
2023-04-01 00:15:11 +02:00
committed by Oliver Drotbohm
parent e1ec982e88
commit a257a0399a
2 changed files with 25 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ import org.springframework.util.ReflectionUtils;
*
* @author Mark Paluch
* @author Christoph Strobl
* @author Michael J. Simons
*/
class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks {
@@ -112,7 +113,7 @@ class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks {
throw new IllegalArgumentException(
String.format("Callback invocation on %s returned null value for %s", callback.getClass(), entity));
} catch (ClassCastException ex) {
} catch (IllegalArgumentException | ClassCastException ex) {
String msg = ex.getMessage();
if (msg == null || EntityCallbackInvoker.matchesClassCastMessage(msg, entity.getClass())) {