maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart McCulloch (JIRA)" <>
Subject [jira] (MNG-5446) AM/PM inconsistency in mng-3827 and mng-3864 ITs?
Date Sat, 09 Mar 2013 03:02:52 GMT


Stuart McCulloch commented on MNG-5446:

Proposed patch:
> AM/PM inconsistency in mng-3827 and mng-3864 ITs?
> -------------------------------------------------
>                 Key: MNG-5446
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Test
>          Components: Integration Tests
>            Reporter: Stuart McCulloch
>            Priority: Minor
> The mng-3827 and mng-3864 ITs both include the following Date parameter in their plugin
test configuration:
> {code}
> <dateParam>2008-11-09 11:59:03.0 PM</dateParam>
> {code}
> This parameter is then expected to be written out as:
> {code}
> 2008-11-09 11:59:03
> {code}
> This looks odd - I would expect "23:59:03" since the time is being written back out without
the AM/PM flag and {code}System.err.println(new Date());{code} uses the 24 hour clock on my
local JVM.
> I suspect there's a long-standing bug in the Plexus DateConverter where it parses the
date using a SimpleDateFormat of "yyyy-MM-dd HH:mm:ss.S a" for values with an AM/PM flag.
This format uses 'HH' to parse the hour as 'Hour in day (0-23)' rather than 'hh' to parse
it as 'Hour in am/pm (1-12)', which would explain why "11:59:03.0 PM" is written back as "11:59:03"
and not "23:59:03".
> If that's the case then I'd like to suggest the dateParam in the mng-3827 and mng-3864
ITs is changed to:
> {code}
> <dateParam>2008-11-09 11:59:03.0 AM</dateParam>
> {code}
> because that way the result would still match the expected "11:59:03" string if/when
the DateConverter is fixed (I'm doing some refactoring in the Sisu-Plexus internals to improve
re-use which touches on configuration).
> AFAICT these ITs don't appear to be testing this specific Date conversion behaviour (ie.
silently ignoring / dropping the PM flag), but if this isn't the case and the current behaviour
should be maintained for legacy reasons then I'd also like to know.
> Thanks in advance!

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message