From c10bf728da5d8039b517c9e91086c9f93a31a4e1 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Tue, 6 Jan 2009 22:44:05 +0000 Subject: Merge GNU Classpath libgcj-snapshot-20090102. 2009-01-06 Andrew John Hughes Import GNU Classpath (libgcj-snapshot-20090102). * libjava/classpath/lib/java/text/RuleBasedCollator$CollationSorter.class, * libjava/classpath/lib/java/text/MessageFormat$MessageFormatElement.class, * libjava/classpath/lib/java/text/MessageFormat.class, * libjava/classpath/lib/java/text/SimpleDateFormat.class, * libjava/classpath/lib/java/text/NumberFormat.class, * libjava/classpath/lib/java/text/RuleBasedCollator$CollationElement.class, * libjava/classpath/lib/java/text/MessageFormat$Field.class, * libjava/classpath/lib/java/text/RuleBasedCollator.class, * libjava/classpath/lib/java/text/NumberFormat$Field.class, * libjava/classpath/lib/gnu/xml/transform/Bindings.class, * libjava/classpath/lib/gnu/java/locale/LocaleData.class, * libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class, * libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.class, * libjava/gnu/java/awt/peer/gtk/FreetypeGlyphVector.h, * libjava/java/text/MessageFormat.h, * libjava/java/text/RuleBasedCollator$CollationSorter.h, * libjava/java/text/RuleBasedCollator.h, * libjava/java/text/SimpleDateFormat.h: Regenerated. 2009-01-02 Andrew John Hughes * ChangeLog-2008: New file. 2009-01-02 Andrew John Hughes * java/text/MessageFormat.java: (setLocale(Locale)): Integer format should use NumberFormat.getIntegerInstance. libjava/classpath/ChangeLog-2008 2008-12-31 Andrew John Hughes * java/text/MessageFormat.java: (parse(String,ParsePosition)): Emulate behaviour of Vector's setSize() which was being implicitly relied on. 2008-12-31 Andrew John Hughes * java/text/SimpleDateFormat.java: Remove superfluous empty line introduced in last commit. 2008-12-31 Andrew John Hughes * java/text/MessageFormat.java: Convert variables to use generic types, use CPStringBuilder in place of StringBuilder. (Field()): Suppress warning due to only being used by deserialization. (scanFormat(String,int,CPStringBuilder,List,Locale)): Use ArrayList instead of Vector as no synchronisation needed. (parse(String,ParsePosition)): Likewise. * java/text/NumberFormat.java: (Field()): Suppress warning due to only being used by deserialization. * java/text/RuleBasedCollator.java: Convert variables to use generic types. (CollationElement): Make fields final. (CollationSorter): Likewise. (CollationSorter(int,String,int,boolean)): New constructor. * java/text/SimpleDateFormat.java, Convert variables to use generic types. (applyPattern(String)): Clear list rather than creating a new instance. 2008-12-30 Andrew John Hughes * java/text/SimpleDateFormat.java: (standardChars): Use standard characters from CLDR. (RFC822_TIMEZONE_FIELD): Fixed to match new standard characters. 2008-12-22 Andrew John Hughes * java/lang/String.java: (byte[],int,int,String): Call new Charset method. (stringToCharset(String)): Private method added to handle exception conversion. (byte[],int,int,Charset): Implemented. (byte[], Charset): Likewise. (getBytes(String)): Call new Charset method. (getBytes(Charset)): Implemented. 2008-12-18 Andrew John Hughes * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c: Include '\0' in the string. 2008-12-09 Andrew John Hughes PR classpath/38473: * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c: (Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative): Check that the glyph is an outline before calling FT_Outline_Decompose. 2008-11-16 Andrew John Hughes * gnu/xml/transform/Bindings.java: Add generics to collections. 2008-11-16 Andrew John Hughes * gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.java: (init(int,SecureRandom)): Improve exception message. 2008-11-06 Mark Wielaard * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c (getKerning): Removed unused cls, method, values. 2008-11-05 Andrew Haley * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java (getKerning): Return result in a float[], not a Point2D. (performDefaultLayout): Call getKerning with a float[]. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c (getKerning): Return result in a float[], not a Point2D. 2008-11-05 Andrew Haley * tools/Makefile.am (UPDATE_TOOLS_ZIP, CREATE_TOOLS_ZIP): Exclude .svn direcories. 2008-10-23 David Edelsohn * native/fdlibm/fdlibm.h: Undef hz. 2008-10-20 Andrew John Hughes * m4/ac_prog_antlr.m4: Remove redundant checks. * tools/Makefile.am: Use gjdoc_gendir when calling antlr. 2008-10-17 Robert Lougher * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector): Release 'fonts'. 2008-10-16 Tom Tromey * tools/gnu/classpath/tools/jar/WorkSet.java (initSet): Use foreach. Change argument type. (WorkSet): Change argument type. * tools/gnu/classpath/tools/jar/Indexer.java (indexJarFile): Use foreach. * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Use foreach. (getAllEntries): Likewise. 2008-10-15 Andrew John Hughes * configure.ac: Remove superfluous AC_PROG_JAVA call. From-SVN: r143139 --- libjava/classpath/java/text/SimpleDateFormat.java | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'libjava/classpath/java/text/SimpleDateFormat.java') 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 CompiledFields, + * A list of CompiledFields and {@code String}s * representing the compiled version of the pattern. * * @see CompiledField * @serial Ignored. */ - private transient ArrayList tokens; + private transient ArrayList 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(); 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(); 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(); 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(); 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 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) == '\'') { -- cgit v1.2.3