svn commit: r727845 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r727845 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java

adrianc
Author: adrianc
Date: Thu Dec 18 14:29:19 2008
New Revision: 727845

URL: http://svn.apache.org/viewvc?rev=727845&view=rev
Log:
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("[")) {