Author: adrianc
Date: Thu Dec 18 14:29:19 2008
New Revision: 727845
URL:
http://svn.apache.org/viewvc?rev=727845&view=revLog:
Fixed bug in FlexibleMapAccessor.java parsing - someMap[this.that] syntax works now.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java?rev=727845&r1=727844&r2=727845&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java Thu Dec 18 14:29:19 2008
@@ -199,10 +199,15 @@
return null;
}
String str = original;
- // TODO: Make this smarter - expressions could contain periods
int end = original.indexOf(".");
if (end != -1) {
- str = original.substring(0, end);
+ int openBrace = original.indexOf("[");
+ if (openBrace != -1 && openBrace < end) {
+ end = original.indexOf(']', openBrace);
+ str = original.substring(0, end + 1);
+ } else {
+ str = original.substring(0, end);
+ }
}
ExpressionNode node = null;
if (str.contains("[")) {