You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ja...@apache.org on 2010/05/13 21:16:51 UTC

svn commit: r943978 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java

Author: jakobk
Date: Thu May 13 19:16:51 2010
New Revision: 943978

URL: http://svn.apache.org/viewvc?rev=943978&view=rev
Log:
small fix to check UIComponent.getCurrentCompositeComponent() also if the component stack is null or empty

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java?rev=943978&r1=943977&r2=943978&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java Thu May 13 19:16:51 2010
@@ -77,22 +77,19 @@ public final class CompositeComponentELU
     {
         // look on the component stack
         LinkedList<UIComponent> componentStack = getComponentStack(facesContext);
-        if (componentStack == null || componentStack.isEmpty())
+        if (componentStack != null && !componentStack.isEmpty())
         {
-            // no components on the stack
-            return null;
-        }
-        
-        // try to find the right composite component
-        for (UIComponent component : componentStack)
-        {
-            if (UIComponent.isCompositeComponent(component))
+            // try to find the right composite component
+            for (UIComponent component : componentStack)
             {
-                Location componentLocation = (Location) component.getAttributes().get(LOCATION_KEY);
-                if (componentLocation != null 
-                        && componentLocation.getPath().equals(location.getPath()))
+                if (UIComponent.isCompositeComponent(component))
                 {
-                    return component;
+                    Location componentLocation = (Location) component.getAttributes().get(LOCATION_KEY);
+                    if (componentLocation != null 
+                            && componentLocation.getPath().equals(location.getPath()))
+                    {
+                        return component;
+                    }
                 }
             }
         }