commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-942) Test failure in FastDateParserTest and FastDateFormat_ParserTest when building with JDK8
Date Sat, 04 Jan 2014 02:56:51 GMT

    [ https://issues.apache.org/jira/browse/LANG-942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13862171#comment-13862171
] 

Bruno P. Kinoshita commented on LANG-942:
-----------------------------------------

Ok, found the reason why it is IET instead of US/Michigan. 

So FastDateParser builds a map of all available time zones. The key of the map is the time
zone display name (long, short, with daylight and without daylight). 

Multiple time zones have the same long name. So, for instance, the following time zones, in
JDK1.6 and 1.7, have the long name, with daylight, equal to "Eastern Daylight Time":

- America/Atikokan
- America/Cayman
- America/Coral_Harbour
- America/Detroit
- America/Fort_Wayne
- America/Grand_Turk
- America/Indiana/Indianapolis
- America/Indiana/Marengo
- America/Indiana/Petersburg
- America/Indiana/Vevay
- America/Indiana/Vincennes
- America/Indiana/Winamac
- America/Indianapolis
- America/Iqaluit
- America/Jamaica
- America/Kentucky/Louisville
- America/Kentucky/Monticello
- America/Louisville
- America/Montreal
- America/Nassau
- America/New_York
- America/Nipigon
- America/Panama
- America/Pangnirtung
- America/Port-au-Prince
- America/Thunder_Bay
- America/Toronto
- Canada/Eastern
- EST
- EST5EDT
- IET
- Jamaica
- SystemV/EST5
- SystemV/EST5EDT
- US/East-Indiana
- US/Eastern
- US/Michigan

In JDK8, the java.time, and parts of java.util related to time/date are being modified/rewritten.
Somewhere in one of these changes, the order of these entries changed. Notice that the latest
entry is US/Michigan, that is the value returned by the FastDateParser$TimeZoneStrategy for
"Eastern Daylight Time". Now with JDK1.8:

- America/Atikokan
- America/Cayman
- America/Coral_Harbour
- America/Detroit
- America/Fort_Wayne
- America/Grand_Turk
- America/Indiana/Indianapolis
- America/Indiana/Marengo
- America/Indiana/Petersburg
- America/Indiana/Vevay
- America/Indiana/Vincennes
- America/Indiana/Winamac
- America/Indianapolis
- America/Iqaluit
- America/Jamaica
- America/Kentucky/Louisville
- America/Kentucky/Monticello
- America/Louisville
- America/Montreal
- America/Nassau
- America/New_York
- America/Nipigon
- America/Panama
- America/Pangnirtung
- America/Port-au-Prince
- America/Thunder_Bay
- America/Toronto
- Canada/Eastern
- EST5EDT
- Jamaica
- SystemV/EST5
- SystemV/EST5EDT
- US/East-Indiana
- US/Eastern
- US/Michigan
- EST
- IET

Yup, now IET is the last element, and the one that gets added as value to the "Eastern Daylight
Time" key, in the map of time zones used by the TimeZoneStrategy. This time zone seems to
be the responsible for returning a different hour (probably the number of transitions interfere
here, but I have no idea what transitions are used in dst).

> Test failure in FastDateParserTest and FastDateFormat_ParserTest when building with JDK8
> ----------------------------------------------------------------------------------------
>
>                 Key: LANG-942
>                 URL: https://issues.apache.org/jira/browse/LANG-942
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.time.*
>    Affects Versions: 3.2
>         Environment: JDK8
>            Reporter: Benedikt Ritter
>             Fix For: 3.2.1
>
>
> The following failure is thrown when using JDK 8:
> {code}
> -------------------------------------------------------------------------------
> Test set: org.apache.commons.lang3.time.FastDateFormat_ParserTest
> -------------------------------------------------------------------------------
> Tests run: 29, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.315 sec <<<
FAILURE! - in org.apache.commons.lang3.time.FastDateFormat_ParserTest
> testParseZone(org.apache.commons.lang3.time.FastDateFormat_ParserTest)  Time elapsed:
0.005 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<Thu Jul 10 22:33:20 CEST 2003> but was:<Thu
Jul 10 23:33:20 CEST 2003>
> 	at org.junit.Assert.fail(Assert.java:88)
> 	at org.junit.Assert.failNotEquals(Assert.java:743)
> 	at org.junit.Assert.assertEquals(Assert.java:118)
> 	at org.junit.Assert.assertEquals(Assert.java:144)
> 	at org.apache.commons.lang3.time.FastDateParserTest.testParseZone(FastDateParserTest.java:119)
> 	[...]
> {code}
> It is caused by the following assertion in FastDateParserTest (from which FastDateFormat_ParserTest
inherits):
> {code:java}
> assertEquals(cal.getTime(), fdf.parse("2003-07-10T16:33:20.000 Eastern Daylight Time"));
> {code}
> {{FastDateParserTest}} fails with the same error.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message