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 2009/03/14 10:57:47 UTC

svn commit: r753624 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/time/DateUtils.java test/org/apache/commons/lang/time/DateUtilsTest.java

Author: bayard
Date: Sat Mar 14 09:57:47 2009
New Revision: 753624

URL: http://svn.apache.org/viewvc?rev=753624&view=rev
Log:
Removing deprecated fields in DateUtils as per LANG-438

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java?rev=753624&r1=753623&r2=753624&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java Sat Mar 14 09:57:47 2009
@@ -407,9 +407,8 @@
      * @param amount  the amount to add, may be negative
      * @return the new date object with the amount added
      * @throws IllegalArgumentException if the date is null
-     * @deprecated Will become privately scoped in 3.0
      */
-    public static Date add(Date date, int calendarField, int amount) {
+    private static Date add(Date date, int calendarField, int amount) {
         if (date == null) {
             throw new IllegalArgumentException("The date must not be null");
         }
@@ -1616,33 +1615,4 @@
         }
     }
     
-    //------------------------------------------------------------------------- 
-    // Deprecated int constants
-    // TODO: Remove in 3.0
-    
-    /**
-     * Number of milliseconds in a standard second.
-     * 
-     * @deprecated Use MILLIS_PER_SECOND. This will be removed in Commons Lang 3.0.
-     */
-    public static final int MILLIS_IN_SECOND = 1000;
-    /**
-     * Number of milliseconds in a standard minute.
-     * 
-     * @deprecated Use MILLIS_PER_MINUTE. This will be removed in Commons Lang 3.0.
-     */
-    public static final int MILLIS_IN_MINUTE = 60 * 1000;
-    /**
-     * Number of milliseconds in a standard hour.
-     * 
-     * @deprecated Use MILLIS_PER_HOUR. This will be removed in Commons Lang 3.0.
-     */
-    public static final int MILLIS_IN_HOUR = 60 * 60 * 1000;
-    /**
-     * Number of milliseconds in a standard day.
-     * 
-     * @deprecated Use MILLIS_PER_DAY. This will be removed in Commons Lang 3.0.
-     */
-    public static final int MILLIS_IN_DAY = 24 * 60 * 60 * 1000;
-    
 }

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java?rev=753624&r1=753623&r2=753624&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java Sat Mar 14 09:57:47 2009
@@ -437,25 +437,6 @@
         assertDate(result, 2000, 6, 5, 4, 3, 2, 0);
     }
 
-    //-----------------------------------------------------------------------
-    public void testAddByField() throws Exception {
-        Date base = new Date(MILLIS_TEST);
-        Date result = DateUtils.add(base, Calendar.YEAR, 0);
-        assertNotSame(base, result);
-        assertDate(base, 2000, 6, 5, 4, 3, 2, 1);
-        assertDate(result, 2000, 6, 5, 4, 3, 2, 1);
-        
-        result = DateUtils.add(base, Calendar.YEAR, 1);
-        assertNotSame(base, result);
-        assertDate(base, 2000, 6, 5, 4, 3, 2, 1);
-        assertDate(result, 2001, 6, 5, 4, 3, 2, 1);
-        
-        result = DateUtils.add(base, Calendar.YEAR, -1);
-        assertNotSame(base, result);
-        assertDate(base, 2000, 6, 5, 4, 3, 2, 1);
-        assertDate(result, 1999, 6, 5, 4, 3, 2, 1);
-    }
-    
 	// -----------------------------------------------------------------------
 	public void testSetYears() throws Exception {
 		Date base = new Date(MILLIS_TEST);