You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2015/03/13 21:31:38 UTC

[jira] [Comment Edited] (LANG-1092) Wrong formating of time zones with daylight saving time in FastDatePrinter

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

Benedikt Ritter edited comment on LANG-1092 at 3/13/15 8:31 PM:
----------------------------------------------------------------

{code}
$ svn ci -m "LANG-1092: Wrong formating of time zones with daylight saving time in FastDatePrinter"
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
Sending        src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
Transmitting file data ...
Committed revision 1666568.
{code}

I've changed the TimeZoneNameRule to only check the calendar for DST_OFFSET. All tests pass with the following JDKs:
* 1.6
* 1.7.0_71
* 1.7.0_75
* 1.8.0_25
* 1.9.0 EA


was (Author: britter):
{code}
$ svn ci -m "LANG-1092: Wrong formating of time zones with daylight saving time in FastDatePrinter"
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
Sending        src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java
Transmitting file data ...
Committed revision 1666568.
{code}

I've changes the TimeZoneNameRule to only check the calendar for DST_OFFSET. All tests pass with the following JDKs:
* 1.6
* 1.7.0_71
* 1.7.0_75
* 1.8.0_25
* 1.9.0 EA

> Wrong formating of time zones with daylight saving time in FastDatePrinter
> --------------------------------------------------------------------------
>
>                 Key: LANG-1092
>                 URL: https://issues.apache.org/jira/browse/LANG-1092
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>    Affects Versions: 3.3.2
>            Reporter: Henri Yandell
>            Assignee: Benedikt Ritter
>             Fix For: 3.4
>
>
> At work we're getting build issues with Lang 3.3.2 (and any since 3.2 when the test code was introduced in LANG-818).  The test org.apache.commons.lang3.time.FastDatePrinterTest.testCalendarTimezoneRespected picks a timezone and runs a test on it. One assumes that timezones usually work, but some are not - so it depends on the order of timezones returned by TimeZone.getAvailableIDs().
> This would seem to imply a daylight savings time bug in FastDateFormat. This may be the same issue as LANG-916.
> If you adjust the for loop such that the test is within the loop and happens on every timezone, you will hit timezones that fail.  e.g.:
> {code}
> Index: FastDatePrinterTest.java
> ===================================================================
> --- FastDatePrinterTest.java	(revision 1665715)
> +++ FastDatePrinterTest.java	(working copy)
> @@ -269,8 +269,6 @@
>          for (final String zone : availableZones) {
>              if (!zone.equals(currentZone.getID())) {
>                  anotherZone = TimeZone.getTimeZone(zone);
> -            }
> -        }
>          
>          assertNotNull("Cannot find another timezone", anotherZone);
>          
> @@ -282,6 +280,8 @@
>          final String expectedValue = sdf.format(cal.getTime());
>          final String actualValue = FastDateFormat.getInstance(pattern).format(cal);
>          assertEquals(expectedValue, actualValue);
> +            }
> +        }
>      }
>      
>      @Test
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)