myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: MYFACES-4285
Date Fri, 15 Mar 2019 18:36:32 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new b7f96b2  MYFACES-4285
b7f96b2 is described below

commit b7f96b2e1a4620a2342310cbfe46cfae306a1890
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Fri Mar 15 19:36:25 2019 +0100

    MYFACES-4285
---
 .../view/facelets/tag/TagAttributeImpl.java        | 38 ++++++++++++----------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
index b74ecd2..4041b74 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
@@ -294,15 +294,17 @@ public final class TagAttributeImpl extends TagAttribute
                 if ((this.capabilities & EL_CC) != 0)
                 {
                     Location currentLocation = getLocation();
-                    Location ccLocation = (Location) actx.getFaceletCompositionContext().
-                            getCompositeComponentFromStack().getAttributes().get(
-                                    CompositeComponentELUtils.LOCATION_KEY);
-                    if (ccLocation != null && !ccLocation.getPath().equals(currentLocation.getPath()))
+                    UIComponent cc = actx.getFaceletCompositionContext().getCompositeComponentFromStack();
+                    if (cc != null)
                     {
-                        // #{cc} from a template called from inside a composite component,
disable caching on 
-                        // this expression. The reason is we need to change the Location
object used as
-                        // reference as the one in the stack, and that depends on the template
hierarchy.
-                        currentLocation = ccLocation;
+                        Location ccLocation = (Location) cc.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY);
+                        if (ccLocation != null && !ccLocation.getPath().equals(currentLocation.getPath()))
+                        {
+                            // #{cc} from a template called from inside a composite component,
disable caching on 
+                            // this expression. The reason is we need to change the Location
object used as
+                            // reference as the one in the stack, and that depends on the
template hierarchy.
+                            currentLocation = ccLocation;
+                        }
                     }
                     methodExpression = new LocationMethodExpression(currentLocation, methodExpression,

                             actx.getFaceletCompositionContext().getCompositeComponentLevel());
@@ -549,16 +551,18 @@ public final class TagAttributeImpl extends TagAttribute
                 // the location of the composite component from the stack directly, but only
when the path
                 // is different.
                 Location currentLocation = getLocation();
-                Location ccLocation = (Location) actx.getFaceletCompositionContext().
-                        getCompositeComponentFromStack().getAttributes().get(
-                                CompositeComponentELUtils.LOCATION_KEY);
-                if (ccLocation != null && !ccLocation.getPath().equals(currentLocation.getPath()))
+                UIComponent cc = actx.getFaceletCompositionContext().getCompositeComponentFromStack();
+                if (cc != null)
                 {
-                    // #{cc} from a template called from inside a composite component, disable
caching on 
-                    // this expression. The reason is we need to change the Location object
used as
-                    // reference as the one in the stack, and that depends on the template
hierarchy.
-                    //cacheable = false;
-                    currentLocation = ccLocation;
+                    Location ccLocation = (Location) cc.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY);
+                    if (ccLocation != null && !ccLocation.getPath().equals(currentLocation.getPath()))
+                    {
+                        // #{cc} from a template called from inside a composite component,
disable caching on 
+                        // this expression. The reason is we need to change the Location
object used as
+                        // reference as the one in the stack, and that depends on the template
hierarchy.
+                        //cacheable = false;
+                        currentLocation = ccLocation;
+                    }
                 }
 
                 valueExpression = new LocationValueExpression(currentLocation, valueExpression,



Mime
View raw message