harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r698558 - /harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
Date Wed, 24 Sep 2008 13:19:47 GMT
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,



Mime
View raw message