There is an unsafe cast in method collectMetaConstraintsForPath in class ValidatorImpl which might result in ClassCastException under some circumstances. The problem is in the following line:
Class<T> castedValueClass = (Class<T>) ( newValue == null ? type : newValue.getClass() );
When "newValue" is null, the variable "type" is casted to Class class, but it might be of type (for example) ParameterizedTypeImpl since it is initialized like this:
Type type = ReflectionHelper.typeOf( m );
I'm not completely sure about conditions, but we are experiencing it from time to time.
|