Error handling in property editors for null values
--------------------------------------------------
Key: JBAS-4494
URL:
http://jira.jboss.com/jira/browse/JBAS-4494
Project: JBoss Application Server
Issue Type: Sub-task
Security Level: Public(Everyone can see)
Reporter: Adrian Brock
As per the parent task, the error handling for the DateEditor is not handling null values
correctly.
public void setValue(Object value)
{
if (value instanceof Date)
{
text = null;
super.setValue(value);
}
else
{
throw new IllegalArgumentException("setValue() expected java.util.Date
value, got "
+ value.getClass().getName());
}
}
There needs to be an initial
if (value == null)
throw new IllegalArgumentException("Null value for setValue() expected
java.util.Date");
or alternatively (since the javadocs don't disallow null values)
if (value == null)
return null;
The other property editors need checking for the same problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: