Commits

jkuh...@d4b077e3-5828-0410-b394-cb2b42183085  committed a67d490

Resolves OGNL-43. ASTAnd was incorrectly casting to a boolean expression when language grammar states && expressions return value of second expression - not just boolean.

  • Participants
  • Parent commits caedd54

Comments (0)

Files changed (11)

   </component>
   <component name="libraryTable" />
   <component name="uidesigner-configuration" />
+  <UsedPathMacros>
+    <macro name="USERPROFILE" />
+  </UsedPathMacros>
 </project>
 
   </component>
   <component name="ChangeListManager">
     <list default="true" name="Default" comment="">
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/NullStringCatenationTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/NullStringCatenationTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/ContextVariableTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/ContextVariableTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTIn.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTIn.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTNotIn.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTNotIn.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTAdd.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTAdd.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/ArithmeticAndLogicalOperatorsTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/ArithmeticAndLogicalOperatorsTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTNot.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTNot.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/test/java/org/ognl/test/objects/Root.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTAnd.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTAnd.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OGNL.ipr" afterPath="$PROJECT_DIR$/OGNL.ipr" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/enhance/TestExpressionCompiler.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/enhance/TestExpressionCompiler.java" />
     </list>
   </component>
   <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
     <breakpoint_rules />
     <ui_properties />
   </component>
+  <component name="ErrorOptionsConfigurable.UI">
+    <option name="proportions">
+      <SplitterProportionsDataImpl />
+    </option>
+  </component>
   <component name="ErrorTreeViewConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
     <option name="HIDE_WARNINGS" value="false" />
   </component>
   <component name="FileEditorManager">
     <leaf>
-      <file leaf-file-name="NullStringCatenationTest.java" pinned="false" current="true" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/NullStringCatenationTest.java">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="48" column="0" selection-start="2487" selection-end="2487" vertical-scroll-proportion="0.2263202">
-              <folding />
-            </state>
-          </provider>
-        </entry>
-      </file>
-      <file leaf-file-name="ASTAdd.java" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTAdd.java">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="171" column="22" selection-start="6660" selection-end="6660" vertical-scroll-proportion="0.2514669">
-              <folding />
-            </state>
-          </provider>
-        </entry>
-      </file>
-      <file leaf-file-name="ExpressionCompiler.java" pinned="false" current="false" current-in-tab="false">
+      <file leaf-file-name="ExpressionCompiler.java" pinned="false" current="true" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/src/java/ognl/enhance/ExpressionCompiler.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="461" column="8" selection-start="16334" selection-end="16334" vertical-scroll-proportion="0.4308466">
+            <state line="463" column="10" selection-start="16509" selection-end="16509" vertical-scroll-proportion="0.46521375">
               <folding />
             </state>
           </provider>
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
       </PATH>
+      <PATH>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="OGNL" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+        </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="OGNL" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+        </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+        </PATH_ELEMENT>
+      </PATH>
     </subPane>
   </component>
   <component name="ProjectReloadState">
     <option name="STATE" value="0" />
   </component>
+  <component name="ProjectRootConfigurable.UI">
+    <option name="proportions">
+      <SplitterProportionsDataImpl />
+    </option>
+  </component>
   <component name="ProjectView">
     <navigator currentView="ProjectPane" proportions="0.16666667" version="1" splitterProportion="0.5">
       <flattenPackages />
       <showLibraryContents />
       <hideEmptyPackages />
       <abbreviatePackageNames />
-      <showStructure Favorites="false" Scope="false" PackagesPane="false" ProjectPane="false" />
+      <showStructure ProjectPane="false" Scope="false" PackagesPane="false" Favorites="false" />
       <autoscrollToSource />
       <autoscrollFromSource />
       <sortByType />
       <recent name="ognl.enhance.ExpressionCompiler" />
     </key>
   </component>
+  <component name="Regex">
+    <option name="pos1" value="218" />
+    <option name="pos2" value="218" />
+    <option name="pos3" value="162" />
+    <option name="pos4" value="444" />
+    <option name="pos5" value="162" />
+    <option name="autoUpdate" value="true" />
+    <option name="referenceOn" value="false" />
+    <option name="referencePos" value="0" />
+    <option name="showLabels" value="true" />
+  </component>
   <component name="RestoreUpdateTree" />
-  <component name="RunManager" selected="JUnit.NullStringCatenationTest">
-    <tempConfiguration default="false" name="NullStringCatenationTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+  <component name="RunManager" selected="JUnit.PropertyTest">
+    <tempConfiguration default="false" name="PropertyTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
       <pattern value="org.ognl.test.*" />
       <module name="OGNL" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
       <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.NullStringCatenationTest" />
+      <option name="MAIN_CLASS_NAME" value="org.ognl.test.PropertyTest" />
       <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" />
-      <module name="" />
+    <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="Applet" factoryName="Applet">
       <module name="" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
       <option name="ALTERNATIVE_JRE_PATH" />
     </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 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="JUnit" factoryName="JUnit" enabled="false" merge="false">
       <module name="" />
       <Port>5050</Port>
     </configuration>
   </component>
+  <component name="ScopeChooserConfigurable.UI">
+    <option name="proportions">
+      <SplitterProportionsDataImpl />
+    </option>
+  </component>
   <component name="ScopeViewComponent">
     <subPane subId="Project">
       <PATH>
     <option name="UPDATE_RUN_STATUS" value="true" />
     <option name="UPDATE_RECURSIVELY" value="true" />
     <option name="MERGE_DRY_RUN" value="false" />
-    <configuration useDefault="true">/home/jkuhnert/.subversion</configuration>
+    <configuration useDefault="true">$USERPROFILE$/.subversion</configuration>
     <upgradeMode>none</upgradeMode>
   </component>
   <component name="TodoView" selected-index="0">
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="108" y="159" width="2164" height="1373" extended-state="0" />
+    <frame x="117" y="144" width="2164" height="1373" 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="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24009901" 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.25" order="1" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24975657" order="1" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="0" />
       <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.2317189" 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="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20750238" 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="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.25816995" 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="Regex" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="Maven" 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="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="5" />
     <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="Resolves OGNL-40. ASTAdd was improperly double escaping quoting characters." />
+    <option name="LAST_COMMIT_MESSAGE" value="Resolves OGNL-43. ASTAnd was incorrectly casting to a boolean expression when language grammar states &amp;&amp; expressions return value of second expression - not just boolean." />
     <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" />
     <MESSAGE value="Resolves OGNL-41. Needed to add &quot;(&quot; around !org.ognl.StaticClass.method()&quot; block to make javassist stfu." />
     <MESSAGE value="Resolves OGNL-39. ASTTest wasn't handling the possibility of different object types being on the return stack of a ternary statement." />
     <MESSAGE value="Resolves OGNL-40. ASTAdd was improperly double escaping quoting characters." />
+    <MESSAGE value="Resolves OGNL-43. ASTAnd was incorrectly casting to a boolean expression when language grammar states &amp;&amp; expressions return value of second expression - not just boolean." />
   </component>
   <component name="XPathView.XPathProjectComponent">
     <history />
     <option name="myLastEditedConfigurable" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/BooleanExpression.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="13" column="53" selection-start="206" selection-end="206" vertical-scroll-proportion="0.0862069">
+        <state line="61" column="23" selection-start="3185" selection-end="3185" vertical-scroll-proportion="-0.30176026">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pom.xml">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/enhance/TestExpressionCompiler.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="137" column="4" selection-start="4753" selection-end="4753" vertical-scroll-proportion="1.0795321">
+        <state line="132" column="0" selection-start="3840" selection-end="3840" vertical-scroll-proportion="0.92455995">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="jar://$PROJECT_DIR$/lib/build/javassist.jar!/javassist/compiler/Parser.class">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/OgnlTestCase.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="124" column="0" selection-start="9554" selection-end="9554" vertical-scroll-proportion="0.8947368">
+        <state line="184" column="44" selection-start="6996" selection-end="6996" vertical-scroll-proportion="0.38390613">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ComparisonExpression.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTTest.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="51" column="12" selection-start="1640" selection-end="1640" vertical-scroll-proportion="0.597653">
+        <state line="97" column="0" selection-start="4201" selection-end="4201" vertical-scroll-proportion="0.80229884">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTNotEq.java">
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTIn.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="61" column="16" selection-start="2490" selection-end="2490" vertical-scroll-proportion="0.40234703">
+        <state line="81" column="0" selection-start="3047" selection-end="3047" vertical-scroll-proportion="0.63793105">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTNotIn.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="78" column="0" selection-start="3009" selection-end="3009" vertical-scroll-proportion="0.5862069">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ArithmeticAndLogicalOperatorsTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="50" column="0" selection-start="2340" selection-end="2340" vertical-scroll-proportion="0.3275862">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/QuotingTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="55" column="20" selection-start="2656" selection-end="2656" vertical-scroll-proportion="0.32690695">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/ContextVariableTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="78" column="94" selection-start="3378" selection-end="3378" vertical-scroll-proportion="0.6035205">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTAnd.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="161" column="27" selection-start="6101" selection-end="6101" vertical-scroll-proportion="0.7586207">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="358" column="24" selection-start="15065" selection-end="15065" vertical-scroll-proportion="0.33333334">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTNot.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="78" column="13" selection-start="3183" selection-end="3183" vertical-scroll-proportion="0.6160939">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTNotIn.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="77" column="26" selection-start="3006" selection-end="3006" vertical-scroll-proportion="0.6035205">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTXor.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="63" column="0" selection-start="2507" selection-end="2507" vertical-scroll-proportion="0.42749372">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTAnd.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="129" column="0" selection-start="4965" selection-end="4965" vertical-scroll-proportion="0.30176026">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTTest.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="92" column="12" selection-start="3926" selection-end="3926" vertical-scroll-proportion="0.5347862">
+        <state line="68" column="0" selection-start="2773" selection-end="2773" vertical-scroll-proportion="0.51724136">
           <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="51" column="12" selection-start="2369" selection-end="2369" vertical-scroll-proportion="-0.12573345">
