Summary
The GeneralizedTime component inconsistently formats / parses the date when the year of the date is greater than 9999. During serialization, the year is serialized as is (e.g. 292278994), but the parsing process expects the year to be in YYYY format.
Steps To Reproduce ("Repro Steps")
@Test
public void testGeneralizedTimeMaxYear() {
String serialized = GeneralizedTime.valueOf(Long.MAX_VALUE).toString();
GeneralizedTime parsed = GeneralizedTime.valueOf(serialized);
}
The preceding test ends with the following exception:
org.forgerock.i18n.LocalizedIllegalArgumentException: The provided value "2922789940817071255.807Z" is not a valid generalized time value because "78" is not a valid month specification
at org.forgerock.opendj.ldap.GeneralizedTime.valueOf(GeneralizedTime.java:221)
Expected Result (Behavior You Expected to See)
The behaviour of the GeneralizedTime component will be consistent if the year is greater than 9999.
Summary
The
GeneralizedTimecomponent inconsistently formats / parses the date when the year of the date is greater than 9999. During serialization, the year is serialized as is (e.g.292278994), but the parsing process expects the year to be inYYYYformat.Steps To Reproduce ("Repro Steps")
The preceding test ends with the following exception:
Expected Result (Behavior You Expected to See)
The behaviour of the
GeneralizedTimecomponent will be consistent if the year is greater than 9999.