dev@glassfish.java.net

Re: URGENT: ACTION: Nandina Ektare: Latest JSR-303 breaks some things

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Tue, 28 Jul 2009 09:39:53 -0700

>>>>> On Mon, 27 Jul 2009 20:06:51 -0700, Ed Burns <Ed.Burns_at_Sun.COM> said:

EB> ValidatorImpl.collectMetaConstraintsForPath:676
EB> ValidatorImpl.validateValue:556
EB> ValidatorImpl.validateValue:148
EB> WriteableView.handleValidation:564
EB> WriteableView.setter:147
EB> WriteableView.invoke:106

EB> Sourcecode around callstack:

EB> final BeanMetaData<T> metaData = getBeanMetaData( clazz );
EB> if ( !propertyIter.hasNext() ) {

EB> //use metadata first as ReflectionHelper#containsMember is slow
EB> ========> HERE if ( metaData.getPropertyDescriptor( elem.getName() ) == null ) {
EB> throw new IllegalArgumentException(
EB> "Invalid property path. There is no property " + elem.getName() + " in entity " + metaData.getBeanClass()
EB> .getName()
EB> );
EB> }

EB> Problem. For some reason, when the code reaches ==> HERE (see above),
EB> there is no propertyDescriptor for jvmOptions in the metadata for
EB> JavaConfig. I'm not sure why this is.

I compared this code with the previous implementation, 1.0CR2, and found
that the "metaData.getPropertyDescriptor()" is new in 1.0CR3.

The old behavior is for collectMetaConstraitnsForPath() to return null
if the property is not found. This new behavior is for it to throw an
IllegalArgumentException. I'll report this behavior change to JBoss and
see if they defend it or agree to roll it back.

Ed

-- 
| ed.burns_at_sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/