Improve TypeHelper#extract(Validated|Constraint)Type() and ValueExtractor Descriptor#getContainerType() logic

Description

Note: for now, the method in TypeHelper is called extractType(). The names used in the issue are from an upcoming PR that might target 6.1.

These are 2 implementations of basically the same thing but... they are really different and I'm pretty sure we could break them easily.

For TypeHelper#extract(Validated|Constraint)Type(), I initially thought it might fail but it does not as, in fact, methods that look generic are tied to ConstraintValidator. See TypeHelper#resolveTypes() for instance. I renamed the entry method.

For ValueExtractor Descriptor#getContainerType(), I'm pretty sure the logic can be broken pretty easily by making the VE not extending directly ValueExtractor but extending another interface with type parameters.

I think we should make this more consistent and use Classmate. Note that in one case, we want to be able to get the annotation whereas in the other case we don't care and we want a class. That might count.

Environment

None

Assignee

Unassigned

Reporter

Guillaume Smet

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major