From: Henri Sara Date: Mon, 25 May 2009 07:45:48 +0000 (+0000) Subject: #2831 DateField.handleUnparsableDateString throws ConversionException by default X-Git-Tag: 6.7.0.beta1~2788 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=18ae02885023f31a86d5e0216aa91a6d03e77bc8;p=vaadin-framework.git #2831 DateField.handleUnparsableDateString throws ConversionException by default svn changeset:7984/svn branch:6.0 --- 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 */