You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/08/15 17:37:36 UTC

DO NOT REPLY [Bug 45636] New: 2 tests for DateLayout are failing because of ill initialized DateFormat

https://issues.apache.org/bugzilla/show_bug.cgi?id=45636

           Summary: 2 tests for DateLayout are failing because of ill
                    initialized DateFormat
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: philippe.haution@mines-paris.org


Inside org.apache.log4j.helpers.DateLayoutTest, testISO8601Format() and
testDateTimeFormat() necessarily result in failures when run through an mvn
test in the root directory.

Indeed the ISO8601DateFormat and DateTimeFormat object responsible for this
issue have a memory of the previous date they formatted (kept as a long
representing the specified number of milliseconds since the standard base time
known as "the epoch", namely January 1, 1970, 00:00:00 GMT) and the resulting
String.

If they are asked again to format the same time, then they just return the
corresponding String without having to do the formatting again.

But both test cases require to format a date precisely corresponding to 01 Jan
1970 00:00, that is to say 0 ms since "the epoch", which is their initial
state.

The problem is the corresponding String is not properly initialized by their
constructor so they return a value of "000" and "01 Jan 1970 000" instead of
"1970-01-01 00:00:00,000" and "01 Jan 1970 00:00:00,000".


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45636] 2 tests for DateLayout are failing because of ill initialized DateFormat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45636


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Curt Arnold <ca...@apache.org>  2008-08-15 16:11:55 PST ---
Committed fix in rev 686415 that checks if the "cached" value has been
initialized.

I believe the test failures would only show up if your default TimeZone is GMT.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org