You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (JIRA)" <ji...@apache.org> on 2015/08/01 17:03:04 UTC

[jira] [Resolved] (JEXL-171) Map access operator does not work if key name clashes with map property name

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

Henri Biestro resolved JEXL-171.
--------------------------------
    Resolution: Fixed

A cleaner solution:
- Reified the resolver strategy in JexlUberspect.ResolverStrategy.
- Made strategy member of Uberspect, filled at creation time; added option to pass it down.
This allows implementing and using strategy without having to derive the Uberspect.

Using the 'map' strategy is now as simple as:
{code}
JexlEngine jexl = new JexlBuilder().strategy(JexlUberspect.MAP_STRATEGY).create();
{code}

src/main/java/org/apache/commons/jexl3/JexlBuilder.java
src/main/java/org/apache/commons/jexl3/internal/introspection/Uberspect.java
src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java
src/main/java/org/apache/commons/jexl3/internal/introspection/SandboxUberspect.java
src/main/java/org/apache/commons/jexl3/internal/Engine.java
src/test/java/org/apache/commons/jexl3/StrategyTest.java
src/test/java/org/apache/commons/jexl3/internal/introspection/DiscoveryTest.java

Revision: 1693711

*** not strictly related (nitpicking on javadoc, moving testes around, etc):
src/main/java/org/apache/commons/jexl3/internal/Debugger.java
src/main/java/org/apache/commons/jexl3/internal/IntegerRange.java
src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
src/main/java/org/apache/commons/jexl3/internal/LongRange.java
src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
src/test/java/org/apache/commons/jexl3/IssuesTest.java


> Map access operator does not work if key name clashes with map property name
> ----------------------------------------------------------------------------
>
>                 Key: JEXL-171
>                 URL: https://issues.apache.org/jira/browse/JEXL-171
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Critical
>             Fix For: 3.0
>
>
> The following example returns *false*, according to documentation should return *2*.
> i = new ("java.util.HashMap"); i.a = 1; i["empty"] = 2; i["empty"] 



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