1. opensymphony
  2. ognl

Commits

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

Added support for enum constant expressions to help fix OGNL-106 but can't be sure if it's fixed or not because of insufficient data.

  • Participants
  • Parent commits d0f7b92
  • Branches default

Comments (0)

Files changed (8)

File OGNL.iml

View file
       <excludeFolder url="file://$MODULE_DIR$/extlib" />
       <excludeFolder url="file://$MODULE_DIR$/target" />
     </content>
-    <orderEntry type="jdk" jdkName="1.5" jdkType="JavaSDK" />
+    <orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module-library">
       <library>

File OGNL.iws

View file
   <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/test/java/org/ognl/test/Performance.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/Performance.java" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/build/asm.jar" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/build/mvel.jar" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/pom.xml" afterPath="$PROJECT_DIR$/pom.xml" />
+      <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="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$/osbuild.xml" afterPath="$PROJECT_DIR$/osbuild.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/ASTStaticField.java" afterPath="$PROJECT_DIR$/src/java/ognl/ASTStaticField.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java" afterPath="$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java" afterPath="$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java" />
     </list>
   </component>
   <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
     </subPane>
   </component>
   <component name="FileEditorManager">
-    <leaf>
-      <file leaf-file-name="osbuild.xml" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/osbuild.xml">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="119" column="0" selection-start="4425" selection-end="4425" vertical-scroll-proportion="0.30135822">
-              <folding />
-            </state>
-          </provider>
-        </entry>
-      </file>
-      <file leaf-file-name="Performance.java" pinned="false" current="true" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/Performance.java">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="317" column="20" selection-start="12601" selection-end="12601" vertical-scroll-proportion="1.4719195">
-              <folding>
-                <element signature="imports" expanded="true" />
-              </folding>
-            </state>
-          </provider>
-        </entry>
-      </file>
-    </leaf>
+    <leaf />
   </component>
   <component name="FindManager">
     <FindUsagesManager>
       <showLibraryContents />
       <hideEmptyPackages />
       <abbreviatePackageNames />
-      <showStructure Favorites="false" Scope="false" PackagesPane="false" ProjectPane="false" />
+      <showStructure PackagesPane="false" Scope="false" Favorites="false" ProjectPane="false" />
       <autoscrollToSource />
       <autoscrollFromSource />
       <sortByType />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth0" value="284" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth3" value="35" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth2" value="304" />
+    <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="$USERPROFILE$/projects/tapestry/tapestry-framework/src/java/org/apache/tapestry/services/impl" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth0" value="243" />
     <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth4" value="1042" />
+    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth3" value="243" />
     <property name="GoToClass.includeJavaFiles" value="false" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_treeWidth3" value="243" />
     <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="1098" />
     <property name="cvs_file_history_flatWidth0" value="503" />
-    <property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth4" value="1098" />
     <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.TestExpressionCompiler">
-    <tempConfiguration default="false" name="TestExpressionCompiler" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
-      <pattern value="org.ognl.test.enhance.*" />
+  <component name="RestoreUpdateTree">
+    <UpdateInfo date="7/9/07 7:56 PM" ActionInfo="_Update">
+      <UpdatedFiles>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Updated from server" />
+          <option name="myStatusName" value="Changed on server" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="CHANGED_ON_SERVER" />
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Updated" />
+            <option name="myStatusName" value="Changed" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="false" />
+            <option name="myId" value="UPDATED" />
+          </FILE-GROUP>
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Created" />
+            <option name="myStatusName" value="Created" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="false" />
+            <option name="myId" value="CREATED" />
+          </FILE-GROUP>
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Deleted" />
+            <option name="myStatusName" value="Deleted" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="true" />
+            <option name="myId" value="REMOVED_FROM_REPOSITORY" />
+          </FILE-GROUP>
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Restored" />
+            <option name="myStatusName" value="Will be restored" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="false" />
+            <option name="myId" value="RESTORED" />
+          </FILE-GROUP>
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Modified" />
+          <option name="myStatusName" value="Modified" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MODIFIED" />
+          <PATH>$PROJECT_DIR$/OGNL.iws</PATH>
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Skipped" />
+          <option name="myStatusName" value="Skipped" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="SKIPPED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Merged with conflicts" />
+          <option name="myStatusName" value="Will be merged with conflicts" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MERGED_WITH_CONFLICTS" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Merged" />
+          <option name="myStatusName" value="Will be merged" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MERGED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Not in repository" />
+          <option name="myStatusName" value="Not in repository" />
+          <option name="mySupportsDeletion" value="true" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="UNKNOWN" />
+          <PATH>$PROJECT_DIR$/dist</PATH>
+          <PATH>$PROJECT_DIR$/extlib</PATH>
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Locally added" />
+          <option name="myStatusName" value="Locally added" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="LOCALLY_ADDED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Locally removed" />
+          <option name="myStatusName" value="Locally removed" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="LOCALLY_REMOVED" />
+        </FILE-GROUP>
+      </UpdatedFiles>
+    </UpdateInfo>
+  </component>
+  <component name="RunManager" selected="JUnit.StaticsAndConstructorsTest">
+    <tempConfiguration default="false" name="StaticsAndConstructorsTest" 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.enhance" />
-      <option name="MAIN_CLASS_NAME" value="org.ognl.test.enhance.TestExpressionCompiler" />
+      <option name="PACKAGE_NAME" value="org.ognl.test" />
+      <option name="MAIN_CLASS_NAME" value="org.ognl.test.StaticsAndConstructorsTest" />
       <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="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="Remote" factoryName="Remote">
       <option name="USE_SOCKET_TRANSPORT" value="true" />
       <option name="SERVER_MODE" value="false" />
         <option name="Make" value="true" />
       </method>
     </configuration>
