You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/08/12 19:44:56 UTC

svn commit: r1157196 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java

Author: lu4242
Date: Fri Aug 12 17:44:56 2011
New Revision: 1157196

URL: http://svn.apache.org/viewvc?rev=1157196&view=rev
Log:
MYFACES-3274 CompositeComponentELResolver.CompositeComponentAttributesMapWrapper breaks compatibility with tmp el-resolvers (Thanks to Matt Benson for provide this patch)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java?rev=1157196&r1=1157195&r2=1157196&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java Fri Aug 12 17:44:56 2011
@@ -141,7 +141,7 @@ public final class CompositeComponentELR
             {
                 //create a wrapper map
                 attributesMap = new CompositeComponentAttributesMapWrapper(
-                        baseComponent, elContext);
+                        baseComponent);
                 compositeComponentAttributesMaps.put(baseComponent,
                         new WeakReference<Map<String, Object>>(attributesMap));
             }
@@ -150,7 +150,7 @@ public final class CompositeComponentELR
         {
             //Create both required maps
             attributesMap = new CompositeComponentAttributesMapWrapper(
-                    baseComponent, elContext);
+                    baseComponent);
             compositeComponentAttributesMaps = new WeakHashMap<UIComponent, WeakReference<Map<String, Object>>>();
             compositeComponentAttributesMaps.put(baseComponent,
                     new WeakReference<Map<String, Object>>(attributesMap));
@@ -189,15 +189,13 @@ public final class CompositeComponentELR
         private final UIComponent _component;
         private final BeanInfo _beanInfo;
         private final Map<String, Object> _originalMap;
-        private final ELContext _elContext;
         private final PropertyDescriptor [] _propertyDescriptors;
 
-        private CompositeComponentAttributesMapWrapper(UIComponent component, ELContext context)
+        private CompositeComponentAttributesMapWrapper(UIComponent component)
         {
             this._component = component;
             this._originalMap = component.getAttributes();
             this._beanInfo = (BeanInfo) _originalMap.get(UIComponent.BEANINFO_KEY);
-            this._elContext = context;
             this._propertyDescriptors = _beanInfo.getPropertyDescriptors();
         }
 
@@ -257,7 +255,7 @@ public final class CompositeComponentELR
                 // always stored as (Tag-)ValueExpressions.
                 if (obj != null && obj instanceof ValueExpression)
                 {
-                    return ((ValueExpression) obj).getValue(_elContext);
+                    return ((ValueExpression) obj).getValue(FacesContext.getCurrentInstance().getELContext());
                 }
                 else
                 {
@@ -283,7 +281,7 @@ public final class CompositeComponentELR
             // Per the spec, if the result is a ValueExpression, call setValue().
             if (valueExpression != null)
             {
-                valueExpression.setValue(_elContext, value);
+                valueExpression.setValue(FacesContext.getCurrentInstance().getELContext(), value);
 
                 return null;
             }