Description
When setting a HiddenField's valueClass to Timestamp, an exception is thrown in HiddenField#bindRequestValue:
java.lang.IllegalArgumentException: The value.getClass(): 'java.util.Date' must be the same as the HiddenField valueClass: 'java.sql.Timestamp'
at org.apache.click.control.HiddenField.setValueObject(HiddenField.java:239)
at org.apache.click.control.HiddenField.bindRequestValue(HiddenField.java:295)
at org.apache.click.control.HiddenFieldTest.testTimestampCopy(HiddenFieldTest.java:66)
An easy fix is to add extra checks for #bindRequestValue:
else if (valueClass == Timestamp.class)
{ long time = Long.parseLong(aValue); setValueObject(new Timestamp(time)); }else if (valueClass == java.sql.Date.class)
{ long time = Long.parseLong(aValue); setValueObject(new java.sql.Date(time)); }else if (valueClass == Time.class)
{ long time = Long.parseLong(aValue); setValueObject(new Time(time)); } else if (Date.class.isAssignableFrom(valueClass)) {
}