myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r924500 - /myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java
Date Wed, 17 Mar 2010 21:26:38 GMT
Author: lu4242
Date: Wed Mar 17 21:26:38 2010
New Revision: 924500

URL: http://svn.apache.org/viewvc?rev=924500&view=rev
Log:
MYFACES-2611 UIComponentBase.getFacetsAndChildren() must not access the component's facets
and children directly

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java?rev=924500&r1=924499&r2=924500&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java Wed Mar
17 21:26:38 2010
@@ -825,28 +825,19 @@ public abstract class UIComponentBase ex
         // own properties for facets and children and just override
         // getFacets() and getChildren() (e.g. seen in PrimeFaces).
         // See MYFACES-2611 for details.
-        Map<String, UIComponent> facets = getFacets();
-        List<UIComponent> children = getChildren();
-        
-        if (facets == null || facets.isEmpty())
+        if (getFacetCount() == 0)
         {
-            if (children == null || children.isEmpty())
-            {
-                // we don't have children or facets
+            if (getChildCount() == 0)
                 return _EMPTY_UICOMPONENT_ITERATOR;
-            }
-            // we only have children
-            return children.iterator();
+
+            return getChildren().iterator();
         }
         else
         {
-            if (children == null || children.isEmpty())
-            {
-                // we only have facets
-                return facets.values().iterator();
-            }
-            // we have facets and children
-            return new _FacetsAndChildrenIterator(facets, children);
+            if (getChildCount() == 0)
+                return getFacets().values().iterator();
+
+            return new _FacetsAndChildrenIterator(getFacets(), getChildren());
         }
     }
 



Mime
View raw message