Commits

Anonymous committed abc0bf1

Fixes OGNL-128. Addex explicit check for String types on the context stack in numeric expressions.

Comments (0)

Files changed (8)

 <?xml version="1.0" encoding="UTF-8"?>
 <module relativePaths="true" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="false">
-    <output url="file://$MODULE_DIR$/build/classes" />
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/target/classes" />
     <exclude-output />
     <exclude-exploded />
-    <output-test url="file://$MODULE_DIR$/build/test-classes" />
+    <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/test/java" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/dist" />
       <excludeFolder url="file://$MODULE_DIR$/extlib" />
       <excludeFolder url="file://$MODULE_DIR$/target" />
+      <excludeFolder url="file://$MODULE_DIR$/target/classes" />
+      <excludeFolder url="file://$MODULE_DIR$/target/surefire-reports" />
+      <excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
     </content>
-    <orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
+    <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module-library">
-      <library>
+    <orderEntry type="module-library" exported="">
+      <library name="jboss:javassist:3.4.ga">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/javacc.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../.m2/repository/jboss/javassist/3.4.ga/javassist-3.4.ga.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library">
-      <library>
+    <orderEntry type="module-library" exported="">
+      <library name="junit:junit:3.8.1">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/ant-contrib-0.3.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../.m2/repository/junit/junit/3.8.1/junit-3.8.1-sources.jar!/" />
+        </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library">
-      <library>
+    <orderEntry type="module-library" exported="">
+      <library name="org.easymock:easymock:2.2">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/javassist.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../.m2/repository/org/easymock/easymock/2.2/easymock-2.2.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/junit.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/easymock-2.0.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/testng-5.1-jdk15.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library name="mvel">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/mvel.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library name="asm">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/build/asm.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../.m2/repository/org/easymock/easymock/2.2/easymock-2.2-sources.jar!/" />
+        </SOURCES>
       </library>
     </orderEntry>
     <orderEntryProperties />
   </component>
   <component name="JavacSettings">
     <option name="DEBUGGING_INFO" value="true" />
-    <option name="GENERATE_NO_WARNINGS" value="false" />
-    <option name="DEPRECATION" value="true" />
+    <option name="GENERATE_NO_WARNINGS" value="true" />
+    <option name="DEPRECATION" value="false" />
     <option name="ADDITIONAL_OPTIONS_STRING" value="" />
     <option name="MAXIMUM_HEAP_SIZE" value="128" />
   </component>
   </component>
   <component name="ChangeListManager">
     <list default="true" name="Default" comment="">
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java" afterPath="$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/SelfReferenceReflectionTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/SelfReferenceReflectionTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OGNL.iml" afterPath="$PROJECT_DIR$/OGNL.iml" />
       <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/SimpleNumeric.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/SimpleNumeric.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OGNL.ipr" afterPath="$PROJECT_DIR$/OGNL.ipr" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/NumericExpression.java" afterPath="$PROJECT_DIR$/src/java/ognl/NumericExpression.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/PropertyArithmeticAndLogicalOperatorsTest.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/PropertyArithmeticAndLogicalOperatorsTest.java" />
+      <change type="DELETED" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/SelfReferenceReflectionTest.java" afterPath="" />
     </list>
   </component>
   <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
   <component name="CommittedChangesCache">
     <option name="refreshEnabled" value="false" />
   </component>
+  <component name="CompilerWorkspaceConfiguration">
+    <option name="COMPILE_IN_BACKGROUND" value="true" />
+    <option name="COMPILE_DEPENDENT_FILES" value="true" />
+    <option name="CLEAR_OUTPUT_DIRECTORY" value="true" />
+  </component>
   <component name="CreatePatchCommitExecutor">
     <option name="PATCH_PATH" value="" />
     <option name="REVERSE_PATCH" value="false" />
     </option>
     <option name="lastEditedConfigurable" value="1.4" />
   </component>
+  <component name="MavenBuilder">
+    <option name="jreName" value="1.5" />
+    <option name="skipTests" value="true" />
+  </component>
+  <component name="MavenProjectsState">
+    <option name="ignoredPathMasks">
+      <list>
+        <option value="target" />
+        <option value="test-output" />
+      </list>
+    </option>
+  </component>
   <component name="ModuleEditorState">
     <option name="LAST_EDITED_MODULE_NAME" />
     <option name="LAST_EDITED_TAB_NAME" />
     </subPane>
   </component>
   <component name="ProjectReloadState">
