[jira] [Updated] (JEXL-245) Engine in strict mode fails to fail on unsolvable variables or properties

2021-06-03 Thread Henri Biestro (Jira)


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

Henri Biestro updated JEXL-245:
---
Fix Version/s: 3.2

> 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
>Priority: Major
> Fix For: 3.2
>
>
> 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
(v8.3.4#803005)


[jira] [Updated] (JEXL-245) Engine in strict mode fails to fail on unsolvable variables or properties

2017-12-04 Thread Henri Biestro (JIRA)

 [ 
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)


[jira] [Updated] (JEXL-245) Engine in strict mode fails to fail on unsolvable variables or properties

2017-12-01 Thread Ate Douma (JIRA)

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

Ate Douma updated JEXL-245:
---
Description: 
I've been running into some weird and 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. 

  was:
I've been running into some weird and 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 with the 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. 


> 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
>
> I've been running into some weird and 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 

[jira] [Updated] (JEXL-245) Engine in strict mode fails to fail on unsolvable variables or properties

2017-12-01 Thread Ate Douma (JIRA)

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

Ate Douma updated JEXL-245:
---
Description: 
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. 

  was:
I've been running into some weird and 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. 


> 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
>
> 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