jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
60 stars 49 forks source link

Null string will not be coerced to empty string in AstValue#invoke #146

Closed jbescos closed 3 years ago

jbescos commented 3 years ago

Attaching TCK el.tck.log

markt-asf commented 3 years ago

What is the justification for this change? The EL spec states (1.23.2) that null should be coerced to the empty string for String.

jbescos commented 3 years ago

The problem is that in old versions, that AstValue#invoke was returning null when the input string was null. There are some applications that started to not work properly after that change because they don't expect that change.

The commit that made it to work different is this one (you will find it in the javaee repository https://github.com/javaee/uel-ri/ ): commit 849ec6859b65f4a500dfc71d5fe4fd60e8bad9c3 Author: dongbin.nie@oracle.com dongbin.nie@oracle.com@localhost Date: Wed Apr 22 06:35:46 2015 +0000 Fix the issue that ImportHandler can't load the classes in web application. Enhance the method invocation to support basic method overloading. svn path=/trunk/; revision=425

In that commit we can see that it starts to use the method: ReflectionUtil.invokeMethod. Here the String coerce is done.

But previously to that commit, the parameters were not coerced.

I did other PR for the javaee repository: https://github.com/javaee/uel-ri/pull/51