commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Biestro (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (JEXL-196) Script execution hangs while calling method with one argument without parameter
Date Thu, 26 May 2016 21:17:13 GMT

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

Henri Biestro resolved JEXL-196.
--------------------------------
       Resolution: Fixed
         Assignee: Henri Biestro
    Fix Version/s: 3.0.1

Break out of method resolution loop when already failed to resolve through context method

Committed revision 1745646.

RELEASE-NOTES.txt
src/site/xdoc/changes.xml
src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java..

> Script execution hangs while calling method with one argument without parameter
> -------------------------------------------------------------------------------
>
>                 Key: JEXL-196
>                 URL: https://issues.apache.org/jira/browse/JEXL-196
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>             Fix For: 3.0.1
>
>
> While it is obviously an error to do such a thing, the script execution hangs indefinitely
if the method with one argument of type Object is called without any parameter at all.
> {code}
>     public static class TestContext extends MapContext implements JexlContext.NamespaceResolver
{
>         @Override
>         public Object resolveNamespace(String name) {
>             return name == null ? this : null;
>         }
>         public int hangs(Object t) {
>             return 1;
>         }
>     }
>     public void testHangs() throws Exception {
>         JexlScript e = JEXL.createScript("hangs()");
>         Callable<Object> c = e.callable(new TestContext());
>         ExecutorService executor = Executors.newFixedThreadPool(1);
>         try {
>             Future<?> future = executor.submit(c);
>             Object t = future.get(10, TimeUnit.SECONDS);
>             Assert.assertEquals(1, t);
>         } finally {
>             executor.shutdown();
>         }
>     }
> {code}
> The expected behaviour is to report an error



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message