Author: hardy.ferentschik
Date: 2009-06-22 11:07:34 -0400 (Mon, 22 Jun 2009)
New Revision: 16861
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
Log:
HV-175 made sure that if value is not null value itslef is used to dtermine type
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java 2009-06-22
15:05:32 UTC (rev 16860)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java 2009-06-22
15:07:34 UTC (rev 16861)
@@ -141,6 +141,7 @@
if ( beanType == null ) {
throw new IllegalArgumentException( "The bean type cannot be null." );
}
+
sanityCheckPropertyPath( propertyName );
GroupChain groupChain = determineGroupExecutionOrder( groups );
@@ -615,15 +616,14 @@
Type type = ReflectionHelper.typeOf( m );
value = value == null ? null : ReflectionHelper.getValue( m, value );
if ( elem.isIndexed() ) {
- type = ReflectionHelper.getIndexedType( type );
value = value == null ? null : ReflectionHelper.getIndexedValue(
value, elem.getIndex()
);
- if ( type == null ) {
- continue;
- }
+ type = ReflectionHelper.getIndexedType( type );
}
- return collectMetaConstraintsForPath( ( Class<T> ) type, value, propertyIter,
metaConstraints );
+ return collectMetaConstraintsForPath(
+ ( Class<T> ) ( value == null ? type : value.getClass() ), value,
propertyIter, metaConstraints
+ );
}
}
}
Show replies by date