commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Blinov (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (JEXL-251) Safe navigation operator
Date Thu, 25 Jan 2018 15:11:00 GMT

     [ https://issues.apache.org/jira/browse/JEXL-251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dmitri Blinov closed JEXL-251.
------------------------------
    Resolution: Duplicate

Seems to be Jira double processing bug

> Safe navigation operator
> ------------------------
>
>                 Key: JEXL-251
>                 URL: https://issues.apache.org/jira/browse/JEXL-251
>             Project: Commons JEXL
>          Issue Type: New Feature
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Priority: Minor
>
> It would be more convenient for a script writer to have a kind of safe navigation operator,
in the form of, for example, ({{object?.property),}} for null pointer dereferences. I think
its quite a common feature of many scripting (and compiled languages) now. The safe operator
should work like basic navigation operator for non null values and should short-circuit the
entire expression evaluation after encountering null value.
> I see the difference of new operator from the existing lenient mode evaluation in ability
to explicitly define places in an expression where {{null}} deference is allowed, for example
the expression {code}Order.Customer?.Name{code} defines that each {{Order}} should have a
{{Customer}} and only the {{Name}} of the {{Customer}} is optional.
> The difference of new operator from the existing null coalescing {{??}} operator is in
its ability to short-circuit evaluation.
> So, safe navigation operator would be a helpful syntaxic sugar which in my opinion does
not overlap with an existing functionality.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message