From 5f7e26a978322dd6d09459ecdbefb7a389a86652 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Sun, 27 Jun 2004 06:29:29 +0000 Subject: [PATCH] flipped from being hardcoded to GregorianCalendar to using getInstance. Cannot think of any reason why a GregorianCalendar was being created directly git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137855 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/lang/time/DateUtils.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/commons/lang/time/DateUtils.java b/src/java/org/apache/commons/lang/time/DateUtils.java index e7d22e047..9171bd9b7 100644 --- a/src/java/org/apache/commons/lang/time/DateUtils.java +++ b/src/java/org/apache/commons/lang/time/DateUtils.java @@ -17,7 +17,6 @@ package org.apache.commons.lang.time; import java.util.Calendar; import java.util.Date; -import java.util.GregorianCalendar; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.TimeZone; @@ -32,7 +31,7 @@ import java.util.TimeZone; * @author Gary Gregory * @author Phil Steitz * @since 2.0 - * @version $Id: DateUtils.java,v 1.18 2004/02/18 22:56:42 ggregory Exp $ + * @version $Id: DateUtils.java,v 1.19 2004/06/27 06:29:29 bayard Exp $ */ public class DateUtils { @@ -134,7 +133,7 @@ public class DateUtils { if (date == null) { throw new IllegalArgumentException("The date must not be null"); } - GregorianCalendar gval = new GregorianCalendar(); + Calendar gval = Calendar.getInstance(); gval.setTime(date); modify(gval, field, true); return gval.getTime(); @@ -214,7 +213,7 @@ public class DateUtils { if (date == null) { throw new IllegalArgumentException("The date must not be null"); } - GregorianCalendar gval = new GregorianCalendar(); + Calendar gval = Calendar.getInstance(); gval.setTime(date); modify(gval, field, false); return gval.getTime(); @@ -502,7 +501,7 @@ public class DateUtils { if (focus == null) { throw new IllegalArgumentException("The date must not be null"); } - GregorianCalendar gval = new GregorianCalendar(); + Calendar gval = Calendar.getInstance(); gval.setTime(focus); return iterator(gval, rangeStyle); }