Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-193

InterruptedException is swallowed in function call in silent and non-strict mode

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.1
    • Labels:
      None

      Description

      The following test case fails with

      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)
      
          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<Object> c = e.callable(new TestContext());
      
              Object t = c.call();
              Assert.assertNotEquals(42, t);
          }
      

      Expected behaviour is to cancel script execution

        Attachments

          Activity

            People

            • Assignee:
              henrib Henri Biestro
              Reporter:
              dmitri_blinov Dmitri Blinov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: