geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r523127 - /geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Date Wed, 28 Mar 2007 00:43:30 GMT
Author: kevan
Date: Tue Mar 27 17:43:29 2007
New Revision: 523127

URL: http://svn.apache.org/viewvc?view=rev&rev=523127
Log:
Fix problem caused by use of Arrays internal class. You can't add entries to Arrays. Use java.util.ArrayList,
instead.

Modified:
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?view=diff&rev=523127&r1=523126&r2=523127
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Tue Mar 27 17:43:29 2007
@@ -27,6 +27,7 @@
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.Arrays;
+import java.util.ArrayList;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -355,11 +356,12 @@
 
 
     // XMLBean uses lame arrays that can be null, so we need an asList that handles nulls
+    // Beware Arrays.asList(), it returns an ArrayList lookalike, that is not fully mutable...
     public static <E> List<E> asList(E[] array) {
         if (array == null) {
-            return Collections.emptyList();
+            return new ArrayList<E>();
         } else {
-            return Arrays.asList(array);
+            return new ArrayList<E>(Arrays.asList(array));
         }
     }
 



Mime
View raw message