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:
{code} Class<T> castedValueClass = (Class<T>) ( newValue == null ? type : newValue.getClass() ); {code}
When _newValue_ is _null_, the variable _type_ is casted to _Class_, but it might be of type (for example) _ParameterizedTypeImpl_ since it is initialized like this:
{code} Type type = ReflectionHelper.typeOf( m ); {code}
I'm not completely sure about conditions, but we are experiencing it from time to time.
|