-    <option name="STATE" value="0" />
+    <option name="STATE" value="2" />
   </component>
   <component name="ProjectRootConfigurable.UI">
     <option name="proportions">
       <showLibraryContents />
       <hideEmptyPackages />
       <abbreviatePackageNames />
-      <showStructure Favorites="false" Scope="false" PackagesPane="false" ProjectPane="false" />
+      <showStructure PackagesPane="false" Scope="false" Favorites="false" ProjectPane="false" />
       <autoscrollToSource />
       <autoscrollFromSource />
       <sortByType />
     <option name="referencePos" value="0" />
     <option name="showLabels" value="true" />
   </component>
-  <component name="RunManager" selected="JUnit.SelfReferenceReflectionTest">
-    <tempConfiguration default="false" name="SelfReferenceReflectionTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+  <component name="RunManager" selected="JUnit.PropertyArithmeticAndLogicalOperatorsTest">
+    <tempConfiguration default="false" name="PropertyArithmeticAndLogicalOperatorsTest" 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.SelfReferenceReflectionTest" />
+      <option name="MAIN_CLASS_NAME" value="org.ognl.test.PropertyArithmeticAndLogicalOperatorsTest" />
       <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 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" />
-      <module name="" />
-      <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="OUTPUT_DIRECTORY" value="" />
       <option name="ANNOTATION_TYPE" />
       <option name="ENV_VARIABLES" />
+      <option name="PASS_PARENT_ENVS" value="true" />
       <option name="ADDITIONAL_CLASS_PATH" />
       <option name="TEST_SEARCH_SCOPE">
         <value defaultName="singleModule" />
       <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 name="Make" value="true" />
       </method>
     </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="" />
+      <method>
+        <option name="Make" value="true" />
+      </method>
+    </configuration>
     <list size="1">
-      <item index="0" class="java.lang.String" itemvalue="JUnit.SelfReferenceReflectionTest" />
+      <item index="0" class="java.lang.String" itemvalue="JUnit.PropertyArithmeticAndLogicalOperatorsTest" />
     </list>
     <configuration default="true" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local">
       <option name="WORKING_DIRECTORY" />
     <configuration useDefault="true">$USERPROFILE$/.subversion</configuration>
     <upgradeMode>none</upgradeMode>
   </component>
+  <component name="Talios.JiraConfigurationComponent" enableIssueTracking="true" autoRefresh="false" useExternalBrowser="false" refreshTimeout="0" annotateissues="false">
+    <servers>
+      <server baseurl="http://jira.opensymphony.com" username="jkuhnert" password="ch8eese" useCustomDateFormat="false" customDateFormat="">
+        <projects>
+          <project projectid="10090" projectname="OGNL" projectkey="OGNL" componentid="-1" componentname="All Components" />
+        </projects>
+      </server>
+    </servers>
+    <columns>
+      <column id="component" position="1" width="-1" />
+      <column id="title" position="2" width="-1" />
+      <column id="status" position="3" width="-1" />
+      <column id="type" position="4" width="-1" />
+    </columns>
+  </component>
   <component name="TodoView" selected-index="0">
     <todo-panel id="selected-file">
       <are-packages-shown value="false" />
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="101" y="151" width="2276" height="1394" extended-state="0" />
+    <frame x="106" y="150" width="2276" height="1397" 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.30200803" 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="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.32441202" order="1" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.5044898" order="3" />
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23614457" order="8" />
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2634538" order="8" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23557693" order="8" />
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2628205" 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.24943718" order="1" />
-      <window_info id="Maven projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
+      <window_info id="Maven projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.16508795" 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.2850699" order="0" />
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2571042" 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.2883534" order="2" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.29567307" 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" />
       <window_info id="SVN Properties" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32979593" order="8" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="0" />
       <window_info id="Profile" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32927817" order="8" />
+      <window_info id="Jira Browser" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4559295" order="8" />
       <window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
       <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="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="4" />
     <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="FIxes OGNL-117 by detecting attempts to use reflective indexed property accessor and throwing unsupported exceptions when found." />
+    <option name="LAST_COMMIT_MESSAGE" value="Fixes OGNL-128.  Addex explicit check for String types on the context stack in numeric expressions." />
     <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="Updated version to 2.7 (minus -SNAPSHOT) before tagging for release." />
-    <MESSAGE value="Minor iws change..?" />
     <MESSAGE value="Updated to new 2.7.1-SNAPSHOT version." />
     <MESSAGE value="Added snapshot/core distro URLS so that ibiblio bundle could be deployed separately from snapshot releases." />
     <MESSAGE value="Added new property arithmetic test since so many issues have been cropping up with non constant arithmetic expressions.  Fixed bug with substraction + generic object class type interface ." />
     <MESSAGE value="Updated to new snapshot version of 2.7.2." />
     <MESSAGE value="Fixes for OGNL-122.   OgnlOps should be converting Number based object instances to BigDecimal using the String constructor - as stated in the BigDecimal javadocs." />
     <MESSAGE value="FIxes OGNL-117 by detecting attempts to use reflective indexed property accessor and throwing unsupported exceptions when found." />
+    <MESSAGE value="Reverting previous check in changes....Changed my mind about not supporting these half native / half reflection situations." />
+    <MESSAGE value="Fixes OGNL-128.  Addex explicit check for String types on the context stack in numeric expressions." />
   </component>
   <component name="VssConfiguration">
     <option name="CLIENT_PATH" value="" />
     <option name="myLastEditedConfigurable" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlOps.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="171" column="5" selection-start="6746" selection-end="6746" vertical-scroll-proportion="0.19686985">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="2240" column="0" selection-start="83216" selection-end="83216" vertical-scroll-proportion="0.29571664">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/NumericExpression.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="35" column="4" selection-start="622" selection-end="622" vertical-scroll-proportion="0.2092257">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTThisVarRef.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="40" column="0" selection-start="1945" selection-end="1945" vertical-scroll-proportion="0.13591433">
-          <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="125" column="0" selection-start="7962" selection-end="7962" vertical-scroll-proportion="0.33278418">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Indexed.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="59" column="5" selection-start="2379" selection-end="2379" vertical-scroll-proportion="0.28336078">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/TestClass.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="8" column="0" selection-start="80" selection-end="80" vertical-scroll-proportion="0.098846786">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Messages.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="33" column="23" selection-start="566" selection-end="566" vertical-scroll-proportion="0.407743">
-          <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="60" column="0" selection-start="3367" selection-end="3367" vertical-scroll-proportion="0.3583196">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/enhance/ExpressionCompiler.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="476" column="45" selection-start="17188" selection-end="17188" vertical-scroll-proportion="0.23228996">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java">
       <provider selected="true" editor-type-id="text-editor">
         <state line="211" column="0" selection-start="7770" selection-end="7770" vertical-scroll-proportion="0.40197694">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/SelfReferenceReflectionTest.java">
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/MenuItem.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="54" column="34" selection-start="1182" selection-end="1182" vertical-scroll-proportion="0.5930807">
+        <state line="35" column="4" selection-start="628" selection-end="628" vertical-scroll-proportion="0.41906327">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTAdd.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-2.3008323">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTMultiply.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="58" column="0" selection-start="2440" selection-end="2440" vertical-scroll-proportion="0.51724136">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTNegate.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="63" column="14" selection-start="2556" selection-end="2556" vertical-scroll-proportion="0.60642093">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTDivide.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="52" column="0" selection-start="2306" selection-end="2306" vertical-scroll-proportion="0.41022593">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="488" column="0" selection-start="18430" selection-end="18430" vertical-scroll-proportion="0.39239">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/PropertyArithmeticAndLogicalOperatorsTest.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="16" column="56" selection-start="447" selection-end="447" vertical-scroll-proportion="0.09531635">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/NumericExpression.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="75" column="0" selection-start="1683" selection-end="1683" vertical-scroll-proportion="0.65488905">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTRemainder.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="36" column="36" selection-start="1897" selection-end="1897" vertical-scroll-proportion="0.08627773">
+          <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="541" column="10" selection-start="19642" selection-end="19642" vertical-scroll-proportion="0.43138865">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/SimpleNumeric.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="19" column="19" selection-start="337" selection-end="337" vertical-scroll-proportion="0.23418242">
           <folding />
         </state>
       </provider>

src/java/ognl/NumericExpression.java

                 && (ASTConst.class.isInstance(child) || NumericExpression.class.isInstance(child)))
         {
             ret += OgnlRuntime.getNumericLiteral(context.getCurrentType());
+        } else if (context.getCurrentType() != null && String.class.isAssignableFrom(context.getCurrentType()))
+        {
+            ret = "Double.parseDouble(" + ret + ")";
+            context.setCurrentType(Double.TYPE);
         }
 
         if (NumericExpression.class.isInstance(child))

