Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8639D200D50 for ; Mon, 4 Dec 2017 12:29:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 84BC6160BF9; Mon, 4 Dec 2017 11:29:08 +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 CAE94160C05 for ; Mon, 4 Dec 2017 12:29:07 +0100 (CET) Received: (qmail 1639 invoked by uid 500); 4 Dec 2017 11:29:07 -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 1627 invoked by uid 99); 4 Dec 2017 11:29:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2017 11:29:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 179C2C4759 for ; Mon, 4 Dec 2017 11:29:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id zjeNDK5PJ5bN for ; Mon, 4 Dec 2017 11:29:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id CA5DD60F86 for ; Mon, 4 Dec 2017 11:29:03 +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 DA69FE093C for ; Mon, 4 Dec 2017 11:29:01 +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 C22A9255D7 for ; Mon, 4 Dec 2017 11:29:00 +0000 (UTC) Date: Mon, 4 Dec 2017 11:29:00 +0000 (UTC) From: "Henri Biestro (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (JEXL-245) Engine in strict mode fails to fail on unsolvable variables or properties MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 04 Dec 2017 11:29:08 -0000 [ https://issues.apache.org/jira/browse/JEXL-245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Biestro updated JEXL-245: ------------------------------- Assignee: Henri Biestro > Engine in strict mode fails to fail on unsolvable variables or properties > -------------------------------------------------------------------------- > > Key: JEXL-245 > URL: https://issues.apache.org/jira/browse/JEXL-245 > Project: Commons JEXL > Issue Type: Bug > Affects Versions: 3.1 > Reporter: Ate Douma > Assignee: Henri Biestro > > I've run into some unexpected behavior where the expectancy is that the Engine throws a unsolvable property exception. > Example code: > {code:java} > import org.apache.commons.jexl3.*; > public class JexlTest { > public Object getBar() { > return null; > } > private static void testJexl(final JexlEngine engine, final JexlContext ctx, final String expression) { > System.out.print("test ("+expression+"): "); > try { > System.out.println(engine.createExpression(expression).evaluate(ctx)); > } catch (JexlException e) { > System.out.println(e.getMessage()); > } > } > public static void main(final String[] args) throws Exception { > MapContext ctx = new MapContext(); > JexlEngine engine = new JexlBuilder().strict(true).silent(false).create(); > ctx.set("foo", new JexlTest()); > testJexl(engine, ctx, "foo.bar"); > testJexl(engine, ctx, "foo.bar.baz"); > testJexl(engine, ctx, "foo.baz"); > } > }{code} > Which produces the following output: > {code} > test (foo.bar): null > test (foo.bar.baz): null > test (foo.baz): JexlTest.testJexl@1:4 unsolvable property 'baz' > {code} > The problem is with the second test where accessing the property foo.bar.baz of the non-existing variable bar is not throwing an exception. > The third test demonstrates a similar/same scenario where accessing the non-existing property foo.baz is throwing the expected exception. -- This message was sent by Atlassian JIRA (v6.4.14#64029)