Duplicate :
|
|
Duplicate :
|
|
Relates :
|
Name: ksC84122 Date: 08/31/99 The javadoc for java.util.GregorianCalendar.setLenient() (see java.util.Calendar.setLenient() ) states: ----- Specify whether or not date/time interpretation is to be lenient. With lenient interpretation, a date such as "February 942, 1996" will be treated as being equivalent to the 941st day after February 1, 1996. With strict interpretation, such dates will cause an exception to be thrown. ----- However, if java.util.GregorianCalendar.setLenient(false) is called, date of January WEEK_OF_MONTH 6, 1996 is interpreted as February 7, 1996 and no exception is thrown. The reason this is happening is that the GregorianCalendar validation code uses getMaximum() to validate non-lenient input instead of getActualMaximum(). (See Bug Id 4147269). This behavior should be explicitly specified in the javadoc. ======================================================================
|