commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1003) DurationFormatUtils are not able to handle negative durations/periods
Date Fri, 02 May 2014 09:23:17 GMT

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

Benedikt Ritter commented on LANG-1003:
---------------------------------------

Thanks for the report!

{code}
bene@localhost:~/workspace/apache/commons/lang$ svn ci -m "LANG-1003: DurationFormatUtils
are not able to handle negative durations/periods. Reported by Michael Osipov."
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
Sending        src/test/java/org/apache/commons/lang3/time/DurationFormatUtilsTest.java
Transmitting file data ...
Committed revision 1591840.
{code}

> DurationFormatUtils are not able to handle negative durations/periods
> ---------------------------------------------------------------------
>
>                 Key: LANG-1003
>                 URL: https://issues.apache.org/jira/browse/LANG-1003
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.text.*
>    Affects Versions: 3.3.2
>            Reporter: Michael Osipov
>            Assignee: Benedikt Ritter
>            Priority: Critical
>             Fix For: 3.4
>
>
> It spits out complete garbage.
> {code}
> System.out.println(DurationFormatUtils.formatDurationHMS(-3454));
> System.out.println(DurationFormatUtils.formatPeriodISO(4000, 3000));
> {code}
> {noformat}
> 0:00:-3.-454
> P-1Y11M30DT23H59M59.000S
> {noformat}
> I should throw an {{IllegalArgumentException}} if duration is < 0 or period diff is
< 0.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message