Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 27842 invoked from network); 23 Jan 2011 05:25:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jan 2011 05:25:29 -0000 Received: (qmail 95020 invoked by uid 500); 23 Jan 2011 05:25:28 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 94682 invoked by uid 500); 23 Jan 2011 05:25:25 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 94674 invoked by uid 99); 23 Jan 2011 05:25:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jan 2011 05:25:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jan 2011 05:25:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4D52523889D5; Sun, 23 Jan 2011 05:25:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1062326 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/time/DateUtils.java test/java/org/apache/commons/lang3/time/DateUtilsTest.java Date: Sun, 23 Jan 2011 05:25:04 -0000 To: commits@commons.apache.org From: bayard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110123052504.4D52523889D5@eris.apache.org> Author: bayard Date: Sun Jan 23 05:25:03 2011 New Revision: 1062326 URL: http://svn.apache.org/viewvc?rev=1062326&view=rev Log: Fixing javadoc for DateUtils.ceiling per LANG-672 Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java?rev=1062326&r1=1062325&r2=1062326&view=diff ============================================================================== --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java Sun Jan 23 05:25:03 2011 @@ -848,8 +848,8 @@ public class DateUtils { * *

For example, if you had the datetime of 28 Mar 2002 * 13:45:01.231, if you passed with HOUR, it would return 28 Mar - * 2002 13:00:00.000. If this was passed with MONTH, it would - * return 1 Mar 2002 0:00:00.000.

+ * 2002 14:00:00.000. If this was passed with MONTH, it would + * return 1 Apr 2002 0:00:00.000.

* * @param date the date to work with * @param field the field from Calendar Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java?rev=1062326&r1=1062325&r2=1062326&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java Sun Jan 23 05:25:03 2011 @@ -1177,6 +1177,18 @@ public class DateUtilsTest extends TestC * Tests various values with the ceiling method */ public void testCeil() throws Exception { + // test javadoc + assertEquals("ceiling javadoc-1 failed", + dateTimeParser.parse("March 28, 2002 14:00:00.000"), + DateUtils.ceiling( + dateTimeParser.parse("March 28, 2002 13:45:01.231"), + Calendar.HOUR)); + assertEquals("ceiling javadoc-2 failed", + dateTimeParser.parse("April 1, 2002 00:00:00.000"), + DateUtils.ceiling( + dateTimeParser.parse("March 28, 2002 13:45:01.231"), + Calendar.MONTH)); + // tests public static Date ceiling(Date date, int field) assertEquals("ceiling year-1 failed", dateParser.parse("January 1, 2003"),