-    <configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+    <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" 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="ADDITIONAL_CLASS_PATH" />
-      <option name="TEST_SEARCH_SCOPE">
-        <value defaultName="wholeProject" />
-      </option>
-      <method>
-        <option name="Make" value="true" />
-      </method>
+      <option name="ALTERNATIVE_JRE_PATH" />
     </configuration>
     <configuration default="true" type="TestNG" factoryName="TestNG" enabled="false" merge="false">
       <module name="" />
         <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="ADDITIONAL_CLASS_PATH" />
+      <option name="TEST_SEARCH_SCOPE">
+        <value defaultName="wholeProject" />
+      </option>
+      <method>
+        <option name="Make" value="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local">
       <option name="WORKING_DIRECTORY" />
       <option name="HOST" value="localhost" />
       <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 Repositories" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32924837" order="8" />
+      <window_info id="SVN Repositories" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32924837" 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="Added in MVEL comparisons in performance tests." />
+    <option name="LAST_COMMIT_MESSAGE" value="Added support for enum constant expressions to help fix OGNL-106 but can't be sure if it's fixed or not because of insufficient data." />
     <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="Fixes OGNL-77. ASTAdd wasn't setting the context type before returning." />
     <MESSAGE value="Fixes TAPESTRY-1419. Needed to add () around widening expressions in ASTList." />
     <MESSAGE value="Fixes OGNL-84, OGNL-83.  Precasting statements were being stolen by ASTMethod for inner children incorrectly.  ASTProperty also wasn't setting the correct current type on previously indexed methods. &#10;&#10;Also reverted surefire version since someone there seems to have broken the current version." />
     <MESSAGE value="Fixes OGNL-85.  Error with type conversion in constructor calls.  Finally refactored ASTCtor to really dig through the available constructors and more thoroughly convert parameter types when possible." />
     <MESSAGE value="Fixes OGNL-97.  Was doing the old root class casting logic on root expressions when it seems to be unneccessary now that everything is properly being populated in the context accessor/type class value stack." />
     <MESSAGE value="Made javassist a &quot;provided&quot; scope." />
     <MESSAGE value="Added in MVEL comparisons in performance tests." />
+    <MESSAGE value="Added support for enum constant expressions to help fix OGNL-106 but can't be sure if it's fixed or not because of insufficient data." />
   </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/objects/Simple.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="208" column="5" selection-start="4765" selection-end="4898" vertical-scroll-proportion="0.7485331">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="451" column="5" selection-start="10901" selection-end="10901" vertical-scroll-proportion="0.45934618">
-          <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="59" column="0" selection-start="3283" selection-end="3283" vertical-scroll-proportion="0.493537">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ObjectPropertyAccessor.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="198" column="12" selection-start="7269" selection-end="7269" vertical-scroll-proportion="0.3877791">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$USERPROFILE$/projects/tapestry/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="125" column="34" selection-start="4320" selection-end="4320" vertical-scroll-proportion="-4.1621623">
-          <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="136" column="8" selection-start="4004" selection-end="4004" vertical-scroll-proportion="0.50963956">
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/enhance/OgnlExpressionCompiler.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="84" column="10" selection-start="3548" selection-end="3548" vertical-scroll-proportion="0.37133276">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTProperty.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="391" column="0" selection-start="15979" selection-end="15979" vertical-scroll-proportion="0.5029338">
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/src/java/ognl/MethodAccessor.java">
       <provider selected="true" editor-type-id="text-editor">
         <state line="65" column="12" selection-start="3223" selection-end="3223" vertical-scroll-proportion="0.4526404">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/java/ognl/enhance/ExpressionCompiler.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="26" column="0" selection-start="687" selection-end="687" vertical-scroll-proportion="0.26404023">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$USERPROFILE$/.IntelliJIdea60/system/extResources/cbe730b3_maven-v4_0_0.xsd">
       <provider selected="true" editor-type-id="text-editor">
         <state line="785" column="49" selection-start="39111" selection-end="39111" vertical-scroll-proportion="0.37096775">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pom.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="44" column="0" selection-start="1401" selection-end="1401" vertical-scroll-proportion="0.41426146">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/build.xml">
       <provider selected="true" editor-type-id="text-editor">
         <state line="59" column="0" selection-start="1846" selection-end="1846" vertical-scroll-proportion="0.5670628">
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/enhance/ExpressionAccessor.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="41" column="7" selection-start="1234" selection-end="1234" vertical-scroll-proportion="0.47778708">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/Node.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="51" column="0" selection-start="2398" selection-end="2398" vertical-scroll-proportion="0.2766136">
+          <folding />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/osbuild.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="119" column="0" selection-start="4425" selection-end="4425" vertical-scroll-proportion="0.30135822">
+        <state line="119" column="0" selection-start="4425" selection-end="4425" vertical-scroll-proportion="0.027164686">
+          <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="63" column="37" selection-start="3114" selection-end="3114" vertical-scroll-proportion="0.38977367">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/Performance.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="317" column="20" selection-start="12601" selection-end="12601" vertical-scroll-proportion="1.4719195">
+        <state line="253" column="32" selection-start="10858" selection-end="10858" vertical-scroll-proportion="0.35252643">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/ASTStaticField.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="71" column="0" selection-start="2641" selection-end="2641" vertical-scroll-proportion="0.37720034">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/java/ognl/OgnlRuntime.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="1438" column="13" selection-start="53070" selection-end="53070" vertical-scroll-proportion="0.4383906">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/Root.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="472" column="0" selection-start="11217" selection-end="11217" vertical-scroll-proportion="0.45934618">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/test/java/org/ognl/test/objects/SimpleEnum.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="6" column="0" selection-start="68" selection-end="68" vertical-scroll-proportion="0.075440064">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/pom.xml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="35" column="31" selection-start="1157" selection-end="1157" vertical-scroll-proportion="0.30560273">
+          <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="543" column="20" selection-start="19720" selection-end="19720" vertical-scroll-proportion="0.2816429">
+          <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="118" column="0" selection-start="3623" selection-end="3623" vertical-scroll-proportion="0.075440064">
           <folding>
             <element signature="imports" expanded="true" />
           </folding>

File pom.xml

View file
             <version>3.4.ga</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.codehaus.mvel</groupId>
+            <artifactId>mvel</artifactId>
+            <version>1.0</version>
+            <scope>system</scope>
+            <systemPath>${basedir}/lib/build/mvel.jar</systemPath>
+        </dependency>
     </dependencies>
 
     <build>

File src/java/ognl/ASTStaticField.java

View file
     private String fieldName;
 
     private Class _getterClass;
-    
+
     public ASTStaticField(int id)
     {
         super(id);
     }
 
     protected Object getValueBody(OgnlContext context, Object source)
-        throws OgnlException
+            throws OgnlException
     {
         return OgnlRuntime.getStaticField(context, className, fieldName);
     }
 
     public boolean isNodeConstant(OgnlContext context)
-        throws OgnlException
+            throws OgnlException
     {
         boolean result = false;
         Exception reason = null;
 
         try {
             Class c = OgnlRuntime.classForName(context, className);
-            
+
             /*
-             * Check for virtual static field "class"; this cannot interfere with normal static
-             * fields because it is a reserved word. It is considered constant.
-             */
-            if (fieldName.equals("class")) {
+            * Check for virtual static field "class"; this cannot interfere with normal static
+            * fields because it is a reserved word. It is considered constant.
+            */
+            if (fieldName.equals("class"))
+            {
                 result = true;
-            } else {
+            } else if (OgnlRuntime.isJdk15() && c.isEnum())
+            {
+                result = true;
+            } else
+            {
                 Field f = c.getField(fieldName);
-                
-                if (!Modifier.isStatic(f.getModifiers())) { throw new OgnlException("Field " + fieldName + " of class "
-                        + className + " is not static"); }
+
+                if (!Modifier.isStatic(f.getModifiers()))
+                    throw new OgnlException("Field " + fieldName + " of class " + className + " is not static");
+
                 result = Modifier.isFinal(f.getModifiers());
             }
         } catch (ClassNotFoundException e) {
             reason = e;
         }
 
-        if (reason != null) { throw new OgnlException("Could not get static field " + fieldName + " from class "
-                + className, reason); }
+        if (reason != null)
+            throw new OgnlException("Could not get static field " + fieldName
+                                    + " from class " + className, reason);
+
         return result;
     }
-    
+
     Class getFieldClass(OgnlContext context)
-    throws OgnlException
+            throws OgnlException
     {
         Exception reason = null;
-        
+
         try {
             Class c = OgnlRuntime.classForName(context, className);
-            
+
             /*
-             * Check for virtual static field "class"; this cannot interfere with normal static
-             * fields because it is a reserved word. It is considered constant.
-             */
-            if (fieldName.equals("class")) {
+            * Check for virtual static field "class"; this cannot interfere with normal static
+            * fields because it is a reserved word. It is considered constant.
+            */
+            if (fieldName.equals("class"))
+            {
                 return c;
-            } else {
+            } else if (OgnlRuntime.isJdk15() && c.isEnum())
+            {
+                return c;
+            } else
+            {
                 Field f = c.getField(fieldName);
-                
+
                 return f.getType();
             }
         } catch (ClassNotFoundException e) {
         } catch (SecurityException e) {
             reason = e;
         }
-        
+
         if (reason != null) { throw new OgnlException("Could not get static field " + fieldName + " from class "
-                + className, reason); }
-        
+                                                      + className, reason); }
+
         return null;
     }
