Commits

jkuh...@d4b077e3-5828-0410-b394-cb2b42183085  committed 81326df

Fixes number of bugs resulting from more ASTConst changes and how the context types are figured out.

  • Participants
  • Parent commits 9da4897

Comments (0)

Files changed (19)

   </component>
   <component name="ChangeListManager">
     <list default="true" name="Default" comment="">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/CollectionDirectPropertyTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/CollectionDirectPropertyTest.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/accessors/ListPropertyAccessorTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/MapPropertyAccessor.java" afterPath="$PROJECT_DIR$/src/java/ognl/MapPropertyAccessor.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTConst.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTConst.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/IndexAccessTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/IndexAccessTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/BeanProviderAccessor.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/BeanProviderAccessor.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/ASTPropertyTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/ASTPropertyTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/accessors" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/ObjectIndexedPropertyTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/ObjectIndexedPropertyTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ListPropertyAccessor.java" afterPath="$PROJECT_DIR$/src/java/ognl/ListPropertyAccessor.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ArrayPropertyAccessor.java" afterPath="$PROJECT_DIR$/src/java/ognl/ArrayPropertyAccessor.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTProperty.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTProperty.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java" afterPath="$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/enhance/ExpressionCompiler.java" afterPath="$PROJECT_DIR$/src/java/ognl/enhance/ExpressionCompiler.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OGNL.iws" afterPath="$PROJECT_DIR$/OGNL.iws" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java" afterPath="$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/PropertyTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/PropertyTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/InterfaceInheritanceTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/InterfaceInheritanceTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTChain.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTChain.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/ASTMethodTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/ASTMethodTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/SimpleNode.java" afterPath="$PROJECT_DIR$/src/java/ognl/SimpleNode.java" />
     </list>
   </component>
   <component name="ChangesViewManager" flattened_view="true" />
       <showLibraryContents />
       <hideEmptyPackages />
       <abbreviatePackageNames />
-      <showStructure Favorites="false" PackagesPane="false" Scope="false" ProjectPane="false" />
+      <showStructure ProjectPane="false" PackagesPane="false" Scope="false" Favorites="false" />
       <autoscrollToSource />
       <autoscrollFromSource />
       <sortByType />
   </component>
   <component name="RecentsManager" />
   <component name="RestoreUpdateTree" />
-  <component name="RunManager" selected="JUnit.PropertyTest">
-    <tempConfiguration default="false" name="PropertyTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+  <component name="RunManager" selected="JUnit.InterfaceInheritanceTest">
+    <tempConfiguration default="false" name="InterfaceInheritanceTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
       <pattern value="org.ognl.test.*" />
       <module name="OGNL" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
       <option name="ALTERNATIVE_JRE_PATH" />
       <option name="PACKAGE_NAME" value="org.ognl.test" />
-      <option name="MAIN_CLASS_NAME" value="org.ognl.test.PropertyTest" />
+      <option name="MAIN_CLASS_NAME" value="org.ognl.test.InterfaceInheritanceTest" />
       <option name="METHOD_NAME" />
       <option name="TEST_OBJECT" value="class" />
       <option name="VM_PARAMETERS" />
         <option name="Make" value="true" />
       </method>
     </tempConfiguration>
+    <configuration default="true" type="Remote" factoryName="Remote">
+      <option name="USE_SOCKET_TRANSPORT" value="true" />
+      <option name="SERVER_MODE" value="false" />
+      <option name="SHMEM_ADDRESS" value="javadebug" />
+      <option name="HOST" value="localhost" />
+      <option name="PORT" value="5005" />
+    </configuration>
+    <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
+      <option name="MAIN_CLASS_NAME" />
+      <option name="VM_PARAMETERS" />
+      <option name="PROGRAM_PARAMETERS" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <option name="ENABLE_SWING_INSPECTOR" value="false" />
+      <module name="" />
+    </configuration>
+    <configuration default="true" type="Applet" factoryName="Applet">
+      <module name="" />
+      <option name="MAIN_CLASS_NAME" />
+      <option name="HTML_FILE_NAME" />
+      <option name="HTML_USED" value="false" />
+      <option name="WIDTH" value="400" />
+      <option name="HEIGHT" value="300" />
+      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+      <option name="VM_PARAMETERS" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+    </configuration>
+    <configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+      <module name="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <option name="PACKAGE_NAME" />
+      <option name="MAIN_CLASS_NAME" />
+      <option name="METHOD_NAME" />
+      <option name="TEST_OBJECT" value="class" />
+      <option name="VM_PARAMETERS" />
+      <option name="PARAMETERS" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+      <option name="ADDITIONAL_CLASS_PATH" />
+      <option name="TEST_SEARCH_SCOPE">
+        <value defaultName="wholeProject" />
+      </option>
+      <method>
+        <option name="Make" value="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="TestNG" factoryName="TestNG" enabled="false" merge="false">
       <module name="" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
         <option name="Make" value="true" />
       </method>
     </configuration>
-    <configuration default="true" type="Applet" factoryName="Applet">
-      <module name="" />
-      <option name="MAIN_CLASS_NAME" />
-      <option name="HTML_FILE_NAME" />
-      <option name="HTML_USED" value="false" />
-      <option name="WIDTH" value="400" />
-      <option name="HEIGHT" value="300" />
-      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
-      <option name="VM_PARAMETERS" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" />
-    </configuration>
-    <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
-      <option name="MAIN_CLASS_NAME" />
-      <option name="VM_PARAMETERS" />
-      <option name="PROGRAM_PARAMETERS" />
-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" />
-      <option name="ENABLE_SWING_INSPECTOR" value="false" />
-      <module name="" />
-    </configuration>
-    <configuration default="true" type="Remote" factoryName="Remote">
-      <option name="USE_SOCKET_TRANSPORT" value="true" />
-      <option name="SERVER_MODE" value="false" />
-      <option name="SHMEM_ADDRESS" value="javadebug" />
-      <option name="HOST" value="localhost" />
-      <option name="PORT" value="5005" />
-    </configuration>
-    <configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
-      <module name="" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" />
-      <option name="PACKAGE_NAME" />
-      <option name="MAIN_CLASS_NAME" />
-      <option name="METHOD_NAME" />
-      <option name="TEST_OBJECT" value="class" />
-      <option name="VM_PARAMETERS" />
-      <option name="PARAMETERS" />
-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
-      <option name="ADDITIONAL_CLASS_PATH" />
-      <option name="TEST_SEARCH_SCOPE">
-        <value defaultName="wholeProject" />
-      </option>
-      <method>
-        <option name="Make" value="true" />
-      </method>
-    </configuration>
     <configuration default="true" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Remote">
       <option name="WORKING_DIRECTORY" />
       <option name="HOST" value="localhost" />
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="109" y="154" width="2112" height="1362" extended-state="0" />
+    <frame x="80" y="152" width="2112" height="1362" extended-state="0" />
     <editor active="false" />
     <layout>
       <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
       <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
       <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
