Juergen Hoeller opened SPR-13960 and commented
Historically, Spring leniently handled the undefined case of null being passed to unwrap calls on JPA EntityManager, EntityManagerFactory and Query wrappers, but did not do so on Bean Validation Validator wrappers. We should aim for consistent behavior here, always returning the immediately underlying target if available (or the proxy otherwise). This is particularly useful for our own purposes, e.g. #18530 where we need to pass on the underlying Query handle without knowing its specific type.
This ticket tracks the consistency part in a 4.3 timeframe. Local modifications to Query.unwrap will happen in the 4.2.5 line for immediately addressing #18530.
Affects: 4.2.4
Issue Links:
Referenced from: commits 7fcb277