Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D90FE021 for ; Mon, 4 Feb 2013 15:08:17 +0000 (UTC) Received: (qmail 13196 invoked by uid 500); 4 Feb 2013 15:08:16 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 12696 invoked by uid 500); 4 Feb 2013 15:08:12 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 12678 invoked by uid 99); 4 Feb 2013 15:08:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 15:08:12 +0000 Date: Mon, 4 Feb 2013 15:08:12 +0000 (UTC) From: "Juozas Baliuks (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (JEXL-142) Map expression issue with empty key MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Juozas Baliuks created JEXL-142: ----------------------------------- Summary: 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 Fix For: 2.1.2 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.(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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira