Simplify creation of ConstraintViolationExceptions

Description

javax.validation.ConstraintViolationException wraps a set of constraint violations, currently in the following form:

As the exception's constructors have a parameter of the same type, instantiating it is not as easy as expected:

This problem can be solved by changing the collection type to

The exception then would read as follows:

This makes the exception easier to use for producers, while maintaining simplicity for clients (since getConstraintViolations() still returns a Set<ConstraintViolation<?>>, clients don't have to do deal with the bound wildcard expression).

Environment

None

Assignee

Gunnar Morling

Reporter

Gunnar Morling

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

Affects versions

Priority

Major
Configure