Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [el-dev] Question about the new OptionalELResolver

On 20/02/2024 16:21, Arjan Tijms wrote:

I've been following this discussion here, and recognize the importance of the current concerns.

We do have to remember that we have really little time remaining to resolve this. Expression Language is up for review at the end of this month:

See <>

Yep. I'm aware of that. I should have a PR for this later today.


Kind regards,
Arjan Tijms

On Tue, 20 Feb 2024 at 12:43, Mark Thomas via el-dev <el-dev@xxxxxxxxxxx <mailto:el-dev@xxxxxxxxxxx>> wrote:

    On 13/02/2024 15:31, Paul Nicolucci wrote:
     > Hey Mark,
     > Your proposal seems reasonable to me!

    I've started to look at implementing this in Tomcat and have found a
    complication. Consider the following expression:

    ${ -> <>)}

    Should this call which is likely what was intended or
    should it call Optional.get().map() which will probably throw a

    I think the answer is that the user has to choose.

    Choice A: Don't use OptionalELResolver

    Instances of Optional are treated like any other object. The expression
    above will trigger a call to and return a (possibly
    non-empty) Optional.

    Choice B: Use OptionalELResolver

    Instances of Optional are treated as Optional.get() if present and null
    if empty (and any property or method on the Optional is ignored). The
    expression above will return null if the Optional is empty. If the
    Optional is present then the expression will return the result of
    calling Optional.get().map() which may return a value or may throw a

    I'm going to continue my work in Tomcat on this basis and see where
    things end up.

    el-dev mailing list
    el-dev@xxxxxxxxxxx <mailto:el-dev@xxxxxxxxxxx>
    To unsubscribe from this list, visit

Back to the top