-      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22346641" order="0" />
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.23807205" order="0" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="6" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25975105" order="2" />
     <option name="PERFORM_COMMIT_IN_BACKGROUND" value="false" />
     <option name="PUT_FOCUS_INTO_COMMENT" value="false" />
     <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
-    <option name="LAST_COMMIT_MESSAGE" value="OgnlRuntime was incorrectly returning false for shouldConvertNumericTypes when the values were primitives - probably a result of the astconst changes." />
+    <option name="LAST_COMMIT_MESSAGE" value="Fixes number of bugs resulting from more ASTConst changes and how the context types are figured out." />
     <option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
     <option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" />
     <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
     <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
     <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
     <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
-    <MESSAGE value="Ahemm......Let's try this one last time..." />
     <MESSAGE value="F#@$#$1! ...........Static references had bug in ASTChain with setting the special &quot;noRoot&quot; flag (hack) on static fields when the astchain was contained by another expression." />
     <MESSAGE value="ASTMethods weren't handling the case where a parameter value might be a literal &quot;null&quot; when handing objects off for conversion to OgnlOps.covnertValue." />
     <MESSAGE value="Minor code formatting / cleanup." />
     <MESSAGE value="Fixes OGNL-14 &amp;&amp; OGNL-16. &#10;&#10;OgnlRuntime.getChildSource was still using the old non &quot;($w)&quot; widening casting semantics provided by javassist." />
     <MESSAGE value="Minor update?" />
     <MESSAGE value="OgnlRuntime was incorrectly returning false for shouldConvertNumericTypes when the values were primitives - probably a result of the astconst changes." />
+    <MESSAGE value="Fixes number of bugs resulting from more ASTConst changes and how the context types are figured out." />
   </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
     <option name="myLastEditedConfigurable" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTCtor.java">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/accessors/ListPropertyAccessorTest.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="230" column="0" selection-start="8503" selection-end="8503" vertical-scroll-proportion="0.3483816">
+        <state line="53" column="4" selection-start="1750" selection-end="1750" vertical-scroll-proportion="0.8594848">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="249" column="0" selection-start="8940" selection-end="8940" vertical-scroll-proportion="0.70140517">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTEq.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/MapPropertyAccessor.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="37" column="29" selection-start="1891" selection-end="1891" vertical-scroll-proportion="0.14051522">
+        <state line="166" column="0" selection-start="6604" selection-end="6604" vertical-scroll-proportion="0.56088996">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTTest.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTChain.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="87" column="24" selection-start="3576" selection-end="3576" vertical-scroll-proportion="0.795082">
+        <state line="270" column="20" selection-start="11415" selection-end="11415" vertical-scroll-proportion="0.035128806">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTAnd.java">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/IndexedPropertyTest.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="95" column="46" selection-start="3495" selection-end="3495" vertical-scroll-proportion="0.29859486">
+        <state line="54" column="0" selection-start="3008" selection-end="3008" vertical-scroll-proportion="0.2810903">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTIn.java">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="70" column="4" selection-start="2643" selection-end="2643" vertical-scroll-proportion="0.5238501">
+        <state line="222" column="0" selection-start="6957" selection-end="6957" vertical-scroll-proportion="0.5093677">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTNotIn.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTMethod.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="62" column="28" selection-start="2568" selection-end="2568" vertical-scroll-proportion="0.42163545">
+        <state line="350" column="80" selection-start="13167" selection-end="13200" vertical-scroll-proportion="0.48594847">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ArithmeticAndLogicalOperatorsTest.java">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/SetterTest.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="114" column="39" selection-start="4956" selection-end="4956" vertical-scroll-proportion="0.25553662">
+        <state line="61" column="56" selection-start="2853" selection-end="2853" vertical-scroll-proportion="0.31942078">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/IndexAccessTest.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="39" column="0" selection-start="1950" selection-end="1950" vertical-scroll-proportion="0.10221465">
+        <state line="54" column="6" selection-start="3109" selection-end="3109" vertical-scroll-proportion="0.2810903">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTOr.java">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ASTPropertyTest.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="109" column="12" selection-start="3945" selection-end="3945" vertical-scroll-proportion="0.35775128">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/PropertyTest.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="42" column="4" selection-start="2004" selection-end="2004" vertical-scroll-proportion="0.11499148">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTGreater.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="37" column="34" selection-start="1896" selection-end="1896" vertical-scroll-proportion="0.10221465">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ComparisonExpression.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="48" column="54" selection-start="1498" selection-end="1498" vertical-scroll-proportion="0.5877342">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="2151" column="92" selection-start="81560" selection-end="81560" vertical-scroll-proportion="0.2802385">
+        <state line="176" column="0" selection-start="6004" selection-end="6004" vertical-scroll-proportion="0.4086651">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/java/ognl/enhance/ExpressionCompiler.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="381" column="10" selection-start="14574" selection-end="14574" vertical-scroll-proportion="0.3705281">
+        <state line="391" column="5" selection-start="14892" selection-end="14892" vertical-scroll-proportion="0.15332198">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ListPropertyAccessor.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="208" column="21" selection-start="6674" selection-end="6674" vertical-scroll-proportion="0.34412265">
+        <state line="220" column="0" selection-start="8555" selection-end="8555" vertical-scroll-proportion="0.85519594">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/InterfaceInheritanceTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="47" column="8" selection-start="2174" selection-end="2174" vertical-scroll-proportion="0.012776831">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ArrayPropertyAccessor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="206" column="0" selection-start="8452" selection-end="8452" vertical-scroll-proportion="0.70187396">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTProperty.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="445" column="124" selection-start="19295" selection-end="19295" vertical-scroll-proportion="0.012776831">
           <folding />
         </state>
       </provider>

File src/java/ognl/ASTChain.java

                         
                         _lastType = (NodeType)_children[i];
                     }
-                    
+
+                    //System.out.println("Astchain i: " + i + " currentobj : " + context.getCurrentObject() + " and root: " + context.getRoot());
                     if (!constructor && !(OrderedReturn.class.isInstance(_children[i]) && ((OrderedReturn)_children[i]).getLastExpression() != null)
                             && (_parent == null || !ASTSequence.class.isInstance(_parent))) {
                         
                         value = OgnlRuntime.getCompiler().castExpression(context, _children[i], value);
                     }
