ClassCastException in ValidationException.isAlreadyValidatedForCurrentGroup

Description

Wen trying to validate a pretty large list of beans, I sometimes encounter a ClassCastException in the ValidationException.isAlreadyValidatedForCurrentGroup method.

The issue is that we have two types of objects (BeanPathMetaConstraintProcessedUnit and BeanGroupProcessedUnit) in the processedUnits Set. Sometimes two instances of theses classes have the same hashcode value. When applying the equals method, I encounter a ClassCastException.

This part of the equals method is the problem :

I think, the comparison should be o.getClass != BeanGroupProcessedUnit.class. There is the same problem in the BeanGroupProcessedUnit equals method.

Here is the stack trace:

Environment

6.0.4.Final, Java 8, BeanValidation 2.0

Assignee

Unassigned

Reporter

Mickael Coquer

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

Yes, likely

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Affects versions

Priority

Major
Configure