Commits

jkuh...@d4b077e3-5828-0410-b394-cb2b42183085  committed 34748b6

Fixes for OGNL-119. ASTChain had bug in indexed setter evaluation loop which caused it improperly not detect valid indexed set operations. Thanks to Max Bowsher for pointing that out.

  • Participants
  • Parent commits 24fe59d

Comments (0)

Files changed (16)

     <output-test url="file://$MODULE_DIR$/target/test-classes" />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/build" />
       <excludeFolder url="file://$MODULE_DIR$/dist" />
       <excludeFolder url="file://$MODULE_DIR$/extlib" />
+      <excludeFolder url="file://$MODULE_DIR$/lib" />
       <excludeFolder url="file://$MODULE_DIR$/target/apidocs" />
-      <excludeFolder url="file://$MODULE_DIR$/target/classes" />
       <excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
       <excludeFolder url="file://$MODULE_DIR$/target/surefire-reports" />
-      <excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="jboss:javassist:3.6.ga">
+      <library name="jboss:javassist:3.7.ga">
         <CLASSES>
-          <root url="jar://$USERPROFILE$/.m2/repository/jboss/javassist/3.6.ga/javassist-3.6.ga.jar!/" />
+          <root url="jar://$USERPROFILE$/.m2/repository/jboss/javassist/3.7.ga/javassist-3.7.ga.jar!/" />
         </CLASSES>
         <JAVADOC>
-          <root url="jar://$USERPROFILE$/.m2/repository/jboss/javassist/3.6.ga/javassist-3.6.ga-javadoc.jar!/" />
+          <root url="jar://$USERPROFILE$/.m2/repository/jboss/javassist/3.7.ga/javassist-3.7.ga-javadoc.jar!/" />
         </JAVADOC>
         <SOURCES>
-          <root url="jar://$USERPROFILE$/.m2/repository/jboss/javassist/3.6.ga/javassist-3.6.ga-sources.jar!/" />
+          <root url="jar://$USERPROFILE$/.m2/repository/jboss/javassist/3.7.ga/javassist-3.7.ga-sources.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
 <?xml version="1.0" encoding="UTF-8"?>
-<project relativePaths="false" version="4">
+<project relativePaths="true" version="4">
   <component name="AntConfiguration">
     <defaultAnt name="Apache Ant version 1.6.5" />
     <buildFile url="file://$PROJECT_DIR$/build.xml">
   <component name="ChangeListManager">
     <list default="true" name="Default" comment="">
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OGNL.iml" afterPath="$PROJECT_DIR$/OGNL.iml" />
-      <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$/OGNL.iws" afterPath="$PROJECT_DIR$/OGNL.iws" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OGNL.ipr" afterPath="$PROJECT_DIR$/OGNL.ipr" />
+      <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/ASTProperty.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTProperty.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/SimpleNode.java" afterPath="$PROJECT_DIR$/src/java/ognl/SimpleNode.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTMethod.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTMethod.java" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/build/javassist.jar" afterPath="$PROJECT_DIR$/lib/build/javassist.jar" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/OgnlContext.java" afterPath="$PROJECT_DIR$/src/java/ognl/OgnlContext.java" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/PropertySetterTest.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/ASTChain.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTChain.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$/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/java/ognl/ObjectPropertyAccessor.java" afterPath="$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/pom.xml" afterPath="$PROJECT_DIR$/pom.xml" />
-      <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/test/java/org/ognl/test/StaticsAndConstructorsTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/StaticsAndConstructorsTest.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/IndexedSetObject.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/ASTChainTest.java" />
     </list>
   </component>
   <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
     </subPane>
   </component>
   <component name="FileEditorManager">
-    <leaf>
-      <file leaf-file-name="pom.xml" pinned="false" current="true" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/pom.xml">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="23" column="0" selection-start="768" selection-end="768" vertical-scroll-proportion="0.28797996">
-              <folding />
-            </state>
-          </provider>
-        </entry>
-      </file>
-    </leaf>
+    <leaf />
   </component>
   <component name="FindManager">
     <FindUsagesManager>
     <option name="jreName" value="1.5" />
     <option name="runMavenInBackground" value="true" />
     <option name="skipTests" value="true" />
-    <option name="syncAfterBuild" value="false" />
   </component>
   <component name="ModuleEditorState">
     <option name="LAST_EDITED_MODULE_NAME" />
     <option name="lastEditedConfigurable" value="General" />
   </component>
   <component name="ProjectView">
-    <navigator currentView="ProjectPane" proportions="0.5" version="1" splitterProportion="0.5">
+    <navigator currentView="ProjectPane" proportions="0.16666667" version="1" splitterProportion="0.5">
       <flattenPackages />
       <showMembers />
       <showModules />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth0" value="316" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth3" value="35" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth2" value="336" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatOrder1" value="1" />
     <property name="cvs_file_history_treeOrder2" value="2" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatOrder1" value="1" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatOrder0" value="0" />
     <property name="cvs_file_history_treeOrder1" value="1" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatOrder3" value="3" />
     <property name="last_opened_file_path" value="$TEMPLATE$/projects/tapestry/tapestry-framework/src/java/org/apache/tapestry/enhance" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth0" value="268" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth4" value="1067" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth3" value="269" />
     <property name="GoToClass.includeJavaFiles" value="false" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth3" value="269" />
     <property name="GoToClass.toSaveIncludeLibraries" value="false" />
     <property name="cvs_file_history_treeWidth0" value="503" />
     <property name="cvs_file_history_treeWidth1" value="503" />
     <property name="cvs_file_history_treeWidth2" value="504" />
+    <property name="cvs_file_history_flatWidth2" value="504" />
     <property name="cvs_file_history_treeWidth3" value="503" />
-    <property name="cvs_file_history_flatWidth2" value="504" />
+    <property name="cvs_file_history_flatWidth3" value="503" />
     <property name="cvs_file_history_treeOrder0" value="0" />
-    <property name="cvs_file_history_flatWidth3" value="503" />
     <property name="MemberChooser.showClasses" value="true" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth4" value="1129" />
     <property name="cvs_file_history_flatWidth0" value="503" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth4" value="1129" />
     <property name="cvs_file_history_flatWidth1" value="503" />
     <property name="GoToClass.includeLibraries" value="false" />
     <property name="GoToFile.includeJavaFiles" value="false" />
     <property name="RunManagerConfig.compileBeforeRunning" value="true" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder3" value="3" />
     <property name="cvs_file_history_flatOrder2" value="2" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder3" value="3" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder4" value="4" />
     <property name="cvs_file_history_flatOrder3" value="3" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder4" value="4" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder1" value="1" />
     <property name="cvs_file_history_flatOrder0" value="0" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder1" value="1" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder2" value="2" />
     <property name="cvs_file_history_flatOrder1" value="1" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder2" value="2" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeOrder0" value="0" />
     <property name="MemberChooser.copyJavadoc" value="false" />
   </component>
     <option name="referencePos" value="0" />
     <option name="showLabels" value="true" />
   </component>
-  <component name="RunManager" selected="JUnit.ConstantTest">
-    <tempConfiguration default="false" name="ConstantTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+  <component name="RunManager" selected="JUnit.IndexedPropertyTest">
+    <tempConfiguration default="false" name="IndexedPropertyTest" 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" value="/usr/local/jdk1.6.0_02" />
       <option name="PACKAGE_NAME" value="org.ognl.test" />
-      <option name="MAIN_CLASS_NAME" value="org.ognl.test.ConstantTest" />
+      <option name="MAIN_CLASS_NAME" value="org.ognl.test.IndexedPropertyTest" />
       <option name="METHOD_NAME" value="" />
       <option name="TEST_OBJECT" value="class" />
       <option name="VM_PARAMETERS" value="" />
         <option name="Make" value="true" />
       </method>
     </tempConfiguration>
+    <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" />
+      <option name="ENV_VARIABLES" />
+      <option name="PASS_PARENT_ENVS" value="true" />
+      <module name="" />
+      <envs />
+      <method>
+        <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="JUnit" factoryName="JUnit" enabled="false" merge="false">
+      <module name="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" value="/usr/local/jdk1.6.0_02" />
+      <option name="PACKAGE_NAME" />
+      <option name="MAIN_CLASS_NAME" value="" />
+      <option name="METHOD_NAME" value="" />
+      <option name="TEST_OBJECT" value="class" />
+      <option name="VM_PARAMETERS" value="" />
+      <option name="PARAMETERS" value="" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+      <option name="ENV_VARIABLES" />
+      <option name="PASS_PARENT_ENVS" value="true" />
+      <option name="ADDITIONAL_CLASS_PATH" />
+      <option name="TEST_SEARCH_SCOPE">
+        <value defaultName="wholeProject" />
+      </option>
+      <envs />
+      <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" />
-      <option name="ENV_VARIABLES" />
-      <option name="PASS_PARENT_ENVS" value="true" />
-      <module name="" />
-      <envs />
-      <method>
-        <option name="Make" value="true" />
-      </method>
-    </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" value="/usr/local/jdk1.6.0_02" />
-      <option name="PACKAGE_NAME" />
-      <option name="MAIN_CLASS_NAME" value="" />
-      <option name="METHOD_NAME" value="" />
-      <option name="TEST_OBJECT" value="class" />
-      <option name="VM_PARAMETERS" value="" />
-      <option name="PARAMETERS" value="" />
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ENV_VARIABLES" />
-      <option name="PASS_PARENT_ENVS" value="true" />
-      <option name="ADDITIONAL_CLASS_PATH" />
-      <option name="TEST_SEARCH_SCOPE">
-        <value defaultName="wholeProject" />
-      </option>
-      <envs />
-      <method>
-        <option name="Make" value="true" />
-      </method>
-    </configuration>
     <configuration default="true" type="Remote" factoryName="Remote">
       <option name="USE_SOCKET_TRANSPORT" value="true" />
       <option name="SERVER_MODE" value="false" />
       <option name="PORT" value="5005" />
     </configuration>
     <list size="1">
-      <item index="0" class="java.lang.String" itemvalue="JUnit.ConstantTest" />
+      <item index="0" class="java.lang.String" itemvalue="JUnit.IndexedPropertyTest" />
     </list>
     <configuration default="true" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local">
       <option name="WORKING_DIRECTORY" />
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="187" y="145" width="2276" height="1397" extended-state="0" />
+    <frame x="177" y="88" width="2273" height="1438" extended-state="0" />
     <editor active="false" />
     <layout>
       <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.30128205" order="8" />
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.14343707" order="1" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32371795" order="1" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3235066" order="1" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.5040064" order="3" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32932693" order="8" />
       <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.28445512" order="8" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="7" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24943617" order="1" />
-      <window_info id="Maven projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18132612" order="3" />
+      <window_info id="Maven projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18112014" 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="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.27695084" order="0" />
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25022584" order="0" />
       <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="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.3488372" order="6" />
       <window_info id="Duplicates" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32772437" order="2" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33204034" order="2" />
       <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="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
     <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
     <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
     <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
-    <option name="LAST_COMMIT_MESSAGE" value="Updated pom version to 2.7.3-SNAPSHOT." />
+    <option name="LAST_COMMIT_MESSAGE" value="Fixes for OGNL-119.  ASTChain had bug in indexed setter evaluation loop which caused it improperly not detect valid indexed set operations. Thanks to Max Bowsher for pointing that out." />
     <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
     <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
     <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
     <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
     <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
     <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
-    <MESSAGE value="Added in as much support for varargs method calling as possible for OGNL-127,  only to find out that javassist blows up on it.  .." />
-    <MESSAGE value="More OgnlRuntime fixes for varargs handling." />
-    <MESSAGE value="Fixes for OGNL-130.  Two dimensional List access was improperly stealing pre-cast statements from ASTProperty children." />
     <MESSAGE value="Fixed ASTProperty bug that only shows up in jre 1.6." />
     <MESSAGE value="Fixed ASTProperty bug that only shows up in jre 1.6.  Wasn't able to resolve simple getValue() property because a hasValue() method existed.. Changed to use propery descriptor first and fall back to propertyaccessors when that is null so that actual settable/gettable properties are found first." />
     <MESSAGE value="Additional unit tests for OGNL-131.  Found problem but real fix is needed in Tapestry." />
     <MESSAGE value="Updated to latest slightly improved javacc version and re-generated language parser." />
     <MESSAGE value="Updated pom version to just 2.7.2." />
     <MESSAGE value="Updated pom version to 2.7.3-SNAPSHOT." />
+    <MESSAGE value="One more improvement for OGNL-115 constant modification bug handling in ASTConst class itself." />
+    <MESSAGE value="May fix OGNL-144.  Impossible to tell without knowing more but PropertyDescriptors aren't guaranteed to have read methods anyways so .." />
+    <MESSAGE value="Fixes for OGNL-119.  ASTChain had bug in indexed setter evaluation loop which caused it improperly not detect valid indexed set operations. Thanks to Max Bowsher for pointing that out." />
   </component>
   <component name="VssConfiguration">
     <option name="CLIENT_PATH" value="" />
     <option name="myLastEditedConfigurable" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/PropertySetterTest.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTMethod.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="64" column="5" selection-start="1401" selection-end="1401" vertical-scroll-proportion="0.58801496">
+        <state line="325" column="69" selection-start="12727" selection-end="12727" vertical-scroll-proportion="0.13244228">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/StaticsAndConstructorsTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="63" column="6" selection-start="3889" selection-end="3889" vertical-scroll-proportion="0.5832321">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/ListSourceImpl.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="12" column="0" selection-start="183" selection-end="183" vertical-scroll-proportion="0.21871203">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ListPropertyAccessor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="221" column="0" selection-start="8473" selection-end="8473" vertical-scroll-proportion="0.2709599">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/MapPropertyAccessor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="119" column="33" selection-start="4707" selection-end="4707" vertical-scroll-proportion="0.54434997">
+          <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="45" column="0" selection-start="2101" selection-end="2101" vertical-scroll-proportion="0.035771064">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="294" column="88" selection-start="11541" selection-end="11541" vertical-scroll-proportion="1.145808">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Bean3.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="63" column="0" selection-start="2296" selection-end="2296" vertical-scroll-proportion="0.43742406">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ObjectIndexedPropertyDescriptor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="107" column="0" selection-start="5015" selection-end="5015" vertical-scroll-proportion="0.59902793">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/enhance/TestExpressionCompiler.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="163" column="32" selection-start="4633" selection-end="4633" vertical-scroll-proportion="0.35612082">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/BaseIndexed.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="10" column="5" selection-start="183" selection-end="183" vertical-scroll-proportion="0.18226002">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/IndexedPropertyTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="37" column="0" selection-start="1913" selection-end="1913" vertical-scroll-proportion="0.07154213">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTChain.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="274" column="0" selection-start="11569" selection-end="11569" vertical-scroll-proportion="0.31558028">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTProperty.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="548" column="0" selection-start="23012" selection-end="23012" vertical-scroll-proportion="0.16534181">
           <folding>
             <element signature="imports" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/SimpleNode.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="132" column="0" selection-start="3989" selection-end="3989" vertical-scroll-proportion="0.33083645">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTMethod.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="464" column="13" selection-start="19815" selection-end="19815" vertical-scroll-proportion="0.5131086">
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ArrayElementsTest.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="58" column="0" selection-start="3073" selection-end="3073" vertical-scroll-proportion="0.30813476">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlContext.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="211" column="21" selection-start="7685" selection-end="7685" vertical-scroll-proportion="0.5830212">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="jar:///usr/local/java15/src.zip!/java/lang/Character.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="241" column="6" selection-start="8429" selection-end="8429" vertical-scroll-proportion="-1.764045">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTConst.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="198" column="0" selection-start="6322" selection-end="6322" vertical-scroll-proportion="0.66292137">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ArrayPropertyAccessor.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="205" column="0" selection-start="8266" selection-end="8266" vertical-scroll-proportion="0.6441948">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTProperty.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="437" column="21" selection-start="17888" selection-end="17888" vertical-scroll-proportion="0.4868914">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTChain.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="389" column="16" selection-start="16155" selection-end="16155" vertical-scroll-proportion="0.31835207">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="166" column="61" selection-start="6894" selection-end="6894" vertical-scroll-proportion="0.4456929">
-          <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="91" column="58" selection-start="5648" selection-end="5648" vertical-scroll-proportion="0.3500411">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ASTPropertyTest.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="176" column="65" selection-start="6138" selection-end="6138" vertical-scroll-proportion="0.23171733">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ConstantTest.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="71" column="6" selection-start="3475" selection-end="3475" vertical-scroll-proportion="0.39325842">
-          <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="652" column="0" selection-start="23701" selection-end="23701" vertical-scroll-proportion="0.23970038">
+        <state line="623" column="0" selection-start="22676" selection-end="22676" vertical-scroll-proportion="0.5007949">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/pom.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="23" column="0" selection-start="768" selection-end="768" vertical-scroll-proportion="0.28797996">
+        <state line="47" column="0" selection-start="1495" selection-end="1495" vertical-scroll-proportion="0.3510896">
           <folding />
         </state>
       </provider>
         <dependency>
             <groupId>jboss</groupId>
             <artifactId>javassist</artifactId>
-            <version>3.6.ga</version>
+            <version>3.7.ga</version>
         </dependency>
     </dependencies>
 

File src/java/ognl/ASTChain.java

     {
         Object result = source;
 
-        for(int i = 0, ilast = _children.length - 1; i <= ilast; ++i) {
-            
+        for(int i = 0, ilast = _children.length - 1; i <= ilast; ++i)
+        {
             boolean handled = false;
 
             if (i < ilast) {
                                             + "'"); }
                                 }
                             }
-                            if (!handled) {
-                                result = OgnlRuntime.getIndexedProperty(context, result, propertyNode.getProperty(
-                                        context, result).toString(), index);
+                            if (!handled) 
+                            {
+                                result = OgnlRuntime.getIndexedProperty(context, result,
+                                                                        propertyNode.getProperty(context, result).toString(),
+                                                                        index);
                                 handled = true;
                                 i++;
                             }
                     }
                 }
             }
-            if (!handled) {
+            if (!handled)
+            {
                 result = _children[i].getValue(context, result);
             }
         }
 
         for(int i = 0, ilast = _children.length - 2; i <= ilast; ++i)
         {
-            if (i == ilast) {
+            if (i <= ilast) {
                 if (_children[i] instanceof ASTProperty)
                 {
                     ASTProperty propertyNode = (ASTProperty) _children[i];
                                     }
                                 }
                             }
-                            if (!handled)
+                            if (!handled && i == ilast)
                             {
                                 OgnlRuntime.setIndexedProperty(context, target,
                                                                propertyNode.getProperty(context, target).toString(),
                                                                index, value);
                                 handled = true;
                                 i++;
+                            } else if (!handled) {
+                                target = OgnlRuntime.getIndexedProperty(context, target,
+                                                                        propertyNode.getProperty(context, target).toString(),
+                                                                        index);
+                                i++;
+                                continue;
                             }
                         }
                     }
             {
                 for(int i = 0; i < _children.length; i++)
                 {
-                   /* System.out.println("astchain child: " + _children[i].getClass().getName()
-                                       + " with current object target " + context.getCurrentObject()
-                                       + " current type: " + context.getCurrentType());*/
+              /*      System.out.println("astchain child: " + _children[i].getClass().getName()
+              + " with current object target " + context.getCurrentObject()
+              + " current type: " + context.getCurrentType());*/
 
                     String value = _children[i].toGetSourceString(context, context.getCurrentObject());
 
                         value = OgnlRuntime.getCompiler().castExpression(context, _children[i], value);
                     }
 
-                    /* System.out.println("astchain value now : " + value + " with index " + i
+                    /*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()); */
+                                       + " prev type " + context.getPreviousType() + " prev accessor " + context.getPreviousAccessor());*/
 
                     if (OrderedReturn.class.isInstance(_children[i]) && ((OrderedReturn)_children[i]).getLastExpression() != null)
                     {
             throw OgnlOps.castToRuntime(t);
         }
 
-        if (_lastType != null) {
+        if (_lastType != null)
+        {
             _getterClass = _lastType.getGetterClass();
             _setterClass = _lastType.getSetterClass();
         }
 
-        if (ordered) {
+        if (ordered)
+        {
             _coreExpression = result;
         }
 
                 {
                     throw new UnsupportedCompilationException("Can't modify constant values.");
                 }
-                
+
                 for(int i = 0; i < _children.length; i++)
                 {
-                    //System.out.println("astchain setsource child[" + i + "] : " + _children[i].getClass().getName());
+//                    System.out.println("astchain setsource child[" + i + "] : " + _children[i].getClass().getName());
 
                     if (i == (_children.length -1))
                     {
                     }
 
                     String value = _children[i].toSetSourceString(context, context.getCurrentObject());
-                    if (value == null || value.trim().length() <= 0)
-                        return "";
+                    //if (value == null || value.trim().length() <= 0)
+                      //  return "";
+
+//                    System.out.println("astchain setter child returned >>  " + value + "  <<");
 
                     if (ASTCtor.class.isInstance(_children[i]))
                         constructor = true;
 
                     if (NodeType.class.isInstance(_children[i])
-                        && ((NodeType)_children[i]).getGetterClass() != null) {
-
+                        && ((NodeType)_children[i]).getGetterClass() != null)
+                    {
                         _lastType = (NodeType)_children[i];
                     }
 
-                    if (!constructor && !OrderedReturn.class.isInstance(_children[i])
-                        && (_parent == null || !ASTSequence.class.isInstance(_parent))) {
-
+                    if (!ASTVarRef.class.isInstance(_children[i]) && !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 setter after cast value is: " + value);
+
+                    /*if (!constructor && !OrderedReturn.class.isInstance(_children[i])
+                        && (_parent == null || !ASTSequence.class.isInstance(_parent)))
+                    {
+                        value = OgnlRuntime.getCompiler().castExpression(context, _children[i], value);
+                    }*/
+
                     if (ASTOr.class.isInstance(_children[i])
                         || ASTAnd.class.isInstance(_children[i])
                         || ASTCtor.class.isInstance(_children[i])

File src/java/ognl/ASTMethod.java

 
     public String toSetSourceString(OgnlContext context, Object target)
     {
-        //System.out.println("current type: " + context.getCurrentType() + " target:" + target + " " + context.getCurrentObject());
+        /*System.out.println("current type: " + context.getCurrentType() + " target:" + target + " " + context.getCurrentObject()
+                           + " last child? " + lastChild(context));*/
         Method m = OgnlRuntime.getWriteMethod(context.getCurrentType() != null ?
                 context.getCurrentType() : target.getClass(),
                                               _methodName, _children != null ? _children.length : -1);
         if (m == null)
         {
-            return "";
+            throw new UnsupportedCompilationException("Unable to determine setter method generation for " + _methodName);
         }
 
         String post = "";
         }
 
         try {
+            /* if (lastChild(context) && m.getParameterTypes().length > 0 && _children.length <= 0)
+                throw new UnsupportedCompilationException("Unable to determine setter method generation for " + m); */
 
             if ((_children != null) && (_children.length > 0))
             {

File src/java/ognl/ASTProperty.java

 
         try {
             /* System.out.println("astproperty is indexed? : " + isIndexedAccess() + " child: " + _children[0].getClass().getName()
-                               + " target: " + target.getClass().getName() + " current object: " + context.getCurrentObject().getClass().getName()); */
++ " target: " + target.getClass().getName() + " current object: " + context.getCurrentObject().getClass().getName());*/
 
             if (isIndexedAccess())
             {
                 String srcString = _children[0].toGetSourceString(context, context.getRoot());
                 srcString = ExpressionCompiler.getRootExpression(_children[0], context.getRoot(), context) + srcString;
 
-                //if (!ASTConst.class.isInstance(_children[0]) && !ASTProperty.class.isInstance(_children[0]))
                 if (ASTChain.class.isInstance(_children[0]))
                 {
                     String cast = (String)context.remove(ExpressionCompiler.PRE_CAST);
                 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());
+                // 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();
 
+                    Object indexedValue = OgnlRuntime.callMethod(context, target, m.getName(), new Object[]{value});
+
                     context.setCurrentType(_getterClass);
-                    context.setCurrentObject(target);
+                    context.setCurrentObject(indexedValue);
                     context.setCurrentAccessor(OgnlRuntime.getCompiler().getSuperOrInterfaceClass(m, m.getDeclaringClass()));
 
                     return "." + m.getName() + "(" + srcString + ")";
                     result = m.getName() + "()";
                     _getterClass = m.getReturnType();
                 } else
+                {
                     context.put("_indexedMethod", m);
+                }
             } else
             {
-/*
-                 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()); */
+
+                /*    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());
 
         return result;
     }
 
-    boolean lastChild(OgnlContext context)
+    Method getIndexedWriteMethod(PropertyDescriptor pd)
     {
-        return _parent == null || context.get("_lastChild") !=  null;
+        if (IndexedPropertyDescriptor.class.isInstance(pd))
+        {
+            return ((IndexedPropertyDescriptor)pd).getIndexedWriteMethod();
+        } else if (ObjectIndexedPropertyDescriptor.class.isInstance(pd))
+        {
+            return ((ObjectIndexedPropertyDescriptor)pd).getIndexedWriteMethod();
+        }
+
+        return null;
     }
 
     public String toSetSourceString(OgnlContext context, Object target)
         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() + " children length: " + _children.length);*/
 
         try {
 
             if (isIndexedAccess())
             {
-                //System.out.println("ast set source property is indexed");
-
                 Object value = _children[0].getValue(context, context.getRoot());
 
                 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.getRoot());
-
                 srcString = ExpressionCompiler.getRootExpression(_children[0], context.getRoot(), context) + srcString;
 
-                if (!ASTConst.class.isInstance(_children[0]))
+                if (ASTChain.class.isInstance(_children[0]))
                 {
                     String cast = (String)context.remove(ExpressionCompiler.PRE_CAST);
                     if (cast != null)
                     srcString = "\"" + srcString + "\"";
                 }
 
-                //System.out.println("astproperty setter using indexed value " + value + " and srcString: " + srcString);
+//                System.out.println("astproperty setter using indexed value " + value + " and srcString: " + srcString);
 
                 if (context.get("_indexedMethod") != null)
                 {
                     m = (Method)context.remove("_indexedMethod");
+                    PropertyDescriptor pd = (PropertyDescriptor)context.remove("_indexedDescriptor");
+
+                    boolean lastChild = lastChild(context);
+                    if (lastChild)
+                    {
+                        m = getIndexedWriteMethod(pd);
+
+                        if (m == null)
+                            throw new UnsupportedCompilationException("Indexed property has no corresponding write method.");
+                    }
 
                     _setterClass = m.getParameterTypes()[0];
 
+                    Object indexedValue = null;
+                    if (!lastChild)
+                        indexedValue = OgnlRuntime.callMethod(context, target, m.getName(), new Object[]{value});
+
                     context.setCurrentType(_setterClass);
                     context.setCurrentAccessor(OgnlRuntime.getCompiler().getSuperOrInterfaceClass(m, m.getDeclaringClass()));
-                    context.setCurrentObject(target);
 
-                    return m.getName() + "(" + srcString + ")";
+                    if (!lastChild)
+                    {
+                        context.setCurrentObject(indexedValue);
+                        return "." + m.getName() + "(" + srcString + ")";
+                    } else {
+                        return "." + m.getName() + "(" + srcString + ", $3)";
+                    }
                 } else
                 {
                     PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass());
 
+                    Object currObj = context.getCurrentObject();
+                    Class currType = context.getCurrentType();
+                    Class prevType = context.getPreviousType();
+
+                    Object indexVal = p.getProperty(context, target, value);
+
+                    // reset current object for accessor
+
+                    context.setCurrentObject(currObj);
+                    context.setCurrentType(currType);
+                    context.setPreviousType(prevType);
+
+                    if (ASTConst.class.isInstance(_children[0]) && Number.class.isInstance(context.getCurrentObject()))
+                        context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(context.getCurrentObject().getClass()));
+
+                    result = lastChild(context) ? p.getSourceSetter(context, target, srcString) : p.getSourceAccessor(context, target, srcString);
+
+                    /*System.out.println("ASTProperty using propertyaccessor and isLastChild? " + lastChild(context)
+                                       + " generated source of: " + result + " using accessor class: " + p.getClass().getName());*/
+
+                    //result = p.getSourceAccessor(context, target, srcString);
+                    _getterClass = context.getCurrentType();
+                    context.setCurrentObject(indexVal);
+
+                    /* 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);
-                    context.setCurrentType(_getterClass);
+                    context.setCurrentType(_getterClass);*/
                     return result;
                 }
             }
 
             String name = ((ASTConst) _children[0]).getValue().toString();
 
-            //System.out.println(" astprop(setter) : trying to set " + name + " on object target " + context.getCurrentObject().getClass().getName());
+//            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)) {
             {
                 // if an indexed method accessor need to use special property descriptors to find methods
 
-                if (pd instanceof IndexedPropertyDescriptor) {
+                if (pd instanceof IndexedPropertyDescriptor)
+                {
                     IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor)pd;
-
                     m = lastChild(context) ? ipd.getIndexedWriteMethod() : ipd.getIndexedReadMethod();
-                } else {
-                    if (pd instanceof ObjectIndexedPropertyDescriptor) {
+                } else
+                {
+                    if (pd instanceof ObjectIndexedPropertyDescriptor)
+                    {
                         ObjectIndexedPropertyDescriptor opd = (ObjectIndexedPropertyDescriptor)pd;
 
                         m = lastChild(context) ? opd.getIndexedWriteMethod() : opd.getIndexedReadMethod();
-                    } else {
+                    } else
+                    {
                         throw new OgnlException("property '" + name + "' is not an indexed property");
                     }
                 }
 
-                if (_parent == null) {
+                if (_parent == null)
+                {
                     // the above pd will be the wrong result sometimes, such as methods like getValue(int) vs String[] getValue() 
 
                     m = OgnlRuntime.getWriteMethod(context.getCurrentObject().getClass(), name);
 
                     result = m.getName() + "((" + cast + ")$3)";
                     _setterClass = parm;
-                } else {
+                } else
+                {
                     context.put("_indexedMethod", m);
+                    context.put("_indexedDescriptor", pd);
                 }
 
             } else {
+                PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
 
-                // System.out.println("astproperty trying to set " + name + " on object target: " + context.getCurrentObject().getClass().getName());
-
-                PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
+                /*System.out.println("astproperty trying to set " + name + " on object target: " + context.getCurrentObject().getClass().getName()
+                                   + " using propertyaccessor type: " + pa);*/
 
                 if (target != null)
                     _setterClass = target.getClass();
                 {
                     m = pd.getReadMethod();
                     result = m.getName() + "()";
-                } else {
-
+                } else
+                {
                     if (context.getCurrentObject().getClass().isArray())
                     {
                         result = "";
 
                         String srcString = _children[0].toGetSourceString(context, context.getRoot());
 
-                        if (ASTConst.class.isInstance(_children[0]) && String.class.isInstance(context.getCurrentObject())) {
+                        if (ASTConst.class.isInstance(_children[0]) && String.class.isInstance(context.getCurrentObject()))
+                        {
                             srcString = "\"" + srcString + "\"";
                         }
 

File src/java/ognl/ListPropertyAccessor.java

     {
         String indexStr = index.toString().replaceAll("\"", "");
 
-        if (index instanceof String) {
-
-            if (indexStr.equals("size")) {
+        if (String.class.isInstance(index)) 
+        {
+            if (indexStr.equals("size"))
+            {
                 context.setCurrentAccessor(List.class);
                 context.setCurrentType(int.class);
                 return ".size()";
-            } else {
-                if (indexStr.equals("iterator")) {
+            } else
+            {
+                if (indexStr.equals("iterator"))
+                {
                     context.setCurrentAccessor(List.class);
                     context.setCurrentType(Iterator.class);
                     return ".iterator()";
-                } else {
-                    if (indexStr.equals("isEmpty") || indexStr.equals("empty")) {
+                } else
+                {
+                    if (indexStr.equals("isEmpty") || indexStr.equals("empty"))
+                    {
                         context.setCurrentAccessor(List.class);
                         context.setCurrentType(boolean.class);
                         return ".isEmpty()";
         // TODO: This feels really inefficient, must be some better way
         // check if the index string represents a method on a custom class implementing java.util.List instead..
 
-        if (context.getCurrentObject() != null && !Number.class.isInstance(context.getCurrentObject())) {
-
+        if (context.getCurrentObject() != null && !Number.class.isInstance(context.getCurrentObject()))
+        {
             try {
                 Method m = OgnlRuntime.getReadMethod(target.getClass(), indexStr);
 
         // need to convert to primitive for list index access
         // System.out.println("Curent type: " + context.getCurrentType() + " current object type " + context.getCurrentObject().getClass());
 
-        if (!context.getCurrentType().isPrimitive() && Number.class.isAssignableFrom(context.getCurrentType())) {
-
+        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()) {
-
+                    && !context.getCurrentType().isPrimitive())
+        {
             // means it needs to be cast first as well
 
             String toString = String.class.isInstance(index) && context.getCurrentType() != Object.class ? "" : ".toString()";
 
     public String getSourceSetter(OgnlContext context, Object target, Object index)
     {
-
         String indexStr = index.toString().replaceAll("\"", "");
 
         // TODO: This feels really inefficient, must be some better way
         // check if the index string represents a method on a custom class implementing java.util.List instead..
-        if (context.getCurrentObject() != null && !Number.class.isInstance(context.getCurrentObject())) {
-
+       /* System.out.println("Listpropertyaccessor setter using index: " + index + " and current object: " + context.getCurrentObject()
+        + " number is current object? " + Number.class.isInstance(context.getCurrentObject()));*/
+        
+        if (context.getCurrentObject() != null && !Number.class.isInstance(context.getCurrentObject()))
+        {
             try {
                 Method m = OgnlRuntime.getWriteMethod(target.getClass(), indexStr);
-
-                if (m != null)
+                
+                if (m != null || !context.getCurrentType().isPrimitive())
+                {
+                    System.out.println("super source setter returned: " + super.getSourceSetter(context, target, index));
                     return super.getSourceSetter(context, target, index);
+                }
 
             } catch (Throwable t)
             {
             }
         }
 
-        if (index instanceof String) {
+        /* if (String.class.isInstance(index))
+        {
             context.setCurrentAccessor(List.class);
             return "";
-        }
+        }*/
 
         context.setCurrentAccessor(List.class);
 
         // need to convert to primitive for list index access
 
-        if (!context.getCurrentType().isPrimitive() && Number.class.isAssignableFrom(context.getCurrentType())) {
-
+        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()) {
-
+                    && !context.getCurrentType().isPrimitive())
+        {
             // means it needs to be cast first as well
 
             String toString = String.class.isInstance(index) && context.getCurrentType() != Object.class ? "" : ".toString()";

File src/java/ognl/MapPropertyAccessor.java

         context.setCurrentAccessor(Map.class);
         context.setCurrentType(Object.class);
         
-        if (String.class.isAssignableFrom(index.getClass()) && !indexedAccess) {
+        if (String.class.isInstance(index) && !indexedAccess)
+        {
             String key = indexStr.replaceAll("\"", "");
 
             if (key.equals("size")) {
 
         String indexStr = index.toString();
 
-        if (String.class.isAssignableFrom(index.getClass())) {
+        if (String.class.isInstance(index))
+        {
             String key = indexStr.replaceAll("\"", "");
-
+            
             if (key.equals("size"))
                 return "";
             else if (key.equals("keys") || key.equals("keySet"))

File src/java/ognl/ObjectPropertyAccessor.java

         } catch (Exception ex) {
             throw new OgnlException(name, ex);
         }
-        
+
         return result;
     }
 
 
                 return "";
             }
-            
+
             context.setCurrentType(m.getReturnType());
             context.setCurrentAccessor(OgnlRuntime.getCompiler().getSuperOrInterfaceClass(m, m.getDeclaringClass()));
 
                 m = OgnlRuntime.getWriteMethod(target.getClass(), context.getCurrentObject().toString().replaceAll("\"", ""));
             }
 
-            if (m == null)
-                return "";
-
-            if (m.getParameterTypes() == null || m.getParameterTypes().length <= 0)
-                return "";
+            if (m == null || m.getParameterTypes() == null || m.getParameterTypes().length <= 0)
+                throw new UnsupportedCompilationException("Unable to determine setting expression on " + context.getCurrentObject()
+                                                          + " with index of " + index);
 
             Class parm = m.getParameterTypes()[0];
-            String conversion = null;
+            String conversion;
 
             if (m.getParameterTypes().length > 1)
                 throw new UnsupportedCompilationException("Object property accessors can only support single parameter setters.");

File src/java/ognl/SimpleNode.java

         return isSimpleProperty(context);
     }
 
+    protected boolean lastChild(OgnlContext context)
+    {
+        return _parent == null || context.get("_lastChild") !=  null;
+    }
+
     /**
      * This method may be called from subclasses' jjtClose methods. It flattens the tree under this node by eliminating any children that are of the same class as this
      * node and copying their children to this node.

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

 
         body = body.replaceAll("\\.\\.", ".");
 
-        //System.out.println("Getter Body: ===================================\n" + body);
+//        System.out.println("Getter Body: ===================================\n" + body);
         valueGetter.setBody(body);
         newClass.addMethod(valueGetter);
 

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

+package org.ognl.test;
+
+import junit.framework.TestCase;
+import ognl.Ognl;
+import ognl.OgnlContext;
+import org.ognl.test.objects.IndexedSetObject;
+
+/**
+ * Tests for {@link ognl.ASTChain}.
+ */
+public class ASTChainTest extends TestCase {
+
+    public void test_Get_Indexed_Value() throws Exception {
+
+        OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
+        IndexedSetObject root = new IndexedSetObject();
+
+        String expr = "thing[\"x\"].val";
+
+        assertEquals(1, Ognl.getValue(expr, context, root));
+
+        Ognl.setValue(expr, context, root, new Integer(2));
+        
+        assertEquals(2, Ognl.getValue(expr, context, root));
+    }
+}

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

 import junit.framework.TestSuite;
 import ognl.MethodFailedException;
 import ognl.NoSuchPropertyException;
+import org.ognl.test.objects.IndexedSetObject;
 import org.ognl.test.objects.Root;
 
 public class IndexAccessTest extends OgnlTestCase {
 
     private static Root ROOT = new Root();
+    private static IndexedSetObject INDEXED_SET = new IndexedSetObject();
 
     private static Object[][] TESTS = {
             {ROOT, "list[index]", ROOT.getList().get(ROOT.getIndex())},
             {ROOT, "tab.searchCriteria[index1].displayName", "Woodland creatures"},
             {ROOT, "tab.searchCriteriaSelections[index1][index2]", Boolean.TRUE},
             {ROOT, "tab.searchCriteriaSelections[index1][index2]", Boolean.TRUE, Boolean.FALSE, Boolean.FALSE},
-            {ROOT, "map['bar'].value", 100, 50, 50}
+            {ROOT, "map['bar'].value", 100, 50, 50},
+            {INDEXED_SET, "thing[\"x\"].val", 1, 2, 2}
     };
 
     /*

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

 
 public class StaticsAndConstructorsTest extends OgnlTestCase
 {
+    private static Root ROOT = new Root();
+
+    private static Object[][]       TESTS = {
+            { "@java.lang.Class@forName(\"java.lang.Object\")", Object.class },
+            { "@java.lang.Integer@MAX_VALUE", new Integer(Integer.MAX_VALUE) },
+            { "@@max(3,4)", new Integer(4) },
+            { "new java.lang.StringBuffer().append(55).toString()", "55" },
+            { "class", ROOT.getClass() },
+            { "@org.ognl.test.objects.Root@class", ROOT.getClass() },
+            { "class.getName()", ROOT.getClass().getName() },
+            { "@org.ognl.test.objects.Root@class.getName()", ROOT.getClass().getName() },
+            { "@org.ognl.test.objects.Root@class.name", ROOT.getClass().getName() },
+            { "class.getSuperclass()", ROOT.getClass().getSuperclass() },
+            { "class.superclass", ROOT.getClass().getSuperclass() },
+            { "class.name", ROOT.getClass().getName() },
+            { "getStaticInt()", new Integer(Root.getStaticInt()) },
+            { "@org.ognl.test.objects.Root@getStaticInt()", new Integer(Root.getStaticInt()) },
+            { "new org.ognl.test.objects.Simple(property).getStringValue()", new Simple().getStringValue() },
+            { "new org.ognl.test.objects.Simple(map['test'].property).getStringValue()", new Simple().getStringValue() },
+            { "map.test.getCurrentClass(@org.ognl.test.StaticsAndConstructorsTest@KEY.toString())", "size stop"},
+            { "new org.ognl.test.StaticsAndConstructorsTest$IntWrapper(index)", new IntWrapper(ROOT.getIndex()) },
+            { "new org.ognl.test.StaticsAndConstructorsTest$IntObjectWrapper(index)", new IntObjectWrapper(ROOT.getIndex()) },
+            { "new org.ognl.test.StaticsAndConstructorsTest$A(#root)", new A(ROOT)},
+            {"@org.ognl.test.StaticsAndConstructorsTest$Animals@values().length != 2", Boolean.TRUE},
+            {"isOk(@org.ognl.test.objects.SimpleEnum@ONE, null)", Boolean.TRUE},
+    };
+
     public static final String KEY = "size";
 
-    private static Root ROOT = new Root();
-
     public static class IntWrapper {
         public IntWrapper(int value)
         {
         Dog, Cat, Wallabee, Bear
     }
 
-    private static Object[][]       TESTS = {
-            { "@java.lang.Class@forName(\"java.lang.Object\")", Object.class },
-            { "@java.lang.Integer@MAX_VALUE", new Integer(Integer.MAX_VALUE) },
-            { "@@max(3,4)", new Integer(4) },
-            { "new java.lang.StringBuffer().append(55).toString()", "55" },
-            { "class", ROOT.getClass() },
-            { "@org.ognl.test.objects.Root@class", ROOT.getClass() },
-            { "class.getName()", ROOT.getClass().getName() },
-            { "@org.ognl.test.objects.Root@class.getName()", ROOT.getClass().getName() },
-            { "@org.ognl.test.objects.Root@class.name", ROOT.getClass().getName() },
-            { "class.getSuperclass()", ROOT.getClass().getSuperclass() },
-            { "class.superclass", ROOT.getClass().getSuperclass() },
-            { "class.name", ROOT.getClass().getName() },
-            { "getStaticInt()", new Integer(Root.getStaticInt()) },
-            { "@org.ognl.test.objects.Root@getStaticInt()", new Integer(Root.getStaticInt()) },
-            { "new org.ognl.test.objects.Simple(property).getStringValue()", new Simple().getStringValue() },
-            { "new org.ognl.test.objects.Simple(map['test'].property).getStringValue()", new Simple().getStringValue() },
-            { "map.test.getCurrentClass(@org.ognl.test.StaticsAndConstructorsTest@KEY.toString())", "size stop"},
-            { "new org.ognl.test.StaticsAndConstructorsTest$IntWrapper(index)", new IntWrapper(ROOT.getIndex()) },
-            { "new org.ognl.test.StaticsAndConstructorsTest$IntObjectWrapper(index)", new IntObjectWrapper(ROOT.getIndex()) },
-            { "new org.ognl.test.StaticsAndConstructorsTest$A(#root)", new A(ROOT)},
-            {"@org.ognl.test.StaticsAndConstructorsTest$Animals@values().length != 2", Boolean.TRUE},
-            {"isOk(@org.ognl.test.objects.SimpleEnum@ONE, null)", Boolean.TRUE},
-    };
-
     /*===================================================================
          Public static methods
        ===================================================================*/

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

+package org.ognl.test.objects;
+
+import java.util.HashMap;
+
+/**
+ * Test for OGNL-119.
+ */
+public class IndexedSetObject {
+
+    private final HashMap<String,Object> things = new HashMap<String,Object>();
+
+    public IndexedSetObject() {
+        things.put("x", new Container(1));
+    }
+
+    public Object getThing(String index) {
+        return things.get(index);
+    }
+
+    public void setThing(String index, Object value) {
+        things.put(index, value);
+    }
+
+    public static class Container {
+        private int val;
+        public Container(int val) { this.val = val; }
+        public int getVal() { return val; }
+        public void setVal(int val) { this.val = val; }
+    }
+}