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 2012/09/11 01:57:29 UTC
svn commit: r1383168 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
Author: lu4242
Date: Mon Sep 10 23:57:29 2012
New Revision: 1383168
URL: http://svn.apache.org/viewvc?rev=1383168&view=rev
Log:
MYFACES-3605 Expression ClassCastException
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java?rev=1383168&r1=1383167&r2=1383168&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java Mon Sep 10 23:57:29 2012
@@ -217,7 +217,8 @@ public final class TagAttributeImpl exte
(type != null && type.equals(localCachedExpression[(i*3)])) ) &&
(Arrays.equals(paramTypes, (Class[]) localCachedExpression[(i*3)+1])) )
{
- if ((this.capabilities & EL_CC) != 0)
+ if ((this.capabilities & EL_CC) != 0 &&
+ localCachedExpression[(i*3)+2] instanceof LocationMethodExpression)
{
return ((LocationMethodExpression)localCachedExpression[(i*3)+2]).apply(
actx.getFaceletCompositionContext().getCompositeComponentLevel());
@@ -255,12 +256,30 @@ public final class TagAttributeImpl exte
ValueExpression valueExpr = this.getValueExpression(ctx, Object.class);
methodExpression = new ValueExpressionMethodExpression(valueExpr);
+
+ if (actx.getFaceletCompositionContext().isWrapTagExceptionsAsContextAware())
+ {
+ methodExpression = new ContextAwareTagMethodExpression(this, methodExpression);
+ }
+ else
+ {
+ methodExpression = new TagMethodExpression(this, methodExpression);
+ }
}
else
{
ExpressionFactory f = ctx.getExpressionFactory();
methodExpression = f.createMethodExpression(ctx, this.value, type, paramTypes);
-
+
+ if (actx.getFaceletCompositionContext().isWrapTagExceptionsAsContextAware())
+ {
+ methodExpression = new ContextAwareTagMethodExpression(this, methodExpression);
+ }
+ else
+ {
+ methodExpression = new TagMethodExpression(this, methodExpression);
+ }
+
// if the MethodExpression contains a reference to the current composite
// component, the Location also has to be stored in the MethodExpression
// to be able to resolve the right composite component (the one that was
@@ -273,14 +292,6 @@ public final class TagAttributeImpl exte
}
}
- if (actx.getFaceletCompositionContext().isWrapTagExceptionsAsContextAware())
- {
- methodExpression = new ContextAwareTagMethodExpression(this, methodExpression);
- }
- else
- {
- methodExpression = new TagMethodExpression(this, methodExpression);
- }
if (actx.isAllowCacheELExpressions() && !actx.isAnyFaceletsVariableResolved())
{