2 Replies Latest reply on Jun 5, 2014 9:23 AM by nogotiated

    Problems with Expression Language 3.0 and Generics

    nogotiated

      Hi,

      I'm currently migrating our app from JBoss 7.1 to Wildlfy 8.1 Final. We previously used glassfish el-impl 2.2 and javax.el.api 2.2.

      I found a lot of expressions which throw the following error:

      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)




      If the method is called from an el expression with a non-null value, it works fine.

      Here is a minimal example to reproduce the issue:

      Failing expression: #{simpleOrderHandler.getLastUpdate(null)}

       

      import java.util.Date;
      
      public interface SimpleDataTableHandler<T> {
       public Date getLastUpdate(T item);
      }
      
      import java.util.Date;
      import javax.enterprise.inject.Model;
      
      @Model
      public class SimpleOrderHandler implements SimpleDataTableHandler<SimpleOrder> {
      
          @Override
          public Date getLastUpdate(SimpleOrder item) {
              return new Date();
          }
      
      }
      
      
      
      

      Without generic type parameters, it works fine.

      There is another problem with some inheritance hierarchy and overridden methods with generic parameters.

      The EL-Impl seems to be unable to decide which method to call.