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/03/19 16:16:40 UTC
[jira] [Resolved] (JEXL-142) Map expression issue with empty key
[ https://issues.apache.org/jira/browse/JEXL-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-142.
--------------------------------
Resolution: Fixed
> Map expression issue with empty key
> -----------------------------------
>
> Key: JEXL-142
> URL: https://issues.apache.org/jira/browse/JEXL-142
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 2.1.1
> Reporter: Juozas Baliuks
> Priority: Trivial
> Fix For: 3.0
>
> Attachments: JEXL-142.patch
>
>
> Map expressions fail if key is an empty string: map['']
> Attachement contains patch with a fix and test case.
> java.lang.StringIndexOutOfBoundsException: String index out of range: 3
> at java.lang.AbstractStringBuilder.charAt(Unknown Source)
> at java.lang.StringBuilder.charAt(Unknown Source)
> at org.apache.commons.jexl2.internal.PropertyGetExecutor.discoverGet(PropertyGetExecutor.java:103)
> at org.apache.commons.jexl2.internal.PropertyGetExecutor.discover(PropertyGetExecutor.java:82)
> at org.apache.commons.jexl2.internal.PropertyGetExecutor.<init>(PropertyGetExecutor.java:38)
> at org.apache.commons.jexl2.internal.Introspector.getGetExecutor(Introspector.java:230)
> at org.apache.commons.jexl2.introspection.UberspectImpl.getPropertyGet(UberspectImpl.java:136)
> at org.apache.commons.jexl2.Interpreter.getAttribute(Interpreter.java:1537)
> at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:482)
> at org.apache.commons.jexl2.parser.ASTArrayAccess.jjtAccept(ASTArrayAccess.java:18)
> at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1317)
> at org.apache.commons.jexl2.parser.ASTReference.jjtAccept(ASTReference.java:18)
> at org.apache.commons.jexl2.Interpreter.interpret(Interpreter.java:232)
> at org.apache.commons.jexl2.ExpressionImpl.evaluate(ExpressionImpl.java:65)
> at org.apache.commons.jexl2.MapLiteralTest.testLiteralWithNumbers(MapLiteralTest.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)