+        <state line="92" column="71" selection-start="5558" selection-end="5558" vertical-scroll-proportion="0.50461024">
           <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/ASTAdd.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="360" column="23" selection-start="9236" selection-end="9236" vertical-scroll-proportion="0.9497066">
+        <state line="210" column="21" selection-start="9060" selection-end="9060" vertical-scroll-proportion="1.6663872">
           <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="461" column="8" selection-start="16334" selection-end="16334" vertical-scroll-proportion="0.4308466">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTAdd.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="171" column="22" selection-start="6660" selection-end="6660" vertical-scroll-proportion="0.2514669">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/NullStringCatenationTest.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="48" column="0" selection-start="2487" selection-end="2487" vertical-scroll-proportion="0.2263202">
+        <state line="463" column="10" selection-start="16509" selection-end="16509" vertical-scroll-proportion="0.46521375">
           <folding />
         </state>
       </provider>

File src/java/ognl/ASTAdd.java

                                 result += ".";
                             
                             result += OgnlRuntime.getNumericValueGetter(ctype.getGetterClass());
+                            context.setCurrentType(OgnlRuntime.getPrimitiveWrapperClass(ctype.getGetterClass()));
                         }
                     }
+                    
+                    if (lastType != null) {
+                        context.setCurrentAccessor(lastType.getGetterClass());
+                    }
 
                     if (!OrderedReturn.class.isInstance(_parent)) {
                         result += ")";
                 }
             }
             
-            if (lastType != null) {
-                
-                _getterClass = lastType.getGetterClass();
-                context.setCurrentType(_getterClass);
-                context.setCurrentAccessor(null);
-            }
-            
             if (_parent == null || ASTSequence.class.isAssignableFrom(_parent.getClass())) {
-                
-                //if (_getterClass != null && Number.class.isAssignableFrom(_getterClass))
-                  //  result = OgnlRuntime.getNumericCast(_getterClass) + "(" + result + ")";
+
                 if (_getterClass != null && String.class.isAssignableFrom(_getterClass))
                     _getterClass = Object.class;
             }

File src/java/ognl/ASTAnd.java

 
     boolean allConditionsTrue(OgnlContext context, Object target) throws OgnlException
     {
-        Object result = null;
+        Object result;
         int last = _children.length - 1;
         for ( int i=0; i <= last; ++i ) {
             result = _children[i].getValue( context, target );
         if (_children.length != 2)
             throw new UnsupportedCompilationException("Can only compile boolean expressions with two children.");
         
-        String result = "(";
+        String result = "";
         
         try {
 
                 throw new UnsupportedCompilationException("And expression can't be compiled until all conditions are true.");
 
             String first = OgnlRuntime.getChildSource(context, target, _children[0]);
-            if (!OgnlRuntime.isBoolean(first))
+            if (!OgnlRuntime.isBoolean(first) && !context.getCurrentType().isPrimitive())
                 first = OgnlRuntime.getCompiler().createLocalReference(context, first, context.getCurrentType());
 
             Class firstType = context.getCurrentType();
 
             String second = OgnlRuntime.getChildSource(context, target, _children[1]);
-            if (!OgnlRuntime.isBoolean(second))
+            if (!OgnlRuntime.isBoolean(second) && !context.getCurrentType().isPrimitive())
                 second = OgnlRuntime.getCompiler().createLocalReference(context, second, context.getCurrentType());
 
             Class secondType = context.getCurrentType();
 
             boolean mismatched = (firstType.isPrimitive() && !secondType.isPrimitive())
-                                            || (!firstType.isPrimitive() && secondType.isPrimitive()) ? true : false;            
+                                 || (!firstType.isPrimitive() && secondType.isPrimitive());
 
             result += "ognl.OgnlOps.booleanValue(" + first + ")";
             
             result += " ? ";
 
-            result += (mismatched ? " ($w) " : "") + second;
+            result += (mismatched ? " ($w) " : " ($w) ") + second;
             result += " : ";
 
-            result += (mismatched ? " ($w) " : "") + first;
+            result += (mismatched ? " ($w) " : " ($w) ") + first;
 
-            result += ")";
+            result += "";
 
             context.setCurrentObject(target);
-            context.setCurrentType(Boolean.TYPE);
+            context.setCurrentType(Object.class);
         } catch (NullPointerException e) {
             
             throw new UnsupportedCompilationException("evaluation resulted in null expression.");
             
             context.setCurrentObject(target);
             
-            context.setCurrentType(Boolean.TYPE);
+            context.setCurrentType(Object.class);
             
         } catch (Throwable t) {
             if (UnsupportedCompilationException.class.isInstance(t))

File src/java/ognl/ASTIn.java

             result += OgnlRuntime.getChildSource(context, target, _children[0]) + ", ($w) " + OgnlRuntime.getChildSource(context, target, _children[1]);
             
             result += ")";
-            
+
+            context.setCurrentType(Boolean.TYPE);
+
             return result;
         } catch (NullPointerException e) {
             

File src/java/ognl/ASTNot.java

 
                 return "!" + srcString;
             }
-            
+
+            context.setCurrentType(Boolean.TYPE);
+
             return "(! ognl.OgnlOps.booleanValue(" + srcString + ") )";
             
         } catch (Throwable t) {

File src/java/ognl/ASTNotIn.java

             result += OgnlRuntime.getChildSource(context, target, _children[0]) + ", ($w) " + OgnlRuntime.getChildSource(context, target, _children[1]);
             
             result += ") )";
-            
+
+            context.setCurrentType(Boolean.TYPE);
+
             return result;
         } catch (NullPointerException e) {
             

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

     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;
         if (getterCode == null || getterCode.trim().length() <= 0 && !ASTVarRef.class.isAssignableFrom(expression.getClass()))
             getterCode = "null";
 
+        /*
         Class returnType = null;
 
+
         if (NodeType.class.isInstance(expression)) {
             NodeType nType = (NodeType) expression;
             returnType = nType.getGetterClass();
 
-            if (returnType != null && !String.class.isAssignableFrom(returnType)) {
+            if (returnType != null && !String.class.isAssignableFrom(returnType) && context.getCurrentType().isPrimitive()) {
 
                 pre = pre + " ($w) (";
                 post = post + ")";
             }
-        }
+        }*/
 
         String castExpression = (String) context.get(PRE_CAST);
 
-        if (returnType == null) {
+        if (context.getCurrentType() == null || context.getCurrentType().isPrimitive() || Character.class.isAssignableFrom(context.getCurrentType())) {
             pre = pre + " ($w) (";
             post = post + ")";
         }
             
             body = body.replaceAll("\\.\\.", ".");
             
-            //System.out.println("adding method " + ref.getName() + " with body:\n" + body + " and return type: " + ref.getType());
+            // System.out.println("adding method " + ref.getName() + " with body:\n" + body + " and return type: " + ref.getType());
             
             CtMethod method = new CtMethod(pool.get(ref.getType().getName()), ref.getName(), params, clazz);
             method.setBody(body);

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

             { "2 or 0", Integer.valueOf(2)},
             { "1 and 0", Integer.valueOf(0) },
             { "1 bor 0", new Integer(1) },
+            { "true && 12", Integer.valueOf(12)},
             { "1 xor 0", new Integer(1) }, { "1 band 0", new Integer(0) }, { "1 eq 1", Boolean.TRUE },
             { "1 neq 1", Boolean.FALSE }, { "1 lt 5", Boolean.TRUE }, { "1 lte 5", Boolean.TRUE },
             { "1 gt 5", Boolean.FALSE }, { "1 gte 5", Boolean.FALSE }, { "1 lt 5", Boolean.TRUE },

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

             {"#root", ROOT}, // Special root reference
             {"#this", ROOT}, // Special this reference
             {"#f=5, #s=6, #f + #s", new Integer(11)},
-            {"#six=(#five=5, 6), #five + #six", new Integer(11)},
+            { "#six=(#five=5, 6), #five + #six", new Integer(11)},
     };
 
     /*

File src/test/java/org/ognl/test/enhance/TestExpressionCompiler.java

 import ognl.enhance.ExpressionCompiler;
 import ognl.enhance.OgnlExpressionCompiler;
 import org.ognl.test.objects.Bean1;
+import org.ognl.test.objects.Root;
+
+import java.util.Collection;
 
 
 /**
         expr.getAccessor().set(_context, root, "bam");
         assertEquals("bam", expr.getAccessor().get(_context, root));
     }
+
+    public void test_Property_Index()
+    throws Throwable
+    {
+        Root root = new Root();
+        Node expr = (Node) Ognl.compileExpression(_context, root, "{index + 1}");
+
+        Object ret = expr.getAccessor().get(_context, root);
+
+        assertTrue(Collection.class.isInstance(ret));
+    }
 }