You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2011/01/23 06:25:04 UTC
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
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 {
*
* <p>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.</p>
+ * 2002 14:00:00.000. If this was passed with MONTH, it would
+ * return 1 Apr 2002 0:00:00.000.</p>
*
* @param date the date to work with
* @param field the field from <code>Calendar</code>
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"),