-                    
+
+/*
+                    System.out.println("astchain value now : " + value + " with index " + i
+                    + " current type " + context.getCurrentType() + " current accessor " + context.getCurrentAccessor()
+                    + " prev type " + context.getPreviousType() + " prev accessor " + context.getPreviousAccessor());
+*/
                     if (OrderedReturn.class.isInstance(_children[i]) && ((OrderedReturn)_children[i]).getLastExpression() != null) {
                         
                         ordered = true;

File src/java/ognl/ASTConst.java

         
         _getterClass = value.getClass();
 
-        context.setCurrentType(value.getClass());
-        context.setCurrentObject(value);
+        Object retval = value;
         
-        if (_parent != null && ComparisonExpression.class.isAssignableFrom(_parent.getClass())
-                && value != null
-                && Number.class.isAssignableFrom(value.getClass())) {
+        if (_parent != null && ASTProperty.class.isInstance(_parent)) {
             
+            context.setCurrentObject(value);
+
+            return value.toString();
+        } else if (value != null && Number.class.isAssignableFrom(value.getClass())) {
+
             context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(value.getClass()));
-            
-        } else if (_parent == null || !ASTProperty.class.isInstance(_parent))
-            context.setCurrentType(_getterClass);
-        
-        if (!(_parent != null
+            context.setCurrentObject(value);
+
+            return value.toString();
+        } else if (!(_parent != null && value != null
                 && NumericExpression.class.isAssignableFrom(_parent.getClass()))
                 && String.class.isAssignableFrom(value.getClass())) {
-            
-            return '\"' + OgnlOps.getEscapeString(value.toString()) + '\"';
+
+            context.setCurrentType(String.class);
+
+            retval = '\"' + OgnlOps.getEscapeString(value.toString()) + '\"';
+
+            context.setCurrentObject(retval.toString());
+
+            return retval.toString();
         } else if (Character.class.isInstance(value)) {
-            
+
             Character val = (Character)value;
-            
+
+            context.setCurrentType(Character.class);
+
             if (Character.isLetterOrDigit(val.charValue()))
-               return "'" + ((Character) value).charValue() + "'";
+               retval = "'" + ((Character) value).charValue() + "'";
             else
-                return "'" + OgnlOps.getEscapedChar(((Character) value).charValue()) + "'";
+                retval = "'" + OgnlOps.getEscapedChar(((Character) value).charValue()) + "'";
+
+            context.setCurrentObject(retval);
+            return retval.toString();
         }
-        
-        if (Boolean.class.isAssignableFrom(value.getClass()))
+
+        if (Boolean.class.isAssignableFrom(value.getClass())) {
             _getterClass = Boolean.TYPE;
 
-        if (Number.class.isAssignableFrom(value.getClass())) {
-            context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(value.getClass()));
-        } else
-            context.setCurrentType(value.getClass());
+            context.setCurrentType(Boolean.TYPE);
+            context.setCurrentObject(value);
 
-        //context.setCurrentType(value.getClass());
-        context.setCurrentObject(value);
+            return value.toString();
+        }
 
         return value.toString();
     }

File src/java/ognl/ASTProperty.java

 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Method;
 import java.util.Iterator;
-import java.util.Map;
 
 /**
  * @author Luke Blanshard (blanshlu@netscape.net)
     public int getIndexedPropertyType(OgnlContext context, Object source)
         throws OgnlException
     {
-        if (!isIndexedAccess()) {
-            Object property = getProperty(context, source);
-            
-            if (property instanceof String) { return OgnlRuntime.getIndexedPropertyType(context,
-                    (source == null) ? null : OgnlRuntime.getCompiler().getInterfaceClass(source.getClass()), (String) property); }
+        Class type = context.getCurrentType();
+        Class prevType = context.getPreviousType();
+        try {
+            if (!isIndexedAccess()) {
+                Object property = getProperty(context, source);
+
+                if (property instanceof String) { return OgnlRuntime.getIndexedPropertyType(context,
+                        (source == null) ? null : OgnlRuntime.getCompiler().getInterfaceClass(source.getClass()), (String) property); }
+            }
+
+            return OgnlRuntime.INDEXED_PROPERTY_NONE;
+        } finally {
+            context.setCurrentObject(source);
+            context.setCurrentType(type);
+            context.setPreviousType(prevType);
         }
-        
-        return OgnlRuntime.INDEXED_PROPERTY_NONE;
     }
     
     public Object getProperty(OgnlContext context, Object source)
         throws OgnlException
     {
-        return _children[0].getValue(context, source);
+        return _children[0].getValue(context, context.getRoot());
     }
     
     protected Object getValueBody(OgnlContext context, Object source)
         throws OgnlException
     {
-        if (_parent != null && ASTProperty.class.isInstance(_parent))
-            source = ((OgnlContext)context).getRoot();
-        
         Object result = null;
         Object property = null;
         result = property = getProperty(context, source);
         Method m = null;
         
         try {
-           //System.out.println("astproperty is indexed? : " + isIndexedAccess() + " child: " + _children[0].getClass().getName()
-             //       + " target: " + target.getClass().getName() + " current object: " + context.getCurrentObject().getClass().getName());
+           // System.out.println("astproperty is indexed? : " + isIndexedAccess() + " child: " + _children[0].getClass().getName()
+             //      + " target: " + target.getClass().getName() + " current object: " + context.getCurrentObject().getClass().getName());
             
             if (isIndexedAccess()) {
 
 
                 // Get root cast string if the child is a type that needs it (like a nested ASTProperty)
                 
-                String srcString = _children[0].toGetSourceString(context, context.getCurrentObject());
-                
+                String srcString = _children[0].toGetSourceString(context, context.getRoot());
                 srcString = ExpressionCompiler.getRootExpression(_children[0], context.getRoot(), false) + srcString;
 
-                //System.out.println("indexed getting with child srcString: " + srcString + " value class: " + value.getClass());
+                if (!ASTConst.class.isInstance(_children[0])) {
+                    String cast = (String)context.remove(ExpressionCompiler.PRE_CAST);
+                    if (cast != null)
+                        srcString = cast + srcString;
+                }
+
+                if (ASTConst.class.isInstance(_children[0]) && String.class.isInstance(context.getCurrentObject())) {
+                    srcString = "\"" + srcString + "\"";
+                }
+
+                //System.out.println("indexed getting with child srcString: " + srcString + " value class: " + value.getClass() + " and child: " + _children[0].getClass());
                 
                 if (context.get("_indexedMethod") != null) {
                     
                     m = (Method)context.remove("_indexedMethod");
                     _getterClass = m.getReturnType();
-                    
+
                     context.setCurrentType(_getterClass);
                     context.setCurrentObject(target);
-                    
+
                     return "." + m.getName() + "(" + srcString + ")";
                 } else {
                     
                     PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass());
                     
                     //System.out.println("child value : " + _children[0].getValue(context, context.getCurrentObject()) + " using propaccessor " + p.getClass().getName()
-                      //      + " and srcString " + srcString + " on target: " +  target);
+                      //    + " and srcString " + srcString + " on target: " +  target);
+
+                    Object currObj = context.getCurrentObject();
+                    Class currType = context.getCurrentType();
+                    Class prevType = context.getPreviousType();
                     
-                    Object indexVal = p.getProperty(context, target, _children[0].getValue(context, context.getCurrentObject()));
+                    Object indexVal = p.getProperty(context, target, _children[0].getValue(context, context.getRoot()));
+
+                    // reset current object for accessor
+                    
+                    context.setCurrentObject(currObj);
+                    context.setCurrentType(currType);
+                    context.setPreviousType(prevType);
+                    
                     /*
                     System.out.println("astprop srcString: " + srcString 
                             + " from child class " + _children[0].getClass().getName()
                             + " propertyAccessor : " + p.getClass().getName() + " context obj " + context.getCurrentObject()
                             + " context obj is array? : " + context.getCurrentObject().getClass().isArray());
                     */
