[
https://issues.apache.org/jira/browse/LANG-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13988341#comment-13988341
]
Michael Osipov edited comment on LANG-1004 at 5/2/14 10:26 PM:
---------------------------------------------------------------
I guess you are right about the usecase but we *cannot* do assumptions about
the client. So the impact should be minimal. In this case, we should stick to
{{HH:mm:ss.SSS}} and improve the docs. However, we could spawn another ticket
for Lang 4 to split method into two methods, one for {{HH:mm:ss}} and one
{{formatDurationHMSwithFrac}} or something like this (maybe a boolean flag)
which will use {{HH:mm:ss.SSS}}. Same applies for the ISO duration of course.
I wouldn't bloat the API with another method but I would rather add something
like I did for
[MNG-5176|https://jira.codehaus.org/browse/MNG-5176?focusedCommentId=340413&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-340413].
was (Author: michael-o):
I guess you are right about the usecase but we *cannot* do assumptions about
the client. So the impact should be minimal. In this case, she should stick to
{{HH:mm:ss.SSS}} and improve the docs. However, would could spawn another
ticket for Lang 4 to split method into two methods, one for {{HH:mm:ss}} and
one {{formatDurationHMSwithFrac}} or something like this (maybe a boolean flag)
which will use {{HH:mm:ss.SSS}}. Same applies for the ISO duration of course.
I wouldn't bloat the API with another method but I would rather add something
like I did for
[MNG-5176|https://jira.codehaus.org/browse/MNG-5176?focusedCommentId=340413&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-340413].
> DurationFormatUtils#formatDurationHMS implementation does not correspond to
> Javadoc and vice versa
> --------------------------------------------------------------------------------------------------
>
> Key: LANG-1004
> URL: https://issues.apache.org/jira/browse/LANG-1004
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.text.*
> Affects Versions: 3.3.2
> Reporter: Michael Osipov
> Fix For: Patch Needed
>
> Attachments: LANG-1004.patch, LANG-1004_v2.patch
>
>
> This method has several flaws:
> 1. Javadoc says: "The format used is ISO8601-like: H:m:s.S." but the method
> call supplies "H:mm:ss.SSS"
> 2. ISO time never omits leading zeros, so the proper pattern must be
> "HH:mm:ss.SSS"
> 3. The method name says: "HMS" but includes the second fraction.
> Since the use of fractions is optional, the method should use "HH:mm:ss" and
> update the Javadoc as well.
--
This message was sent by Atlassian JIRA
(v6.2#6252)