Removing deprecated fields in DateUtils as per LANG-438
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@753624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
798b3306f8
commit
cba79c706b
|
@ -407,9 +407,8 @@ public class DateUtils {
|
|||
* @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 @@ public class DateUtils {
|
|||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 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;
|
||||
|
||||
}
|
||||
|
|
|
@ -437,25 +437,6 @@ public class DateUtilsTest extends TestCase {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue