You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2008/09/24 15:19:47 UTC

svn commit: r698558 - /harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java

Author: tellison
Date: Wed Sep 24 06:19:47 2008
New Revision: 698558

URL: http://svn.apache.org/viewvc?rev=698558&view=rev
Log:
Allow the charset to gracefully decline to load providers during the class library start-up phase.

Modified:
    harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java

Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java?rev=698558&r1=698557&r2=698558&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java Wed Sep 24 06:19:47 2008
@@ -37,6 +37,7 @@
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
+import java.util.Vector;
 
 import org.apache.harmony.niochar.CharsetProviderImpl;
 
@@ -456,9 +457,15 @@
                         .getResources(PROVIDER_CONFIGURATION_FILE_NAME);
             } else {
                 getSystemClassLoader();
-                e = systemClassLoader
-                        .getResources(PROVIDER_CONFIGURATION_FILE_NAME);
+                if (systemClassLoader == null) {
+                    // Non available during class library start-up phase
+                    e = new Vector<URL>().elements();
+                } else {
+                    e = systemClassLoader
+                            .getResources(PROVIDER_CONFIGURATION_FILE_NAME);
+                }
             }
+
             // examine each configuration file
             while (e.hasMoreElements()) {
                 cs = searchConfiguredCharsets(charsetName, contextClassLoader,