-    
+
     public Class getGetterClass()
     {
         return _getterClass;
     }
-    
+
     public Class getSetterClass()
     {
         return _getterClass;
     }
-    
+
     public String toString()
     {
         return "@" + className + "@" + fieldName;
     public String toGetSourceString(OgnlContext context, Object target)
     {
         try {
-            
+
             Object obj = OgnlRuntime.getStaticField(context, className, fieldName);
-            
+
             context.setCurrentObject(obj);
 
             _getterClass = getFieldClass(context);
             else
                 throw new RuntimeException(t);
         }
-        
+
         return className + "." + fieldName;
     }
-    
+
     public String toSetSourceString(OgnlContext context, Object target)
     {
         try {
-            
+
             Object obj = OgnlRuntime.getStaticField(context, className, fieldName);
-            
+
             context.setCurrentObject(obj);
-            
+
             _getterClass = getFieldClass(context);
 
             context.setCurrentType(_getterClass);
             if (UnsupportedCompilationException.class.isInstance(t))
                 throw (UnsupportedCompilationException)t;
             else
-                throw new RuntimeException(t); 
+                throw new RuntimeException(t);
         }
-        
+
         return className + "." + fieldName;
     }
 }

File src/java/ognl/OgnlRuntime.java

View file
      */
     private static final String NULL_OBJECT_STRING = "<null>";
 
+    /**
+     * Used to store the result of determining if current jvm is 1.5 language compatible.
+     */
+    private static boolean _jdk15 = false;
+    private static boolean _jdkChecked = false;
+
     static final ClassCache _methodAccessors = new ClassCache();
     static final ClassCache _propertyAccessors = new ClassCache();
     static final ClassCache _elementsAccessors = new ClassCache();
         _declaredMethods[1].clear();
     }
 
+    /**
+     * Checks if the current jvm is java language >= 1.5 compatible.
+     *
+     * @return True if jdk15 features are present.
+     */
+    public static boolean isJdk15()
+    {
+        if (_jdkChecked)
+            return _jdk15;
+
+        try {
+            Class.forName("java.lang.annotation.Annotation");
+            _jdk15 = true;
+        } catch (Exception e) {}
+
+        _jdkChecked = true;
+
+        return _jdk15;
+    }
+
     public static String getNumericValueGetter(Class type)
     {
         return (String) NUMERIC_VALUES.get(type);
              * Check for virtual static field "class"; this cannot interfere with normal static
              * fields because it is a reserved word.
              */
-            if (fieldName.equals("class")) {
+            if (fieldName.equals("class"))
+            {
                 return c;
-            } else {
+            } else if (OgnlRuntime.isJdk15() && c.isEnum())
+            {
+                return Enum.valueOf(c, fieldName);
+            } else
+            {
                 Field f = c.getField(fieldName);
                 if (!Modifier.isStatic(f.getModifiers()))
                     throw new OgnlException("Field " + fieldName + " of class " + className + " is not static");
+                
                 return f.get(null);
             }
         } catch (ClassNotFoundException e) {

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

View file
 
         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/StaticsAndConstructorsTest.java

View file
 
     public enum Animals {
 
-        Dog, Cat, Wallabee, Bear; 
+        Dog, Cat, Wallabee, Bear
     }
 
     private static Object[][]       TESTS = {
             { "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}
+            {"@org.ognl.test.StaticsAndConstructorsTest$Animals@values().length != 2", Boolean.TRUE},
+            {"isOk(@org.ognl.test.objects.SimpleEnum@ONE, null)", Boolean.TRUE},
     };
 
     /*===================================================================

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

View file
         _openWindow = value;
     }
 
+    public boolean isOk(SimpleEnum value, String otherValue)
+    {
+        return true;
+    }
+
     public static class A
     {
         public int methodOfA(B b)