commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r1099402 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
Date Wed, 04 May 2011 10:39:14 GMT
Author: scolebourne
Date: Wed May  4 10:39:14 2011
New Revision: 1099402

URL: http://svn.apache.org/viewvc?rev=1099402&view=rev
Log:
Change Calendar.getInstance to new GregorianCalendar

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java?rev=1099402&r1=1099401&r2=1099402&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
Wed May  4 10:39:14 2011
@@ -26,6 +26,7 @@ import java.text.ParsePosition;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.GregorianCalendar;
 import java.util.List;
 import java.util.Locale;
 import java.util.TimeZone;
@@ -690,13 +691,13 @@ public class FastDateFormat extends Form
     }
 
     /**
-     * <p>Formats a {@code Date} object.</p>
+     * <p>Formats a {@code Date} object using a {@code GregorianCalendar}.</p>
      *
      * @param date  the date to format
      * @return the formatted string
      */
     public String format(Date date) {
-        Calendar c = Calendar.getInstance(mTimeZone, mLocale);
+        Calendar c = new GregorianCalendar(mTimeZone, mLocale);  // hard code GregorianCalendar
         c.setTime(date);
         return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString();
     }
@@ -726,14 +727,14 @@ public class FastDateFormat extends Form
 
     /**
      * <p>Formats a {@code Date} object into the
-     * supplied {@code StringBuffer}.</p>
+     * supplied {@code StringBuffer} using a {@code GregorianCalendar}.</p>
      *
      * @param date  the date to format
      * @param buf  the buffer to format into
      * @return the specified string buffer
      */
     public StringBuffer format(Date date, StringBuffer buf) {
-        Calendar c = Calendar.getInstance(mTimeZone, mLocale);
+        Calendar c = new GregorianCalendar(mTimeZone, mLocale);  // hard code GregorianCalendar
         c.setTime(date);
         return applyRules(c, buf);
     }



Mime
View raw message