]> source.dussan.org Git - vaadin-framework.git/commitdiff
#2831 DateField.handleUnparsableDateString throws ConversionException by default
authorHenri Sara <henri.sara@itmill.com>
Mon, 25 May 2009 07:45:48 +0000 (07:45 +0000)
committerHenri Sara <henri.sara@itmill.com>
Mon, 25 May 2009 07:45:48 +0000 (07:45 +0000)
svn changeset:7984/svn branch:6.0

src/com/vaadin/ui/DateField.java

index e048434361b0bd24626c90ea28e144f8a2e557b9..6c4dfce660a9821a29f8a55bb97386a51bfca2e0 100644 (file)
@@ -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 */