src/java/ognl/enhance/ExpressionCompiler.java

 
     /**
      * Returns the appropriate casting expression (minus parens) for the specified class type.
-     * 
+     *
      * <p/>
      * For instance, if given an {@link Integer} object the string <code>"java.lang.Integer"</code>
      * would be returned. For an array of primitive ints <code>"int[]"</code> and so on..
             || (OrderedReturn.class.isInstance(expression) && ((OrderedReturn) expression).getLastExpression() != null))
             return body;
 
-
 /*         System.out.println("castExpression() with expression " + expression + " expr class: " + expression.getClass() + " currentType is: " + context.getCurrentType()
                       + " previousType: " + context.getPreviousType()
                       + "\n current Accessor: " + context.getCurrentAccessor()
 
         return body;
     }
-    
+
     public String createLocalReference(OgnlContext context, String expression, Class type)
     {
         String referenceName = "ref" + context.incrementLocalReferenceCounter();
             method.setBody(body);
 
             clazz.addMethod(method);
-            
+
             it.remove();
         }
     }
 
         _pool = ClassPool.getDefault();
         _pool.insertClassPath(new LoaderClassPath(loader.getParent()));
-        
+
         return _pool;
     }
 }

src/test/java/org/ognl/test/PropertyArithmeticAndLogicalOperatorsTest.java

             { ROOT, "genericIndex % theInt == property.bean3.value", Boolean.FALSE},
             { ROOT, "theInt / 100.0", ROOT.getTheInt() / 100.0},
             { ROOT, "@java.lang.Long@valueOf('100') == @java.lang.Long@valueOf('100')", Boolean.TRUE},
-            { NUMERIC, "budget - timeBilled", new Double(NUMERIC.getBudget() - NUMERIC.getTimeBilled())}
+            { NUMERIC, "budget - timeBilled", new Double(NUMERIC.getBudget() - NUMERIC.getTimeBilled())},
+            { NUMERIC, "(budget % tableSize) == 0", Boolean.TRUE}
     };
 
     public static TestSuite suite()
         super(name, root, expressionString, expectedResult, setValue);
     }
 
-    public PropertyArithmeticAndLogicalOperatorsTest(String name, Object root, String expressionString, Object expectedResult)
+    public PropertyArithmeticAndLogicalOperatorsTest(String name, Object root,
+                                                     String expressionString, Object expectedResult)
     {
         super(name, root, expressionString, expectedResult);
     }

src/test/java/org/ognl/test/SelfReferenceReflectionTest.java

-package org.ognl.test;
-
-import junit.framework.TestCase;
-import ognl.Node;
-import ognl.Ognl;
-import ognl.OgnlContext;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Tests for bug OGNL-117.
- */
-public class SelfReferenceReflectionTest extends TestCase {
-
-    private Map map;
-    private TestObject testObject = new TestObject("propertyValue");
-    private String propertyKey = "property";
-
-    public class TestObject {
-        private String property;
-        private Integer integerProperty = 1;
-
-        public TestObject(String property) {
-            this.property = property;
-        }
-
-        public String getProperty() {
-            return property;
-        }
-
-        public Integer getIntegerProperty() {
-            return integerProperty;
-        }
-    }
-
-    public Map getMap() {
-        return map;
-    }
-    public String getKey() {
-        return "key";
-    }
-
-    public TestObject getObject() {
-        return testObject;
-    }
-
-    public String getPropertyKey() {
-        return propertyKey;
-    }
-
-    public void testEnhancedOgnl() throws Exception {
-        map = new HashMap();
-        map.put("key", "value");
-        OgnlContext context = (OgnlContext)Ognl.createDefaultContext(this);
-
-        Node expression = Ognl.compileExpression(context, this, "object[#this.propertyKey]");
-        assertEquals("propertyValue", Ognl.getValue(expression.getAccessor(), context, this)) ;
-
-        // Succeeds with 2.7.1-20070723.185910-9
-        context.clear();
-        Node expression2 = Ognl.compileExpression(context, this, "object[propertyKey]");
-        assertEquals("propertyValue", Ognl.getValue(expression2.getAccessor(), context, this)) ;
-
-        propertyKey = "integerProperty";
-
-        // Succeeds
-        assertEquals(1, Ognl.getValue(expression.getAccessor(), context, this)) ;
-
-        context.clear();
-
-        // Fails with 2.7.1-20070723.185910-9
-        assertEquals(1, Ognl.getValue(expression2, context, this)) ;
-    }
-}

src/test/java/org/ognl/test/objects/SimpleNumeric.java

     {
         return 24.12;
     }
+
+    public String getTableSize()
+    {
+        return "10";
+    }
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.