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

Hey Mark,

To clarify your question, are you asking "What if a return value is not expected?" If that's not the case can you provide an example?

Regards,

Paul Nicolucci

On Thu, Feb 8, 2024 at 4:03 AM Mark Thomas via el-dev <el-dev@xxxxxxxxxxx> wrote:
On 08/02/2024 00:26, Paul Nicolucci via el-dev wrote:
> Hi,
>
> I've been testing the OptionalELResolver added in:
> https://github.com/jakartaee/_expression_-language/issues/176
> <https://github.com/jakartaee/_expression_-language/issues/176>. The
> initially reported problem does look to be resolved. For example an
> _expression_ of the form:
> "|domainObject.optionalProperty.requiredProperty|" works. However, I
> noticed that an _expression_ trying to invoke a method on the class of
> optionalProperty does not work:
> |"domainObject.optionalProperty.someMethod()".|
> |
> |
> |Was this the intention of the OptionalELResolver or was it an oversight
> that we should address?

Somewhere in the middle I think. The initial report was focused on
properties and the current behavior - including method invocation - is
as per the updated spec and Javadoc. That said, it makes sense to me to
do something about this if we can.

We need to decide what the expected behavior is for method invocation.

When Optional.isPresent() is true this is easy. Call the method.

What about when Optional.isEmpty() is true? NO-OP? What if a return
value is expected? null?

Mark
_______________________________________________
el-dev mailing list
el-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/el-dev

Back to the top