summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/text/SimpleDateFormat.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/text/SimpleDateFormat.java')
-rw-r--r--libjava/classpath/java/text/SimpleDateFormat.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/libjava/classpath/java/text/SimpleDateFormat.java b/libjava/classpath/java/text/SimpleDateFormat.java
index 4dcda4f487c..b09c7caa28d 100644
--- a/libjava/classpath/java/text/SimpleDateFormat.java
+++ b/libjava/classpath/java/text/SimpleDateFormat.java
@@ -159,13 +159,13 @@ public class SimpleDateFormat extends DateFormat
}
/**
- * A list of <code>CompiledField</code>s,
+ * A list of <code>CompiledField</code>s and {@code String}s
* representing the compiled version of the pattern.
*
* @see CompiledField
* @serial Ignored.
*/
- private transient ArrayList tokens;
+ private transient ArrayList<Object> tokens;
/**
* The localised data used in formatting,
@@ -235,8 +235,8 @@ public class SimpleDateFormat extends DateFormat
*/
private static final long serialVersionUID = 4774881970558875024L;
- // This string is specified in the Java class libraries.
- private static final String standardChars = "GyMdkHmsSEDFwWahKzZ";
+ // This string is specified in the root of the CLDR.
+ private static final String standardChars = "GyMdkHmsSEDFwWahKzYeugAZvcL";
/**
* Represents the position of the RFC822 timezone pattern character
@@ -244,7 +244,7 @@ public class SimpleDateFormat extends DateFormat
* U.S. locale, this is 'Z'. The value is the offset of the current
* time from GMT e.g. -0500 would be five hours prior to GMT.
*/
- private static final int RFC822_TIMEZONE_FIELD = 18;
+ private static final int RFC822_TIMEZONE_FIELD = 23;
/**
* Reads the serialized version of this object.
@@ -274,7 +274,7 @@ public class SimpleDateFormat extends DateFormat
set2DigitYearStart(defaultCenturyStart);
// Set up items normally taken care of by the constructor.
- tokens = new ArrayList();
+ tokens = new ArrayList<Object>();
try
{
compileFormat(pattern);
@@ -416,7 +416,7 @@ public class SimpleDateFormat extends DateFormat
Locale locale = Locale.getDefault();
calendar = new GregorianCalendar(locale);
computeCenturyStart();
- tokens = new ArrayList();
+ tokens = new ArrayList<Object>();
formatData = new DateFormatSymbols(locale);
pattern = (formatData.dateFormats[DEFAULT] + ' '
+ formatData.timeFormats[DEFAULT]);
@@ -454,7 +454,7 @@ public class SimpleDateFormat extends DateFormat
super();
calendar = new GregorianCalendar(locale);
computeCenturyStart();
- tokens = new ArrayList();
+ tokens = new ArrayList<Object>();
formatData = new DateFormatSymbols(locale);
compileFormat(pattern);
this.pattern = pattern;
@@ -479,7 +479,7 @@ public class SimpleDateFormat extends DateFormat
super();
calendar = new GregorianCalendar();
computeCenturyStart ();
- tokens = new ArrayList();
+ tokens = new ArrayList<Object>();
if (formatData == null)
throw new NullPointerException("formatData");
this.formatData = formatData;
@@ -524,7 +524,7 @@ public class SimpleDateFormat extends DateFormat
*/
public void applyPattern(String pattern)
{
- tokens = new ArrayList();
+ tokens.clear();
compileFormat(pattern);
this.pattern = pattern;
}
@@ -697,11 +697,10 @@ public class SimpleDateFormat extends DateFormat
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos)
{
String temp;
- AttributedCharacterIterator.Attribute attribute;
calendar.setTime(date);
// go through vector, filling in fields where applicable, else toString
- Iterator iter = tokens.iterator();
+ Iterator<Object> iter = tokens.iterator();
while (iter.hasNext())
{
Object o = iter.next();
@@ -910,7 +909,6 @@ public class SimpleDateFormat extends DateFormat
char ch = pattern.charAt(fmt_index);
if (ch == '\'')
{
- int index = pos.getIndex();
if (fmt_index < fmt_max - 1
&& pattern.charAt(fmt_index + 1) == '\'')
{
OpenPOWER on IntegriCloud