diff options
author | Henri Sara <henri.sara@itmill.com> | 2009-05-25 07:45:48 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2009-05-25 07:45:48 +0000 |
commit | 18ae02885023f31a86d5e0216aa91a6d03e77bc8 (patch) | |
tree | 4b3b0beb47389bdde28b615966e81bf46becf8e8 /src | |
parent | d08d71c6b505226698fe5390777de3d922e8cbc9 (diff) | |
download | vaadin-framework-18ae02885023f31a86d5e0216aa91a6d03e77bc8.tar.gz vaadin-framework-18ae02885023f31a86d5e0216aa91a6d03e77bc8.zip |
#2831 DateField.handleUnparsableDateString throws ConversionException by default
svn changeset:7984/svn branch:6.0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/ui/DateField.java | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/com/vaadin/ui/DateField.java b/src/com/vaadin/ui/DateField.java index e048434361..6c4dfce660 100644 --- a/src/com/vaadin/ui/DateField.java +++ b/src/com/vaadin/ui/DateField.java @@ -351,17 +351,14 @@ public class DateField extends AbstractField { } /** - * This method is called to handle the date string from the client if the - * client could not parse it as a Date. + * This method is called to handle a non-empty date string from the client + * if the client could not parse it as a Date. * - * By default, null is returned. If an exception is thrown, the current - * value will not be modified. + * By default, a Property.ConversionException is thrown, and the current + * value is not modified. * - * This can be overridden to handle conversions or to throw an exception, or - * to fire an event. - * - * The default behavior is likely to change in the next major version of - * Vaadin - a Property.ConversionException will be thrown. + * This can be overridden to handle conversions, to return null (equivalent + * to empty input), to throw an exception or to fire an event. * * @param dateString * @return parsed Date @@ -370,10 +367,7 @@ public class DateField extends AbstractField { */ protected Date handleUnparsableDateString(String dateString) throws Property.ConversionException { - // TODO in the next major version, this should throw an exception to be - // consistent with other fields - // throw new Property.ConversionException(); - return null; + throw new Property.ConversionException(); } /* Property features */ |