-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0, 1.3.0
-
None
-
b28
-
sparc
-
solaris_2.5, solaris_2.6
Name: ksC84122 Date: 08/30/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.
======================================================================
- duplicates
-
JDK-4267208 java.util.GregorianCalendar unclear doc regarding lenient
- Closed
-
JDK-4147269 java.util.GregorianCalendar.computeTime() works wrong when lenient is false
- Closed
- relates to
-
JDK-6485772 (tz) java 5.0_08 unable to parse 1930's DST days,throwing java.text.ParseException: Unparseable date
- Closed
-
JDK-5024487 jit/symcjit/4139729/Calendar/CalendarTest throws java.lang.RuntimeException
- Closed
-
JDK-6247963 REGRESSION: SimpleDateFormat.setLenient (false) behavior changed with jdk1.5.0
- Closed