+                    
+                    if (ASTConst.class.isInstance(_children[0]) && Number.class.isInstance(context.getCurrentObject()))
+                        context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(context.getCurrentObject().getClass()));
+
                     result = p.getSourceAccessor(context, target, srcString);
                     _getterClass = p.getPropertyClass(context, target, srcString);
                     
                         
                        _getterClass = indexVal.getClass().isArray() ? indexVal.getClass().getComponentType() : indexVal.getClass();
                     }
-                    
-                    // System.out.println("result of index src is " + result + " and getterClass " + _getterClass);
+
+                    //System.out.println("result of index src is " + result + " and getterClass " + _getterClass);
                     
                     context.setCurrentType(_getterClass);
                     context.setCurrentObject(indexVal);
 
             }
             
-            Object tmp = target; //context.getCurrentObject();
+            String name =  ((ASTConst) _children[0]).getValue().toString();
             
-            String name = ((ASTConst) _children[0]).getValue().toString();
-            
-            if (!Iterator.class.isAssignableFrom(context.getCurrentObject().getClass()) 
-                    || (Iterator.class.isAssignableFrom(context.getCurrentObject().getClass()) && name.indexOf("next") < 0)) {
-                
+            if (!Iterator.class.isAssignableFrom(context.getCurrentObject().getClass())
+                || (Iterator.class.isAssignableFrom(context.getCurrentObject().getClass()) && name.indexOf("next") < 0)) {
+
+                Object currObj = target;
+
                 try {
+
                     target = getValue(context, context.getCurrentObject());
                 } catch (NoSuchPropertyException e) {
-                    try { 
-                        
+                    try {
+
                         target = getValue(context, context.getRoot());
-                        context.setCurrentObject(tmp);
-                        
+
                     } catch (NoSuchPropertyException ex) { }
+                } finally {
+                    
+                    context.setCurrentObject(currObj);
                 }
             }
-            
-            context.setCurrentObject(tmp);
-            
+
             PropertyDescriptor pd = OgnlRuntime.getPropertyDescriptor(context.getCurrentObject().getClass(), name);
             
             if (this.getIndexedPropertyType(context, context.getCurrentObject()) > 0 && pd != null){
                     context.put("_indexedMethod", m);
                 }
             } else {
-                
-                context.setCurrentObject(tmp);
-                
-                // set context object back again as getValue results in context change
-                
-                //System.out.println("astproperty trying to get " + name + " on object target: " + context.getCurrentObject().getClass().getName());
+/*
+                System.out.println("astproperty trying to get " + name + " on object target: " + context.getCurrentObject().getClass().getName()
+                        + " current type " + context.getCurrentType() + " current accessor " + context.getCurrentAccessor()
+                    + " prev type " + context.getPreviousType() + " prev accessor " + context.getPreviousAccessor());
+               */
                 
                 PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
 
                             m = pd.getReadMethod();
                             result = pd.getName();
                         } else {
+
                             _getterClass = int.class;
                             context.setCurrentAccessor(context.getCurrentObject().getClass());
                             context.setCurrentType(int.class);
                 } else {
                     
                     if (pa != null) {
-                        
-                        Class prev = context.getCurrentType();
-                        Object prevObj = context.getCurrentObject();
-                        
-                        result = pa.getSourceAccessor(context, context.getCurrentObject(),
-                                _children[0].toGetSourceString(context, context.getRoot()));
-                        
-                        context.setCurrentObject(prevObj);
-                        context.setCurrentType(prev);
-                        
-                        if (_parent != null && ASTSequence.class.isInstance(_parent)
-                                && Map.class.isAssignableFrom(context.getCurrentObject().getClass()))
-                            _getterClass = Object.class;
-                        else
-                            _getterClass = pa.getPropertyClass(context, context.getCurrentObject(), name);
-                        
-                        context.setPreviousType(prev);
-                        context.setCurrentType(_getterClass);
+
+                        Object currObj = context.getCurrentObject();
+                        Class currType = context.getCurrentType();
+                        Class prevType = context.getPreviousType();
+
+                        String srcString = _children[0].toGetSourceString(context, context.getRoot());
+
+                        if (ASTConst.class.isInstance(_children[0]) &&
+                            String.class.isInstance(context.getCurrentObject())) {
+                            srcString = "\"" + srcString + "\"";
+                        }
+
+                        context.setCurrentObject(currObj);
+                        context.setCurrentType(currType);
+                        context.setPreviousType(prevType);
+
+                        result = pa.getSourceAccessor(context, context.getCurrentObject(), srcString);
+
+                        _getterClass = context.getCurrentType();
+
                     } else if (pd != null) {
                         
                         m = pd.getReadMethod();
         if (context.getCurrentObject() == null)
             throw new UnsupportedCompilationException("Current target is null.");
         
-        // System.out.println("astproperty(setter) is indexed? : " + isIndexedAccess() + " child: " + _children[0].getClass().getName()
-           //     + " target: " + target.getClass().getName());
+        //System.out.println("astproperty(setter) is indexed? : " + isIndexedAccess() + " child: " + _children[0].getClass().getName()
+          //      + " target: " + target.getClass().getName());
         
         try {
             
                 if (value == null)
                     throw new UnsupportedCompilationException("Value passed as indexed property is null, can't enhance statement to bytecode.");
                 
-                String srcString = _children[0].toGetSourceString(context, context.getCurrentObject());
+                String srcString = _children[0].toGetSourceString(context, context.getRoot());
                 
                 srcString = ExpressionCompiler.getRootExpression(_children[0], context.getRoot(), false) + srcString;
                 
-               // System.out.println("astproperty setter using indexed value " + value + " and srcString: " + srcString);
+                if (!ASTConst.class.isInstance(_children[0])) {
+                    String cast = (String)context.remove(ExpressionCompiler.PRE_CAST);
+                    if (cast != null)
+                        srcString = cast + srcString;
+                }
+
+                if (ASTConst.class.isInstance(_children[0]) && String.class.isInstance(context.getCurrentObject())) {
+                    srcString = "\"" + srcString + "\"";
+                }
+
+                //System.out.println("astproperty setter using indexed value " + value + " and srcString: " + srcString);
                 
                 if (context.get("_indexedMethod") != null) {
                     
                     m = (Method)context.remove("_indexedMethod");
                     
                     _setterClass = m.getParameterTypes()[0];
-                    
+
                     context.setCurrentType(_setterClass);
                     context.setCurrentAccessor(OgnlRuntime.getSuperOrInterfaceClass(m, m.getDeclaringClass()));
                     context.setCurrentObject(target);
                     return m.getName() + "(" + srcString + ")";
                 } else {
                     PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass());
-                    
+
+                    if (ASTConst.class.isInstance(_children[0]) && Number.class.isInstance(context.getCurrentObject()))
+                        context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(context.getCurrentObject().getClass()));
+
                     result = p.getSourceSetter(context, target, srcString);
                     
                     context.setCurrentObject(value);
             
             String name = ((ASTConst) _children[0]).getValue().toString();
             
-            Object tmp = target;
-            
             //System.out.println(" astprop(setter) : trying to set " + name + " on object target " + context.getCurrentObject().getClass().getName());
             
             if (!Iterator.class.isAssignableFrom(context.getCurrentObject().getClass()) 
                     || (Iterator.class.isAssignableFrom(context.getCurrentObject().getClass()) &&  name.indexOf("next") < 0)) {
-                
+
+                Object currObj = target;
+
                 try {
                     target = getValue(context, context.getCurrentObject());
                 } catch (NoSuchPropertyException e) {
                     try {
                         
                         target = getValue(context, context.getRoot());
-                        context.setCurrentObject(tmp);
                         
                     } catch (NoSuchPropertyException ex) { }
+                } finally {
+
+                    context.setCurrentObject(currObj);
                 }
             }
             
-            context.setCurrentObject(tmp);
-            
             PropertyDescriptor pd = OgnlRuntime.getPropertyDescriptor(OgnlRuntime.getCompiler().getInterfaceClass(context.getCurrentObject().getClass()), name);
             
             if (pd != null && this.getIndexedPropertyType(context, context.getCurrentObject()) > 0){
                 
             } else {
                 
-                context.setCurrentObject(tmp);
-                
-                //System.out.println("astproperty trying to set " + name + " on object target: " + context.getCurrentObject().getClass().getName());
+                // System.out.println("astproperty trying to set " + name + " on object target: " + context.getCurrentObject().getClass().getName());
                 
                 PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
                 
                         result = "";
                     } else if (pa != null) {
 
-                        Object prevObj = context.getCurrentObject();
-                        Class prev = context.getCurrentType();
+                        Object currObj = context.getCurrentObject();
+                        //Class currType = context.getCurrentType();
+                        //Class prevType = context.getPreviousType();
+
+                        String srcString = _children[0].toGetSourceString(context, context.getRoot());
+                        
+                        if (ASTConst.class.isInstance(_children[0]) && String.class.isInstance(context.getCurrentObject())) {
+                            srcString = "\"" + srcString + "\"";
+                        }
+
+                        context.setCurrentObject(currObj);
+                        //context.setCurrentType(currType);
+                        //context.setPreviousType(prevType);
 
                         if (!lastChild(context)) {
 
-                            result = pa.getSourceAccessor(context, context.getCurrentObject(),
-                                    _children[0].toGetSourceString(context, context.getRoot()));
+                            result = pa.getSourceAccessor(context, context.getCurrentObject(), srcString);
                         } else {
                             
-                            result = pa.getSourceSetter(context, context.getCurrentObject(), 
-                                    _children[0].toGetSourceString(context, context.getRoot()));
+                            result = pa.getSourceSetter(context, context.getCurrentObject(), srcString);
                         }
-                        
-                        context.setCurrentObject(prevObj);
-                        context.setCurrentType(prev);
-                        
-                        _getterClass = pa.getPropertyClass(context, context.getCurrentObject(), name);
-                        
-                        context.setPreviousType(prev);
-                        context.setCurrentType(_getterClass);
+
+                        _getterClass = context.getCurrentType();
                     } else if (pd != null) {
                         
                         m = pd.getWriteMethod();

File src/java/ognl/ArrayPropertyAccessor.java

         throws OgnlException
     {
         Object result = null;
-
+        
         if (name instanceof String) {
             if (name.equals("length")) {
                 result = new Integer(Array.getLength(target));
 
     public String getSourceAccessor(OgnlContext context, Object target, Object index)
     {
-        String indexStr = (String) index;
-
+        String indexStr = index.toString();
+        
         // need to convert to primitive for list index access
 
-        if (!context.getCurrentType().isPrimitive()) {
+        // System.out.println("index class " + index.getClass() + " current type " + context.getCurrentType() + " current object class " + context.getCurrentObject().getClass());
+
+        if (context.getCurrentType() != null && !context.getCurrentType().isPrimitive()
+            && Number.class.isAssignableFrom(context.getCurrentType())) {
 
             indexStr += "." + OgnlRuntime.getNumericValueGetter(context.getCurrentType());
+        } else if (context.getCurrentObject() != null && Number.class.isAssignableFrom(context.getCurrentObject().getClass())
+                    && !context.getCurrentType().isPrimitive()) {
+
+            // means it needs to be cast first as well
+
+            String toString = String.class.isInstance(index) && context.getCurrentType() != Object.class ? "" : ".toString()";
+
+            indexStr = "java.lang.Integer.valueOf(" + indexStr + toString + ").intValue()";
         }
 
         context.setCurrentAccessor(target.getClass());
 
     public String getSourceSetter(OgnlContext context, Object target, Object index)
     {
-        String indexStr = (String) index;
+        String indexStr = index.toString();
 
         // need to convert to primitive for list index access
 
-        if (!context.getCurrentType().isPrimitive()) {
+        if (context.getCurrentType() != null && !context.getCurrentType().isPrimitive()
+            && Number.class.isAssignableFrom(context.getCurrentType())) {
 
             indexStr += "." + OgnlRuntime.getNumericValueGetter(context.getCurrentType());
+        } else if (context.getCurrentObject() != null && Number.class.isAssignableFrom(context.getCurrentObject().getClass())
+                    && !context.getCurrentType().isPrimitive()) {
+
+            // means it needs to be cast first as well
+
+            String toString = String.class.isInstance(index) && context.getCurrentType() != Object.class ? "" : ".toString()";
+
+            indexStr = "java.lang.Integer.valueOf(" + indexStr + toString + ").intValue()";
         }
 
         Class type = target.getClass().isArray() ? target.getClass().getComponentType() : target.getClass();

File src/java/ognl/ListPropertyAccessor.java

     {
         context.setCurrentAccessor(List.class);
         
+        String indexStr = index.toString().replaceAll("\"", "");
+        
         if (index instanceof String) {
-            
-            String key = ((String)index).replaceAll("\"", "");
-            if (key.equals("size")) {
+
+            if (indexStr.equals("size")) {
                 context.setCurrentType(int.class);
                 return ".size()";
             } else {
-                if (key.equals("iterator")) {
+                if (indexStr.equals("iterator")) {
                     context.setCurrentType(Iterator.class);
                     return ".iterator()";
                 } else {
-                    if (key.equals("isEmpty") || key.equals("empty")) {
+                    if (indexStr.equals("isEmpty") || indexStr.equals("empty")) {
                         context.setCurrentType(boolean.class);
                         return ".isEmpty()";
                     }
                 }
             }
         }
-
-        String indexStr = (String) index;
-
+        
         // need to convert to primitive for list index access
-
-        if (!context.getCurrentType().isPrimitive()) {
+        // System.out.println("Curent type: " + context.getCurrentType() + " current object type " + context.getCurrentObject().getClass());
+        
+        if (!context.getCurrentType().isPrimitive() && Number.class.isAssignableFrom(context.getCurrentType())) {
             
             indexStr += "." + OgnlRuntime.getNumericValueGetter(context.getCurrentType());
+        }  else if (context.getCurrentObject() != null && Number.class.isAssignableFrom(context.getCurrentObject().getClass())
+                    && !context.getCurrentType().isPrimitive()) {
+
+            // means it needs to be cast first as well
+
+            String toString = String.class.isInstance(index) && context.getCurrentType() != Object.class ? "" : ".toString()";
+
+            indexStr = "java.lang.Integer.valueOf(" + indexStr + toString + ").intValue()";
         }
-
+        
+        context.setCurrentType(Object.class);
+        
         return ".get(" + indexStr + ")";
     }
 
     {
         context.setCurrentAccessor(List.class);
         
+        String indexStr = index.toString().replaceAll("\"", "");
+        
         if (index instanceof String) {
             return "";
         }
 
-        String indexStr = (String) index;
-
         // need to convert to primitive for list index access
 
-        if (!context.getCurrentType().isPrimitive()) {
+        if (!context.getCurrentType().isPrimitive() && Number.class.isAssignableFrom(context.getCurrentType())) {
 
             indexStr += "." + OgnlRuntime.getNumericValueGetter(context.getCurrentType());
+        }  else if (context.getCurrentObject() != null && Number.class.isAssignableFrom(context.getCurrentObject().getClass())
+                    && !context.getCurrentType().isPrimitive()) {
+
+            // means it needs to be cast first as well
+
+            String toString = String.class.isInstance(index) && context.getCurrentType() != Object.class ? "" : ".toString()";
+
+            indexStr = "java.lang.Integer.valueOf(" + indexStr + toString + ").intValue()";
         }
         
+        context.setCurrentType(Object.class);
+        
         return ".set(" + indexStr + ", $3)";
     }
 }

File src/java/ognl/MapPropertyAccessor.java

         }
 
         return Object.class;
-        /*
-        if (Map.class.isAssignableFrom(target.getClass())) {
-            Object result = ((Map)target).get(index);
-            if (result != null)
-                return result.getClass();
-        }*/
-        
-        // return Object.class;
     }
 
     public String getSourceAccessor(OgnlContext context, Object target, Object index)
             indexedAccess = ((ASTProperty) currentNode).isIndexedAccess();
         }
         
+        String indexStr = index.toString();
+
         context.setCurrentAccessor(Map.class);
         context.setCurrentType(Object.class);
         
         if (String.class.isAssignableFrom(index.getClass()) && !indexedAccess) {
-            String key = ((String)index).replaceAll("\"", "");
+            String key = indexStr.replaceAll("\"", "");
             
             if (key.equals("size")) {
                 context.setCurrentType(int.class);
             }
         }
         
-        return ".get(" + index + ")";
+        return ".get(" + indexStr + ")";
     }
     
     public String getSourceSetter(OgnlContext context, Object target, Object index)
     {
         context.setCurrentAccessor(Map.class);
         context.setCurrentType(Object.class);
-        
+
+        String indexStr = index.toString();
+
         if (String.class.isAssignableFrom(index.getClass())) {
-            String key = ((String)index).replaceAll("\"", "");
+            String key = indexStr.replaceAll("\"", "");
             
             if (key.equals("size"))
                 return "";
                 return "";
         }
         
-        return ".put(" + index + ", $3)";
+        return ".put(" + indexStr + ", $3)";
     }
 }

File src/java/ognl/ObjectPropertyAccessor.java

     {
         Object result = null;
         String name = oname.toString();
-
+        
         result = getPossibleProperty(context, target, name);
 
         if (result == OgnlRuntime.NotFound) {
     {
         String name = oname.toString();
 
-        if (setPossibleProperty(context, target, name, value) == OgnlRuntime.NotFound) {
+        Object result = setPossibleProperty(context, target, name, value);
+        
+        if (result == OgnlRuntime.NotFound) {
             throw new NoSuchPropertyException(target, name);
         }
     }
 
                 return null;
             }
-
+            
             return m.getReturnType();
 
         } catch (Throwable t) {
     public String getSourceAccessor(OgnlContext context, Object target, Object index)
     {
         try {
-            Method m = OgnlRuntime.getReadMethod(target.getClass(), index.toString());
+
+            String methodName = index.toString().replaceAll("\"", "");
+            
+            Method m = OgnlRuntime.getReadMethod(target.getClass(), methodName);
 
             // try to get field if no method could be found 
 
 
                 try {
                     if (String.class.isAssignableFrom(index.getClass()) && !target.getClass().isArray()) {
-                        String key = ((String) index).replaceAll("\"", "");
-                        Field f = target.getClass().getField(key);
+                        
+                        Field f = target.getClass().getField(methodName);
                         if (f != null) {
 
                             context.setCurrentType(f.getType());
     public String getSourceSetter(OgnlContext context, Object target, Object index)
     {
         try {
-            Method m = OgnlRuntime.getWriteMethod(target.getClass(), index.toString());
+
+            String methodName = index.toString().replaceAll("\"", "");
+            
+            Method m = OgnlRuntime.getWriteMethod(target.getClass(), methodName);
 
             if (m == null)
                 return "";

File src/java/ognl/SimpleNode.java

             result = evaluateGetValueBody(context, source);
         }
         
-        /*
-        if (ASTConst.class.isInstance(this) && result != null
-                && Number.class.isAssignableFrom(result.getClass())) {
-            
-            context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(result.getClass()));
-        } else {
-            
-            context.setCurrentType(result != null ? result.getClass() : null);
-        }*/
-        
         return result;
     }
 

File src/java/ognl/enhance/ExpressionCompiler.java

                 || (OrderedReturn.class.isInstance(expression) && ((OrderedReturn)expression).getLastExpression() != null))
             return body;
 
-        /*
+/*
         System.out.println("castExpression() with expression " + expression + " currentType is: " + context.getCurrentType()
                 + " previousType: " + context.getPreviousType()
                 + "\n current Accessor: " + context.getCurrentAccessor()
             castClass = ExpressionCompiler.getCastString(context.getCurrentAccessor());
         } else
             castClass = OgnlRuntime.getCompiler().getInterfaceClass(context.getCurrentAccessor()).getName();
-        
+
         ExpressionCompiler.addCastString(context, "((" + castClass + ")");
         
         return ")" + body;
     public void compileExpression(OgnlContext context, Node expression, Object root)
     throws Exception
     {
-        // System.out.println("Compiling expr class " + expression.getClass().getName() + " and root " + root);
+        //System.out.println("Compiling expr class " + expression.getClass().getName() + " and root " + root);
         
         if (expression.getAccessor() != null)
             return;
         }
         
         body = body.replaceAll("\\.\\.", ".");
-        
-        //System.out.println("Getter Body: ===================================\n"+body);
+
+        // System.out.println("Getter Body: ===================================\n"+body);
         valueGetter.setBody(body);
 
         newClass.addMethod(valueGetter);
         
         body = body.replaceAll("\\.\\.", ".");
         
-        // System.out.println("Setter Body: ===================================\n"+body);
+        //System.out.println("Setter Body: ===================================\n"+body);
         
         if (setterCode.indexOf("$3") < 0)
             setterCode = "";

File src/test/java/org/ognl/test/ASTMethodTest.java

         assertEquals(context.getCurrentObject(), val.getBean3());
         assertEquals(context.getCurrentType(), Bean3.class);
         assertEquals(context.getCurrentAccessor(), Bean2.class);
-        assertEquals(context.getPreviousType(), Object.class);
+        assertEquals(Object.class, context.getPreviousType());
         assert Map.class.isAssignableFrom(context.getPreviousAccessor());
         
         assertEquals(OgnlRuntime.getCompiler().castExpression(context, prop, ".getBean3()"), ").getBean3()");

File src/test/java/org/ognl/test/ASTPropertyTest.java

  */
 public class ASTPropertyTest extends TestCase {
 
+    public void test_Get_Indexed_Property_Type() throws Exception
+    {
+        ASTProperty p = new ASTProperty(0);
+        p.setIndexedAccess(false);
+        ASTConst pRef = new ASTConst(0);
+        pRef.setValue("nested");
+        pRef.jjtSetParent(p);
+        p.jjtAddChild(pRef, 0);
+
+        Map root = new Root().getMap();
+
+        OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
+        context.setRoot(root);
+        context.setCurrentObject(root);
+        context.setCurrentNode(pRef);
+
+        assertEquals(null, context.getCurrentType());
+        assertEquals(null, context.getPreviousType());
+        assertEquals(root, context.getCurrentObject());
+        assertEquals(null, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousAccessor());
+
+        int type = p.getIndexedPropertyType(context, root);
+
+        assertEquals(OgnlRuntime.INDEXED_PROPERTY_NONE, type);
+        assertEquals(null, context.getCurrentType());
+        assertEquals(null, context.getPreviousType());
+        assertEquals(null, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousAccessor());
+    }
+
+    public void test_Get_Value_Body() throws Exception
+    {
+        ASTProperty p = new ASTProperty(0);
+        p.setIndexedAccess(false);
+        ASTConst pRef = new ASTConst(0);
+        pRef.setValue("nested");
+        pRef.jjtSetParent(p);
+        p.jjtAddChild(pRef, 0);
+
+        Map root = new Root().getMap();
+
+        OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
+        context.setRoot(root);
+        context.setCurrentObject(root);
+        context.setCurrentNode(pRef);
+
+        assertEquals(null, context.getCurrentType());
+        assertEquals(null, context.getPreviousType());
+        assertEquals(root, context.getCurrentObject());
+        assertEquals(null, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousAccessor());
+
+        Object value = p.getValue(context, root);
+
+        assertEquals(root.get("nested"), value);
+        assertEquals(null, context.getCurrentType());
+        assertEquals(null, context.getPreviousType());
+        assertEquals(null, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousAccessor());
+    }
+
     public void test_Get_Source()
             throws Throwable
     {
         
         assertEquals(".get(\"nested\")", p.toGetSourceString(context, root));
         assertEquals(Object.class, context.getCurrentType());
+        assertEquals(Map.class, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousType());
+        assertEquals(null, context.getPreviousAccessor());
+
         assertEquals(root.get("nested"), context.getCurrentObject());
 
         assert Map.class.isAssignableFrom(context.getCurrentAccessor());
         assertEquals(null, context.getPreviousType());
         assertEquals(null, context.getPreviousAccessor());
     }
-    
+
+    public void test_Indexed_Object_Type()
+            throws Throwable
+    {
+        //ASTChain chain = new ASTChain(0);
+        
+        ASTProperty listp = new ASTProperty(0);
+        listp.setIndexedAccess(false);
+        //listp.jjtSetParent(chain);
+
+        ASTConst listc = new ASTConst(0);
+        listc.setValue("list");
+        listc.jjtSetParent(listp);
+        listp.jjtAddChild(listc, 0);
+
+        //chain.jjtAddChild(listp, 0);
+
+        ASTProperty p = new ASTProperty(0);
+        p.setIndexedAccess(true);
+
+        ASTProperty pindex = new ASTProperty(0);
+
+        ASTConst pRef = new ASTConst(0);
+        pRef.setValue("genericIndex");
+        pRef.jjtSetParent(pindex);
+        pindex.jjtAddChild(pRef, 0);
+        
+        p.jjtAddChild(pindex, 0);
+        //chain.jjtAddChild(p, 1);
+        
+        Root root = new Root();
+
+        OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
+        context.setRoot(root);
+        context.setCurrentObject(root);
+        context.setCurrentNode(listp);
+
+        assertEquals(".getList()", listp.toGetSourceString(context, root));
+        assertEquals(List.class, context.getCurrentType());
+        assertEquals(Root.class, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousAccessor());
+        assertEquals(null, context.getPreviousType());
+        assertEquals(root.getList(), context.getCurrentObject());
+
+
+        // re test with chain
+        
+        context = (OgnlContext) Ognl.createDefaultContext(null);
+        context.setRoot(root);
+        context.setCurrentObject(root);
+
+        ASTChain chain = new ASTChain(0);
+        listp.jjtSetParent(chain);
+        chain.jjtAddChild(listp, 0);
+
+        context.setCurrentNode(chain);
+
+        assertEquals(".getList()", chain.toGetSourceString(context, root));
+        assertEquals(List.class, context.getCurrentType());
+        assertEquals(Root.class, context.getCurrentAccessor());
+        assertEquals(null, context.getPreviousAccessor());
+        assertEquals(Root.class, context.getPreviousType());
+        assertEquals(root.getList(), context.getCurrentObject());
+
+        // test with only getIndex
+
+        assertEquals(".get(java.lang.Integer.valueOf(((org.ognl.test.objects.Root)$2)..getGenericIndex().toString()).intValue())", p.toGetSourceString(context, root.getList()));
+        assertEquals(root.getArray(), context.getCurrentObject());
+        assertEquals(root.getArray().getClass().getComponentType(), context.getCurrentType());
+    }
+
     public void test_Complicated_List() throws Exception
     {
         Root root = new Root();

File src/test/java/org/ognl/test/CollectionDirectPropertyTest.java

 
     private static Object[][] TESTS = {
             // Collection direct properties
+            
             { Arrays.asList(new String[] { "hello", "world" }), "size", new Integer(2) },
             { Arrays.asList(new String[] { "hello", "world" }), "isEmpty", Boolean.FALSE },
             { Arrays.asList(new String[] {}), "isEmpty", Boolean.TRUE },

File src/test/java/org/ognl/test/IndexAccessTest.java

 
 import junit.framework.TestSuite;
 import ognl.MethodFailedException;
+import ognl.NoSuchPropertyException;
 import org.ognl.test.objects.Root;
 
 public class IndexAccessTest extends OgnlTestCase {
             {ROOT, "list[index]", ROOT.getList().get(ROOT.getIndex())},
             {ROOT, "list[objectIndex]", ROOT.getList().get(ROOT.getObjectIndex().intValue())},
             {ROOT, "array[objectIndex]", ROOT.getArray()[ROOT.getObjectIndex().intValue()] },
+            {ROOT, "array[getObjectIndex()]", ROOT.getArray()[ROOT.getObjectIndex().intValue()] },
+            {ROOT, "array[genericIndex]", ROOT.getArray()[((Integer)ROOT.getGenericIndex()).intValue()] },
+            {ROOT, "booleanArray[self.objectIndex]", Boolean.FALSE },
+            {ROOT, "booleanArray[getObjectIndex()]", Boolean.FALSE },
+            {ROOT, "booleanArray[nullIndex]", NoSuchPropertyException.class},
             {ROOT, "list[size() - 1]", MethodFailedException.class},
             {ROOT, "(index == (array.length - 3)) ? 'toggle toggleSelected' : 'toggle'", "toggle toggleSelected"},
-            {ROOT, "\"return toggleDisplay('excdisplay\"+index+\"', this)\"", "return toggleDisplay('excdisplay1', this)"} 
+            {ROOT, "\"return toggleDisplay('excdisplay\"+index+\"', this)\"", "return toggleDisplay('excdisplay1', this)"}
     };
 
     /*

File src/test/java/org/ognl/test/InterfaceInheritanceTest.java

         { ROOT, "myMap.test", ROOT },
         { ROOT.getMyMap(), "list", ROOT.getList() },
         { ROOT, "myMap.array[0]", new Integer(ROOT.getArray()[0]) },
-        { ROOT, "myMap.list[1]", ROOT.getList().get(1) }, 
+        { ROOT, "myMap.list[1]", ROOT.getList().get(1) },
         { ROOT, "myMap[^]", new Integer(99) },
         { ROOT, "myMap[$]", null },
         { ROOT.getMyMap(), "array[$]", new Integer(ROOT.getArray()[ROOT.getArray().length - 1]) },

File src/test/java/org/ognl/test/ObjectIndexedPropertyTest.java

     private static Bean1 root = new Bean1();
     private static Object[][] TESTS = {
             // Arbitrary indexed properties
-            {OBJECT_INDEXED, "attributes[\"bar\"]", "baz"}, // get non-indexed property through
+            {OBJECT_INDEXED, "attributes[\"bar\"]", "baz"}, // get non-indexed property through 
             // attributes Map
             {OBJECT_INDEXED, "attribute[\"foo\"]", "bar"}, // get indexed property
             {OBJECT_INDEXED, "attribute[\"bar\"]", "baz", "newValue", "newValue"}, // set
             // access to object indexed
             // property
             {root, "bean2.bean3.indexedValue[25]", null}
-
     };
 
     /*
         for (int i = 0; i < TESTS.length; i++) {
             if (TESTS[i].length == 3) {
                 result.addTest(new ObjectIndexedPropertyTest((String) TESTS[i][1], TESTS[i][0], (String) TESTS[i][1],
-                                                             TESTS[i][2]));
+                        TESTS[i][2]));
             } else {
                 if (TESTS[i].length == 4) {
                     result.addTest(new ObjectIndexedPropertyTest((String) TESTS[i][1], TESTS[i][0],
-                                                                 (String) TESTS[i][1], TESTS[i][2], TESTS[i][3]));
+                            (String) TESTS[i][1], TESTS[i][2], TESTS[i][3]));
                 } else {
                     if (TESTS[i].length == 5) {
                         result.addTest(new ObjectIndexedPropertyTest((String) TESTS[i][1], TESTS[i][0],
-                                                                     (String) TESTS[i][1], TESTS[i][2], TESTS[i][3], TESTS[i][4]));
+                                (String) TESTS[i][1], TESTS[i][2], TESTS[i][3], TESTS[i][4]));
                     } else {
                         throw new RuntimeException("don't understand TEST format");
                     }

File src/test/java/org/ognl/test/accessors/ListPropertyAccessorTest.java

+package org.ognl.test.accessors;
+
+import junit.framework.TestCase;
+import ognl.ListPropertyAccessor;
+import ognl.Ognl;
+import ognl.OgnlContext;
+import org.ognl.test.objects.Root;
+
+import java.util.List;
+
+/**
+ * Tests functionality of various built in object accessors.
+ */
+public class ListPropertyAccessorTest extends TestCase {
+
+    public void test_Get_Source_String_Number_Index()
+    {
+        ListPropertyAccessor pa = new ListPropertyAccessor();
+
+        Root root = new Root();
+
+        OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
+        context.setRoot(root);
+        context.setCurrentObject(root);
+        context.setCurrentType(Integer.TYPE);
+
+        assertEquals(".get(0)", pa.getSourceAccessor(context, root.getList(), "0"));
+
+        assertEquals(List.class, context.getCurrentAccessor());
+        assertEquals(Object.class, context.getCurrentType());
+        assertEquals(Integer.TYPE, context.getPreviousType());
+        assertEquals(null, context.getPreviousAccessor());
+    }
+
+    public void test_Get_Source_Object_Number_Index()
+    {
+        ListPropertyAccessor pa = new ListPropertyAccessor();
+
+        Root root = new Root();
+
+        OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
+        context.setRoot(root);
+        context.setCurrentObject(root);
+        context.setCurrentType(Integer.class);
+
+        assertEquals(".get(indexValue.intValue())", pa.getSourceAccessor(context, root.getList(), "indexValue"));
+
+        assertEquals(List.class, context.getCurrentAccessor());
+        assertEquals(Object.class, context.getCurrentType());
+        assertEquals(Integer.class, context.getPreviousType());
+        assertEquals(null, context.getPreviousAccessor());
+    }
+
+    
+}

File src/test/java/org/ognl/test/objects/BeanProviderAccessor.java

 
             ExpressionCompiler.addCastString(context, "(("
                     + OgnlRuntime.getCompiler().getInterfaceClass(provider.getBean(beanName).getClass()).getName() + ")");
-
-            return ".getBean(" + name + "))";
+            
+            return ".getBean(\"" + beanName + "\"))";
         }
         
         return super.getSourceAccessor(context, target, name);

File src/test/java/org/ognl/test/objects/Root.java

     private boolean _disabled;
     private Locale _selected = Locale.getDefault();
 
+    private boolean[] _booleanArray = {true, false, true, true};
     private List _list;
     private int verbosity = 87;
     private BeanProvider _beanProvider = new BeanProviderImpl();
     private boolean _render;
     private Boolean _readOnly = Boolean.FALSE;
     private Integer _objIndex = new Integer(1);
+    private Object _genericObjIndex = new Integer(2);
 
     /*===================================================================
 		Public static methods
         return array;
     }
 
+    public boolean[] getBooleanArray()
+    {
+        return _booleanArray;
+    }
+
     public void setArray(int[] value)
     {
         array = value;
         return _objIndex;
     }
 
+    public Integer getNullIndex()
+    {
+        return null;
+    }
+
+    public Object getGenericIndex()
+    {
+        return _genericObjIndex;
+    }
+
     public int getIntValue()
     {
         return intValue;
     {
         _readOnly = value;
     }
+
+    public Object getSelf()
+    {
+        return this;
+    }
 }