[kaffe] CVS kaffe (robilad): resynced with gnu classpath: locale fix

Kaffe CVS cvs-commits at kaffe.org
Thu May 26 05:43:18 PDT 2005


PatchSet 6577 
Date: 2005/05/26 12:32:42
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with gnu classpath: locale fix

Members: 
	ChangeLog:1.4104->1.4105 
	libraries/javalib/java/util/Locale.java:1.25->1.26 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4104 kaffe/ChangeLog:1.4105
--- kaffe/ChangeLog:1.4104	Thu May 26 12:20:13 2005
+++ kaffe/ChangeLog	Thu May 26 12:32:42 2005
@@ -2,6 +2,15 @@
 
         Resynced with GNU Classpath.
 	
+	2005-05-25  Michael Koch  <konqueror at gmx.de>
+
+	* java/util/Locale.java (getISOStrings):
+	Re-implemented for locale properties files.
+
+2005-05-26  Dalibor Topic  <robilad at kaffe.org>
+
+        Resynced with GNU Classpath.
+	
 	2005-05-24  Thomas Fitzsimmons  <fitzsim at redhat.com>
 
 	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
Index: kaffe/libraries/javalib/java/util/Locale.java
diff -u kaffe/libraries/javalib/java/util/Locale.java:1.25 kaffe/libraries/javalib/java/util/Locale.java:1.26
--- kaffe/libraries/javalib/java/util/Locale.java:1.25	Sat May 21 14:53:26 2005
+++ kaffe/libraries/javalib/java/util/Locale.java	Thu May 26 12:32:46 2005
@@ -453,33 +453,35 @@
    */
   private static String[] getISOStrings(String tableName)
   {
-    List tempList;
-    ResourceBundle bundle;
-    Enumeration keys;
     int count = 0;
-    String[] strings;
+    ResourceBundle bundle =
+      ResourceBundle.getBundle("gnu.java.locale.LocaleInformation");
+    Enumeration e = bundle.getKeys();
+    ArrayList tempList = new ArrayList();
 
-    tempList = new ArrayList();
-    bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation");
-    keys = ((Hashtable) bundle.getObject(tableName)).keys();
-    while (keys.hasMoreElements())
+    while (e.hasMoreElements())
       {
-	String nextString;
-
-	nextString = (String) keys.nextElement();
-	if (nextString.length() == 2 &&
-	    Character.isLetter(nextString.charAt(0)) &&
-	    Character.isLetter(nextString.charAt(1)))
+	String key = (String) e.nextElement();
+	
+	if (key.startsWith(tableName + "."))
 	  {
-	    tempList.add(nextString);
-	    ++count;
+	    String str = key.substring(tableName.length() + 1);
+
+	    if (str.length() == 2
+		&& Character.isLetter(str.charAt(0))
+		&& Character.isLetter(str.charAt(1)))
+	      {
+		tempList.add(str);
+		++count;
+	      }
 	  }
       }
-    strings = new String[count];
+
+    String[] strings = new String[count];
+    
     for (int a = 0; a < count; ++a)
-      {
-	strings[a] = (String) tempList.get(a);
-      }
+      strings[a] = (String) tempList.get(a);
+    
     return strings;
   }
 




More information about the kaffe mailing list