[cp-patches] Patch: FYI: PR 27905

Tom Tromey tromey at redhat.com
Wed Jun 7 19:15:38 UTC 2006


I'm checking this in.

This fixes PR 27905.  We weren't registering all the nio charsets we
implement.

Tom

2006-06-07  Tom Tromey  <tromey at redhat.com>

	PR classpath/27905:
	* gnu/java/nio/charset/Provider.java (loadExtended): Now synchronized.
	Added missing charsets.
	(charsetForName): Don't check 'extendedLoaded'.

Index: gnu/java/nio/charset/Provider.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/charset/Provider.java,v
retrieving revision 1.9
diff -u -r1.9 Provider.java
--- gnu/java/nio/charset/Provider.java	20 Feb 2006 19:20:49 -0000	1.9
+++ gnu/java/nio/charset/Provider.java	7 Jun 2006 16:14:21 -0000
@@ -155,9 +155,9 @@
  /**
   * Load non-mandatory charsets.
   */
-  private void loadExtended ()
+  private synchronized void loadExtended ()
   {
-    if(extendedLoaded)
+    if (extendedLoaded)
       return;
 
     addCharset (new ISO_8859_3 ());    // ISO-8859-3 aka ISO-LATIN-3
@@ -165,6 +165,12 @@
     addCharset (new ISO_8859_8 ());    // ISO-8859-8 (Hebrew)
 
     // Some more codepages
+    addCharset (new Cp424());
+    addCharset (new Cp437());
+    addCharset (new Cp737());
+    addCharset (new Cp775());
+    addCharset (new Cp850());
+    addCharset (new Cp852());
     addCharset (new Cp855()); // IBM Cyrillic
     addCharset (new Cp857()); // IBM Turkish
     addCharset (new Cp860()); // MSDOS Portugese
@@ -176,6 +182,24 @@
     addCharset (new Cp866()); // MSDOS Russian
     addCharset (new Cp869()); // IBM modern Greek
     addCharset (new Cp874()); // IBM Thai
+
+    addCharset (new MacCentralEurope());
+    addCharset (new MacCroatian());
+    addCharset (new MacCyrillic());
+    addCharset (new MacDingbat());
+    addCharset (new MacGreek());
+    addCharset (new MacIceland());
+    addCharset (new MacRoman());
+    addCharset (new MacRomania());
+    addCharset (new MacSymbol());
+    addCharset (new MacThai());
+    addCharset (new MacTurkish());
+    addCharset (new MS874());
+
+    addCharset (new Windows1255());
+    addCharset (new Windows1256());
+    addCharset (new Windows1258());
+
     extendedLoaded = true;
   }
 
@@ -199,7 +223,7 @@
   public Charset charsetForName (String charsetName)
   {
     Charset cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase()));
-    if(cs == null && !extendedLoaded)
+    if (cs == null)
      {
        loadExtended();
        cs = (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase()));



More information about the Classpath-patches mailing list