From issues-return-66263-archive-asf-public=cust-asf.ponee.io@commons.apache.org Sun Feb 4 16:54:11 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id A01A018064A for ; Sun, 4 Feb 2018 16:54:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8FEDF160C37; Sun, 4 Feb 2018 15:54:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D6277160C40 for ; Sun, 4 Feb 2018 16:54:10 +0100 (CET) Received: (qmail 48973 invoked by uid 500); 4 Feb 2018 15:54:10 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 48962 invoked by uid 99); 4 Feb 2018 15:54:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Feb 2018 15:54:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 85EEE1A0BBE for ; Sun, 4 Feb 2018 15:54:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -102.311 X-Spam-Level: X-Spam-Status: No, score=-102.311 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id OEIsgIp8_pWe for ; Sun, 4 Feb 2018 15:54:08 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1E9015FAE7 for ; Sun, 4 Feb 2018 15:54:08 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9BB8DE035B for ; Sun, 4 Feb 2018 15:54:06 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 9539421E8B for ; Sun, 4 Feb 2018 15:54:02 +0000 (UTC) Date: Sun, 4 Feb 2018 15:54:02 +0000 (UTC) From: "Henri Biestro (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (JEXL-250) Safe navigation operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JEXL-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Biestro updated JEXL-250: ------------------------------- Assignee: Henri Biestro > Safe navigation operator > ------------------------ > > Key: JEXL-250 > URL: https://issues.apache.org/jira/browse/JEXL-250 > Project: Commons JEXL > Issue Type: New Feature > Affects Versions: 3.1 > Reporter: Dmitri Blinov > Assignee: Henri Biestro > 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)