[jboss-jira] [JBoss JIRA] (WFLY-3456) Can not call method with generic type parameter with null value
Farah Juma (JIRA)
issues at jboss.org
Thu Jun 19 18:33:24 EDT 2014
[ https://issues.jboss.org/browse/WFLY-3456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977935#comment-12977935 ]
Farah Juma commented on WFLY-3456:
----------------------------------
For 8.1.0.Final, the JBoss EL API was updated to use Tomcat EL's approach for method matching:
https://github.com/jboss/jboss-el-api_spec/commit/5b073db148597cd9425ae748a267a098bb4e2183
The problem is that this approach doesn't seem to have a way to handle overridden methods when a null parameter is passed in. In the example mentioned in this JIRA, when iterating over the methods returned by {{SimpleOrderHandler.class.getMethods()}}, this approach considers both {{getLastUpdate(SimpleOrder)}} and {{getLastUpdate(Object)}} to be potential matches. However, it's [unable|https://github.com/jboss/jboss-el-api_spec/blob/master/src/main/java/javax/el/Util.java#L379] to resolve the ambiguity when a null value is passed in.
The [previous approach|https://github.com/jboss/jboss-el-api_spec/commit/5b073db148597cd9425ae748a267a098bb4e2183#diff-7677343b9610a7f3e7f5743dd5e7c6c8L305] for method matching happened to work correctly with a null value because it just returned the first method from {{Class#getMethods()}} with a matching name and parameter count.
[~ctomc] any ideas on what could be done to fix this?
> Can not call method with generic type parameter with null value
> ---------------------------------------------------------------
>
> Key: WFLY-3456
> URL: https://issues.jboss.org/browse/WFLY-3456
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: JSF
> Affects Versions: 8.1.0.Final
> Reporter: Marcel Neuwohner
> Assignee: Farah Juma
>
> If you call a method with a generic type parameter from EL with null as parameter value you get
> {code}
> javax.el.MethodNotFoundException
> Unable to find unambiguous method: SimpleOrderHandler$Proxy$_$$_WeldClientProxy.getLastUpdate(null)
> at
> javax.el.Util.findWrapper(Util.java:322)
> javax.el.Util.findMethod(Util.java:203)
> javax.el.ELUtil.findMethod(ELUtil.java:288)
> javax.el.BeanELResolver.invoke(BeanELResolver.java:527)
> javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
> com.sun.el.parser.AstValue.getValue(AstValue.java:136)
> com.sun.el.parser.AstValue.getValue(AstValue.java:204)
> com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
> org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
> com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
More information about the jboss-jira
mailing list