Description:
|
There is an unsafe cast in method collectMetaConstraintsForPath in class
ValidatorImpl
_ValidatorImpl_
which might result in
ClassCastException
_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"
_newValue_
is
null
_null_
, the variable
"type"
_type_
is casted to
Class class
_Class_
, but it might be of type (for example)
ParameterizedTypeImpl
_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.
|