From: funkman Date: Thu, 27 Dec 2007 02:10:38 +0000 (+0000) Subject: http://issues.apache.org/bugzilla/show_bug.cgi?id=43285 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=12ab1ec136a0aca2b2c17fe8ce910cc8231f2bc7;p=tomcat7.0 issues.apache.org/bugzilla/show_bug.cgi?id=43285 Missing EL Coercion causes argument type mismatch Patch by Bernhard Huemer bernhard.huemers gmail com git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@606996 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/el/parser/AstValue.java b/java/org/apache/el/parser/AstValue.java index 04c04ca80..3cf27cdd4 100644 --- a/java/org/apache/el/parser/AstValue.java +++ b/java/org/apache/el/parser/AstValue.java @@ -26,6 +26,7 @@ import javax.el.ELResolver; import javax.el.MethodInfo; import javax.el.PropertyNotFoundException; +import org.apache.el.lang.ELSupport; import org.apache.el.lang.EvaluationContext; import org.apache.el.util.MessageFactory; import org.apache.el.util.ReflectionUtil; @@ -127,7 +128,11 @@ public final class AstValue extends SimpleNode { throws ELException { Target t = getTarget(ctx); ctx.setPropertyResolved(false); - ctx.getELResolver().setValue(ctx, t.base, t.property, value); + ELResolver resolver = ctx.getELResolver(); + resolver.setValue(ctx, t.base, t.property, + // coerce to the expected type + ELSupport.coerceToType(value, + resolver.getType(ctx, t.base, t.property))); } public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes)