commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomas Viberg" <>
Subject [PATCH][BeanUtils] NoSuchMethod for read only properties and NullPointer when populating primitives
Date Sun, 26 May 2002 17:17:48 GMT
Comments, anyone?

/ Tomas

----- Original Message ----- 
From: Tomas Viberg 
Sent: Sunday, May 19, 2002 7:29 PM
Subject: [PATCH] BeanUtils - read only properties and null value conversion


I humbly submit a patch for, correcting the following errors:

1. When you try to populate a read-only property, the populate method throws a NoSuchMethodException
(wrapped in an InvocationTargetException), since there is no check that the property has a
setter method.

2. When you try to populate a primitive property with a null value, you get a NullPointerException,
since no data type conversion is applied to null values. 

I have also patched to include setting a primitive property to null
and attempting to set a read-only (simple) property.

Tomas Viberg,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message