Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C423311E5F for ; Fri, 2 May 2014 22:16:20 +0000 (UTC) Received: (qmail 99495 invoked by uid 500); 2 May 2014 22:16:17 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 99412 invoked by uid 500); 2 May 2014 22:16:17 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 99402 invoked by uid 99); 2 May 2014 22:16:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 22:16:16 +0000 Date: Fri, 2 May 2014 22:16:15 +0000 (UTC) From: "Michael Osipov (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (LANG-1003) DurationFormatUtils are not able to handle negative durations/periods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov reopened LANG-1003: ---------------------------------- Reopening because you forgot to document those runtime exception with {{@throws}}. > 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} > It should throw an {{IllegalArgumentException}} if duration is < 0 or period diff is < 0. -- This message was sent by Atlassian JIRA (v6.2#6252)