[jira] [Comment Edited] (LANG-1004) DurationFormatUtils#formatDurationHMS implementation does not correspond to Javadoc and vice versa

2014-05-04 Thread Michael Osipov (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989081#comment-13989081
 ] 

Michael Osipov edited comment on LANG-1004 at 5/4/14 6:27 PM:
--

With pleasure, being a Commons Lang user for several years and an Apache Maven 
committer, that's the least I can do.


was (Author: michael-o):
With pleasure, being a Commons Lang user for several years and an Apache Maven 
committer, that

 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
Assignee: Benedikt Ritter
 Fix For: 3.4

 Attachments: LANG-1004.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)


[jira] [Comment Edited] (LANG-1004) DurationFormatUtils#formatDurationHMS implementation does not correspond to Javadoc and vice versa

2014-05-02 Thread Benedikt Ritter (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987919#comment-13987919
 ] 

Benedikt Ritter edited comment on LANG-1004 at 5/2/14 5:10 PM:
---

Hi Michael,

nice patch! However I'm a bit afraid this change will break clients that are 
using the method as it is now. What do you think? The main use case is probably 
formatting for displaying a value (in the GUI or in some kind of log file). So 
it may not be a problem?

Benedikt

EDIT: how about providing a new method called {{formatDurationISOHMS}} which 
formats the way you propose?


was (Author: britter):
Hi Michael,

nice patch! However I'm a bit afraid this change will break clients that are 
using the method as it is now. What do you think? The main use case is probably 
formatting for displaying a value (in the GUI or in some kind of log file). So 
it may not be a problem?

Benedikt

 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


 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)


[jira] [Comment Edited] (LANG-1004) DurationFormatUtils#formatDurationHMS implementation does not correspond to Javadoc and vice versa

2014-05-02 Thread Michael Osipov (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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=340413page=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=340413page=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)