Skip to content

Commit 125b843

Browse files
committed
revised javadoc on "exactDateLength" (SPR-7759)
1 parent efe1e64 commit 125b843

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

org.springframework.beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,7 +77,10 @@ public CustomDateEditor(DateFormat dateFormat, boolean allowEmpty) {
7777
* thrown if the String does not exactly match the length specified. This is useful
7878
* because SimpleDateFormat does not enforce strict parsing of the year part,
7979
* not even with <code>setLenient(false)</code>. Without an "exactDateLength"
80-
* specified, the "01/01/05" would get parsed to "01/01/0005".
80+
* specified, the "01/01/05" would get parsed to "01/01/0005". However, even
81+
* with an "exactDateLength" specified, prepended zeros in the day or month
82+
* part may still allow for a shorter year part, so consider this as just
83+
* one more assertion that gets you closer to the intended date format.
8184
* @param dateFormat DateFormat to use for parsing and rendering
8285
* @param allowEmpty if empty strings should be allowed
8386
* @param exactDateLength the exact expected length of the date String

0 commit comments

Comments
 (0)