This patch (committed) removes the NotImplementedException from the
toArray(Object[]) method in the BeanContextSupport class.  I wrote some
Mauve tests that all pass with the current implementation, and ran the
Harmony tests which also all pass.  I suggest that we treat the current
implementation as correct unless someone can show otherwise:

2006-11-22  David Gilbert  <[EMAIL PROTECTED]>

        * java/beans/beancontext/BeanContextSupport.java
        (toArray): Added API docs,
        (toArray(Object[])): Added API docs, removed NotImplementedException.

Regards,

Dave
Index: java/beans/beancontext/BeanContextSupport.java
===================================================================
RCS file: /sources/classpath/classpath/java/beans/beancontext/BeanContextSupport.java,v
retrieving revision 1.19
diff -u -r1.19 BeanContextSupport.java
--- java/beans/beancontext/BeanContextSupport.java	22 Nov 2006 17:59:26 -0000	1.19
+++ java/beans/beancontext/BeanContextSupport.java	22 Nov 2006 22:42:26 -0000
@@ -876,7 +876,12 @@
       }
   }
 
-  public Object[] toArray ()
+  /**
+   * Returns an array containing the children of this <code>BeanContext</code>.
+   * 
+   * @return An array containing the children.
+   */
+  public Object[] toArray()
   {
     synchronized (children)
       {
@@ -884,10 +889,16 @@
       }
   }
 
+  /**
+   * Populates, then returns, the supplied array with the children of this 
+   * <code>BeanContext</code>.  If the array is too short to hold the 
+   * children, a new array is allocated and returned.  If the array is too 
+   * long, it is padded with <code>null</code> items at the end.
+   * 
+   * @param array  an array to populate (<code>null</code> not permitted).
+   */
   public Object[] toArray(Object[] array)
-    throws NotImplementedException
   {
-    // This implementation is incorrect, I think.
     synchronized (children)
       {
         return children.keySet().toArray(array);

Reply via email to