You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sc...@apache.org on 2006/04/10 03:25:38 UTC

svn commit: r392868 - /myfaces/core/branches/1_1_2/api/src/main/java/javax/faces/component/_ComponentChildrenList.java

Author: schof
Date: Sun Apr  9 18:25:37 2006
New Revision: 392868

URL: http://svn.apache.org/viewcvs?rev=392868&view=rev
Log:
Reverted fix related to MYFACES-765.  Fix caused massive problems with the TCK.  Revisit this after the 1.1.2 release.

Modified:
    myfaces/core/branches/1_1_2/api/src/main/java/javax/faces/component/_ComponentChildrenList.java

Modified: myfaces/core/branches/1_1_2/api/src/main/java/javax/faces/component/_ComponentChildrenList.java
URL: http://svn.apache.org/viewcvs/myfaces/core/branches/1_1_2/api/src/main/java/javax/faces/component/_ComponentChildrenList.java?rev=392868&r1=392867&r2=392868&view=diff
==============================================================================
--- myfaces/core/branches/1_1_2/api/src/main/java/javax/faces/component/_ComponentChildrenList.java (original)
+++ myfaces/core/branches/1_1_2/api/src/main/java/javax/faces/component/_ComponentChildrenList.java Sun Apr  9 18:25:37 2006
@@ -50,20 +50,6 @@
     public Object set(int index, Object value)
     {
         checkValue(value);
-
-        UIComponent newChild = (UIComponent) value;
-
-        for (int i = 0; i < _list.size(); i++)
-        {
-            UIComponent component = (UIComponent) _list.get(i);
-            if(component.getId()!=null && component.getId().equals(newChild.getId()))
-            {
-                if(i!=index)
-                    throw new IllegalStateException(
-                        "Duplicate id : "+newChild.getId()+". Child could not be added.");
-            }
-        }
-        
         setNewParent((UIComponent)value);
         UIComponent child = (UIComponent) _list.set(index, value);
         if (child != null) child.setParent(null);
@@ -73,7 +59,6 @@
     public boolean add(Object value)
     {
         checkValue(value);
-        checkAddAllowed((UIComponent) value);
         setNewParent((UIComponent)value);
         return _list.add(value);
     }
@@ -81,21 +66,10 @@
     public void add(int index, Object value)
     {
         checkValue(value);
-        checkAddAllowed((UIComponent) value);
         setNewParent((UIComponent)value);
         _list.add(index, value);
     }
 
-    private void checkAddAllowed(UIComponent newChild)
-    {
-        for (int i = 0; i < _list.size(); i++)
-        {
-            UIComponent component = (UIComponent) _list.get(i);
-            if(component.getId()!=null && component.getId().equals(newChild.getId()))
-                throw new IllegalStateException("Duplicate id : "+newChild.getId()+". Child could not be added.");
-        }
-    }
-
     public Object remove(int index)
     {
         UIComponent child = (UIComponent) _list.remove(index);
@@ -119,7 +93,5 @@
         if (value == null) throw new NullPointerException("value");
         if (!(value instanceof UIComponent)) throw new ClassCastException("value is not a UIComponent");
     }
-
-
 
 }