harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r426437 - /incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/spi/SelectorProvider.java
Date Fri, 28 Jul 2006 08:38:50 GMT
Author: pyang
Date: Fri Jul 28 01:38:49 2006
New Revision: 426437

URL: http://svn.apache.org/viewvc?rev=426437&view=rev
Log:
Fix for HARMONY-1000 ([classlib][nio] java.nio.channels.spi.SelectorProvider.provider() does
not load class from jar correctly)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/spi/SelectorProvider.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/spi/SelectorProvider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/spi/SelectorProvider.java?rev=426437&r1=426436&r2=426437&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/spi/SelectorProvider.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/spi/SelectorProvider.java
Fri Jul 28 01:38:49 2006
@@ -110,7 +110,6 @@
      */
     static SelectorProvider loadProviderByJar() {
         Enumeration enumeration = null;
-        SelectorProvider tempProvider = null;
 
         ClassLoader classLoader = AccessController.doPrivileged(
                 new PrivilegedAction<ClassLoader>() {
@@ -121,7 +120,7 @@
         try {
             enumeration = classLoader.getResources(PROVIDER_IN_JAR_RESOURCE);
         } catch (IOException e) {
-            throw new Error();
+            throw new Error(e);
         }
         if (null == enumeration) {
             return null;
@@ -139,17 +138,14 @@
             try {
                 // only the first class is loaded ,as spec says, not the same as
                 // we do before.
-                if ((className = br.readLine()) != null) {
+                while ((className = br.readLine()) != null) {
                     className = className.trim();
                     int siteComment = className.indexOf(SYMBOL_COMMENT);
                     className = (-1 == siteComment) ? className : className
                             .substring(0, siteComment);
                     if (0 < className.length()) {
-                        tempProvider = (SelectorProvider) classLoader
-                                .loadClass(className).newInstance();
-                        if (null != tempProvider) {
-                            return tempProvider;
-                        }
+                        return (SelectorProvider) classLoader.loadClass(
+                                className).newInstance();                  
                     }
                 }
             } catch (Exception e) {



Mime
View raw message