[kaffe] CVS kaffe (kaz): libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java

Kaffe CVS cvs-commits at kaffe.org
Sat Jun 4 19:17:16 PDT 2005


PatchSet 6609 
Date: 2005/06/05 02:13:02
Author: kaz
Branch: HEAD
Tag: (none) 
Log:
2005-06-05  Ito Kazumitsu  <kaz at maczuka.gcd.org>

        * libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java
        (IconvProvider): Made the constructor public.

        * libraries/javalib/java/nio/charset/Charset.java
        (providers2): Allow spaces and comments in
        META-INF/services/java.nio.charset.spi.CharsetProvider.
        Load the provider using the context class loader.

Members: 
	ChangeLog:1.4135->1.4136 
	libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java:1.1->1.2 
	libraries/javalib/java/nio/charset/Charset.java:1.15->1.16 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4135 kaffe/ChangeLog:1.4136
--- kaffe/ChangeLog:1.4135	Sat Jun  4 20:58:29 2005
+++ kaffe/ChangeLog	Sun Jun  5 02:13:02 2005
@@ -1,7 +1,12 @@
-2005-06-04  Helmer Kraemer  <hkraemer at freenet.de>
+2005-06-05  Ito Kazumitsu  <kaz at maczuka.gcd.org>
 
-	* kaffe/kaffevm/jni/jni.c (Kaffe_FindClass): fixed so it works correctly
-	for native methods of system classes.
+	* libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java
+	(IconvProvider): Made the constructor public.
+
+	* libraries/javalib/java/nio/charset/Charset.java
+	(providers2): Allow spaces and comments in
+	META-INF/services/java.nio.charset.spi.CharsetProvider.
+	Load the provider using the context class loader.
 
 2005-06-02  Guilhem Lavaux  <guilhem at kaffe.org>
 
Index: kaffe/libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java
diff -u kaffe/libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java:1.1 kaffe/libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java:1.2
--- kaffe/libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java:1.1	Sat Apr 23 09:54:27 2005
+++ kaffe/libraries/javalib/gnu/java/nio/charset/iconv/IconvProvider.java	Sun Jun  5 02:13:05 2005
@@ -62,7 +62,11 @@
         }
     }
 
-  private IconvProvider()
+  // Declaring the construtor public may violate the use of singleton.
+  // But it must be public so that an instance of this class can be
+  // created by Class.newInstance(), which is the case when this provider is
+  // defined in META-INF/services/java.nio.charset.spi.CharsetProvider.
+  public IconvProvider()
   {
     IconvMetaData.setup();
   }
Index: kaffe/libraries/javalib/java/nio/charset/Charset.java
diff -u kaffe/libraries/javalib/java/nio/charset/Charset.java:1.15 kaffe/libraries/javalib/java/nio/charset/Charset.java:1.16
--- kaffe/libraries/javalib/java/nio/charset/Charset.java:1.15	Wed May 18 21:23:05 2005
+++ kaffe/libraries/javalib/java/nio/charset/Charset.java	Sun Jun  5 02:13:06 2005
@@ -267,8 +267,29 @@
                     String s = rdr.readLine();
                     if (s == null)
 		      break;
+		    int i = -1, j = -1;
+		    for (int k = 0; k < s.length(); k++)
+		      {
+			char c = s.charAt(k);
+			if (c == ' ' || c == '\t')
+			  continue;
+			if (c == '#')
+			  break;
+			i = k;
+			break;
+		      }
+		    if (i < 0)
+			continue;
+		    for (j = i + 1; j < s.length(); j++)
+		      {
+			char c = s.charAt(j);
+			if (c == ' ' || c == '\t' || c == '#')
+			  break;
+		      }
+		    s = s.substring(i, j);
                     CharsetProvider p =
-		      (CharsetProvider) ((Class.forName(s)).newInstance());
+		      (CharsetProvider) ((Class.forName(s, true,
+			 Thread.currentThread().getContextClassLoader())).newInstance());
                     set.add(p);
                   }
                }




More information about the kaffe mailing list