incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r520020 - /incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClassLoaderLocal.java
Date Mon, 19 Mar 2007 17:36:01 GMT
Author: rickmcguire
Date: Mon Mar 19 10:36:01 2007
New Revision: 520020

URL: http://svn.apache.org/viewvc?view=rev&rev=520020
Log:
YOKO-311 ClassLoaderLocal can throw an IndexOutOfBounds exception


Modified:
    incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClassLoaderLocal.java

Modified: incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClassLoaderLocal.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClassLoaderLocal.java?view=diff&rev=520020&r1=520019&r2=520020
==============================================================================
--- incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClassLoaderLocal.java
(original)
+++ incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClassLoaderLocal.java
Mon Mar 19 10:36:01 2007
@@ -92,16 +92,21 @@
         } else {
             Vector v = getClassesVector(cl);
 
-            Object o = v.get(0);
-            if (!(o instanceof ClassLocalMap)) {
+            if (v.isEmpty()) {
                 map = new ClassLocalMap();
-                v.add(o);
-                v.set(0, map);
-            } else {
-                map = (ClassLocalMap) o;
+                v.add(map);
+            }
+            else {
+                Object o = v.get(0);
+                if (!(o instanceof ClassLocalMap)) {
+                    map = new ClassLocalMap();
+                    v.add(o);
+                    v.set(0, map);
+                } else {
+                    map = (ClassLocalMap) o;
+                }
             }
         }
-
         return map;
     }
 



Mime
View raw message