[
https://issues.apache.org/jira/browse/JEXL-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Biestro updated JEXL-294:
-------------------------------
Description:
It seems a bit odd that the expression "abc" == true returns true.
{code:java}
@Test
public void test294() throws Exception {
final String str = "(b)->{ b == true }";
JexlContext ctxt = new MapContext();
JexlEngine jexl = new JexlBuilder().create();
JexlScript e = jexl.createScript(str);
Object value = e.execute(ctxt, "abc");
Assert.assertEquals(true, value); // "abc" == true ??
}
{code}
was:
It seems a bit odd that the expression "abc" == true returns true.
{code:java}
@Test
public void test293() throws Exception {
final String str = "(b)->{ b == true }";
JexlContext ctxt = new MapContext();
JexlEngine jexl = new JexlBuilder().create();
JexlScript e = jexl.createScript(str);
Object value = e.execute(ctxt, "abc");
Assert.assertEquals(true, value); // "abc" == true ??
}
{code}
> expression:b == true , when b="abc" then return true
> ----------------------------------------------------
>
> Key: JEXL-294
> URL: https://issues.apache.org/jira/browse/JEXL-294
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 3.1
> Environment: java 8
> commons-jexl 3.1
> Reporter: 锁战强
> Assignee: Henri Biestro
> Priority: Blocker
>
> It seems a bit odd that the expression "abc" == true returns true.
> {code:java}
>
> @Test
> public void test294() throws Exception {
> final String str = "(b)->{ b == true }";
> JexlContext ctxt = new MapContext();
> JexlEngine jexl = new JexlBuilder().create();
> JexlScript e = jexl.createScript(str);
> Object value = e.execute(ctxt, "abc");
> Assert.assertEquals(true, value); // "abc" == true ??
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)