Avoid JDK functional interfaces in ManagedTypeHelper
Description
Functional interfaces like BiConsumer and Consumer being used in ManagedTypeHelper to prevent type pollution might actually re-trigger the same issue, as generics will trigger a check for type compatibility at runtime.
The simple workaround is to create custom functional interfaces which do not use generics; we can actually benefit from generics for the parameters but we need to stricly avoid them on the set of interfaces which ManagedTypeHelper was designed to mitigate.
Functional interfaces like
BiConsumer
andConsumer
being used inManagedTypeHelper
to prevent type pollution might actually re-trigger the same issue, as generics will trigger a check for type compatibility at runtime.The simple workaround is to create custom functional interfaces which do not use generics; we can actually benefit from generics for the parameters but we need to stricly avoid them on the set of interfaces which
ManagedTypeHelper
was designed to mitigate.