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 DF20C200A5B for ; Thu, 5 May 2016 08:00:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DDC6F160A00; Thu, 5 May 2016 06:00:21 +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 31ACB160A02 for ; Thu, 5 May 2016 08:00:21 +0200 (CEST) Received: (qmail 43284 invoked by uid 500); 5 May 2016 06:00:20 -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 43189 invoked by uid 99); 5 May 2016 06:00:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 06:00:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D86152C1F6E for ; Thu, 5 May 2016 06:00:19 +0000 (UTC) Date: Thu, 5 May 2016 06:00:19 +0000 (UTC) From: "Dmitri Blinov (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JEXL-193) InterruptedException is swallowed in function call in silent and non-strict mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 May 2016 06:00:22 -0000 [ https://issues.apache.org/jira/browse/JEXL-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15271930#comment-15271930 ] Dmitri Blinov commented on JEXL-193: ------------------------------------ I wonder should we also check for thread cancellation just before returning a value from script, so as to guarantee that if thread have been cancelled no value is returned by JEXL > InterruptedException is swallowed in function call in silent and non-strict mode > -------------------------------------------------------------------------------- > > Key: JEXL-193 > URL: https://issues.apache.org/jira/browse/JEXL-193 > Project: Commons JEXL > Issue Type: Bug > Affects Versions: 3.0 > Reporter: Dmitri Blinov > Assignee: Henri Biestro > Fix For: 3.0.1 > > > The following test case fails with > {code} > java.lang.AssertionError: Values should be different. Actual: 42 > at org.junit.Assert.fail(Assert.java:88) > at org.junit.Assert.failEquals(Assert.java:185) > at org.junit.Assert.assertNotEquals(Assert.java:161) > {code} > {code} > public static class TestContext extends MapContext implements JexlContext.NamespaceResolver { > public int interrupt() throws InterruptedException { > throw new InterruptedException(); > } > } > @Test > public void testInterrupt() throws Exception { > JexlEngine jexl = new JexlBuilder().arithmetic(new JexlArithmetic(false)).strict(false).silent(true).create(); > JexlScript e = jexl.createScript("interrupt(); return 42"); > Callable c = e.callable(new TestContext()); > Object t = c.call(); > Assert.assertNotEquals(42, t); > } > {code} > Expected behaviour is to cancel script execution -- This message was sent by Atlassian JIRA (v6.3.4#6332)