Commits

Anonymous committed 0745e69

XW-168: improving ability to integrate Spring using ObjectFactory + some Jalopy reformatting

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@236e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (28)

src/java/com/opensymphony/xwork/ActionChainResult.java

  */
 package com.opensymphony.xwork;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 
 /**
  * A special kind of view that invokes GenericDispatch (using the previously existing
  * @version $Revision$
  */
 public class ActionChainResult implements Result {
-    
+    //~ Static fields/initializers /////////////////////////////////////////////
+
     private static final Log log = LogFactory.getLog(ActionChainResult.class);
     public static final String DEFAULT_PARAM = "actionName";
     private static final String CHAIN_HISTORY = "CHAIN_HISTORY";
      * @param invocation the DefaultActionInvocation calling the action call stack
      */
     public void execute(ActionInvocation invocation) throws Exception {
-        
         if (isInChainHistory(namespace, actionName)) {
             throw new XworkException("infinite recursion detected");
         }
+
         addToHistory(namespace, actionName);
 
         HashMap extraContext = new HashMap();
 
         proxy = ActionProxyFactory.getFactory().createActionProxy(this.namespace, actionName, extraContext);
         proxy.execute();
-
     }
 
     public int hashCode() {
 
     private boolean isInChainHistory(String namespace, String actionName) {
         Set chainHistory = (Set) ActionContext.getContext().get(CHAIN_HISTORY);
+
         if (chainHistory == null) {
             return false;
         } else {
             return chainHistory.contains(makeKey(namespace, actionName));
         }
     }
+
     private void addToHistory(String namespace, String actionName) {
         Set chainHistory = (Set) ActionContext.getContext().get(CHAIN_HISTORY);
+
         if (chainHistory == null) {
-        	chainHistory = new HashSet();
-		}
-		ActionContext.getContext().put(CHAIN_HISTORY, chainHistory);
-		
-		chainHistory.add(makeKey(namespace, actionName));
+            chainHistory = new HashSet();
+        }
+
+        ActionContext.getContext().put(CHAIN_HISTORY, chainHistory);
+
+        chainHistory.add(makeKey(namespace, actionName));
     }
-    
+
     private String makeKey(String namespace, String actionName) {
         return namespace + "/" + actionName;
     }

src/java/com/opensymphony/xwork/ActionContext.java

      * Constant for the name of the action being executed.
      */
     public static final String ACTION_NAME = "com.opensymphony.xwork.ActionContext.name";
+
     /**
      * Constant for the {@link com.opensymphony.xwork.util.OgnlValueStack OGNL value stack}.
      */
     public static final String VALUE_STACK = OgnlValueStack.VALUE_STACK;
+
     /**
      * Constant for the action's session.
      */
     public static final String SESSION = "com.opensymphony.xwork.ActionContext.session";
+
     /**
      * Constant for the action's application context.
      */
     public static final String APPLICATION = "com.opensymphony.xwork.ActionContext.application";
+
     /**
      * Constant for the action's parameters.
      */
     public static final String PARAMETERS = "com.opensymphony.xwork.ActionContext.parameters";
+
     /**
      * Constant for the action's locale.
      */
     public static final String LOCALE = "com.opensymphony.xwork.ActionContext.locale";
+
     /**
      * Constant for the action's type converter.
      */
     public static final String TYPE_CONVERTER = "com.opensymphony.xwork.ActionContext.typeConverter";
+
     /**
      * Constant for the action's {@link com.opensymphony.xwork.ActionInvocation invocation} context.
      */
     public static final String ACTION_INVOCATION = "com.opensymphony.xwork.ActionContext.actionInvocation";
+
     /**
      * Constant for the map of type conversion errors.
      */

src/java/com/opensymphony/xwork/DefaultActionInvocation.java

 import com.opensymphony.xwork.config.entities.ResultConfig;
 import com.opensymphony.xwork.interceptor.Interceptor;
 import com.opensymphony.xwork.interceptor.PreResultListener;
-import com.opensymphony.xwork.util.OgnlUtil;
 import com.opensymphony.xwork.util.OgnlValueStack;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
             try {
                 newResult = ObjectFactory.getObjectFactory().buildResult(resultConfig);
             } catch (Exception e) {
-                LOG.error("There was an exception while instantiating the result of type " + resultConfig.getClazz(), e);
+                LOG.error("There was an exception while instantiating the result of type " + resultConfig.getClassName(), e);
                 throw e;
             }
         }
         } catch (IllegalAccessException e) {
             throw new XworkException("Illegal access to constructor, is it public?", e);
         } catch (ClassCastException e) {
-            throw new XworkException("Action class " + proxy.getConfig().getClazz().getName() + " does not implement " + Action.class.getName(), e);
+            throw new XworkException("Action class " + proxy.getConfig().getClassName() + " does not implement " + Action.class.getName(), e);
         } catch (Exception e) {
             String gripe = "";
 
                 gripe = "Whoa!  No ActionProxy instance found in current ActionInvocation.  This is bad ... very bad";
             } else if (proxy.getConfig() == null) {
                 gripe = "Sheesh.  Where'd that ActionProxy get to?  I can't find it in the current ActionInvocation!?";
-            } else if (proxy.getConfig().getClazz() == null) {
+            } else if (proxy.getConfig().getClassName() == null) {
                 gripe = "No Action defined for '" + proxy.getActionName() + "' in namespace '" + proxy.getNamespace() + "'";
             } else {
-                gripe = "Unable to instantiate Action, " + proxy.getConfig().getClazz().getName() + ",  defined for '" + proxy.getActionName() + "' in namespace '" + proxy.getNamespace() + "'";
+                gripe = "Unable to instantiate Action, " + proxy.getConfig().getClassName() + ",  defined for '" + proxy.getActionName() + "' in namespace '" + proxy.getNamespace() + "'";
             }
 
             gripe += (((" -- " + e.getMessage()) != null) ? e.getMessage() : " [no message in exception]");

src/java/com/opensymphony/xwork/DefaultActionProxyFactory.java

     */
     public ActionProxy createActionProxy(String namespace, String actionName, Map extraContext) throws Exception {
         setupConfigIfActionIsCommand(namespace, actionName);
+
         return new DefaultActionProxy(namespace, actionName, extraContext, true);
     }
 
     */
     public ActionProxy createActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult) throws Exception {
         setupConfigIfActionIsCommand(namespace, actionName);
+
         return new DefaultActionProxy(namespace, actionName, extraContext, executeResult);
     }
 
         }
 
         int bang = actionName.indexOf('!');
+
         if (bang != -1) {
             String realAction = actionName.substring(0, bang);
             String command = actionName.substring(bang + 1);
 
-            ActionConfig actionConfig
-                    = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, realAction);
-            ActionConfig newConfig = new ActionConfig(command, actionConfig.getClazz(), actionConfig.getParams(),
-                    actionConfig.getResults(), actionConfig.getInterceptors(), actionConfig.getExternalRefs(),
-                    actionConfig.getPackageName());
+            ActionConfig actionConfig = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, realAction);
+            ActionConfig newConfig = new ActionConfig(command, actionConfig.getClassName(), actionConfig.getParams(), actionConfig.getResults(), actionConfig.getInterceptors(), actionConfig.getExternalRefs(), actionConfig.getPackageName());
 
             ConfigurationManager.getConfiguration().getPackageConfig(newConfig.getPackageName()).addActionConfig(actionName, newConfig);
             ConfigurationManager.getConfiguration().rebuildRuntimeConfiguration();

src/java/com/opensymphony/xwork/ModelDriven.java

 /**
  * ModelDriven Actions provide a model object to be pushed onto the ValueStack
  * in addition to the Action itself, allowing a FormBean type approach like Struts.
- * 
+ *
  * @author Jason Carreira
  * Created Apr 8, 2003 6:22:42 PM
  */

src/java/com/opensymphony/xwork/ObjectFactory.java

  */
 package com.opensymphony.xwork;
 
+import com.opensymphony.util.ClassLoaderUtil;
 import com.opensymphony.xwork.config.ConfigurationException;
 import com.opensymphony.xwork.config.entities.ActionConfig;
 import com.opensymphony.xwork.config.entities.InterceptorConfig;
 
     private static ObjectFactory FACTORY = new ObjectFactory();
 
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private Map classes = new HashMap(); // Classes that have already been loaded
+
     //~ Constructors ///////////////////////////////////////////////////////////
 
     protected ObjectFactory() {
     }
 
     /**
+     * Utility method to obtain the class matched to className. Caches look ups so that subsequent
+     * lookups will be faster.
+     *
+     * @param className The fully qualified name of the class to return
+     * @return The class itself
+     * @throws ClassNotFoundException
+     */
+    public Class getClassInstance(String className) throws ClassNotFoundException {
+        Class clazz = (Class) classes.get(className);
+
+        if (clazz == null) {
+            clazz = ClassLoaderUtil.loadClass(className, this.getClass());
+            classes.put(className, clazz);
+        }
+
+        return clazz;
+    }
+
+    /**
      * Build an Action of the given type
      */
     public Action buildAction(ActionConfig config) throws Exception {
-        return (Action) buildBean(config.getClazz());
+        return (Action) buildBean(config.getClassName());
     }
 
     /**
     }
 
     /**
-     * Builds an Interceptor from the InterceptorConfig and the Map of parameters from the interceptor reference.
-     * Implementations of this method should ensure that the Interceptor is parameterized with both the parameters from
-     * the Interceptor config and the interceptor ref Map (the interceptor ref params take precedence), and that the
-     * Interceptor.init() method is called on the Interceptor instance before it is returned.
+     * Build a generic Java object of the given type.
      *
-     * @param interceptorConfig    the InterceptorConfig from the configuration
-     * @param interceptorRefParams a Map of params provided in the Interceptor reference in the Action mapping or
-     *                             InterceptorStack definition
+     * @param className the type of Object to build
      */
+    public Object buildBean(String className) throws Exception {
+        Class clazz = getClassInstance(className);
+
+        return clazz.newInstance();
+    }
+
+    /**
+         * Builds an Interceptor from the InterceptorConfig and the Map of
+         * parameters from the interceptor reference. Implementations of this method
+         * should ensure that the Interceptor is parameterized with both the
+         * parameters from the Interceptor config and the interceptor ref Map (the
+         * interceptor ref params take precedence), and that the Interceptor.init()
+         * method is called on the Interceptor instance before it is returned.
+         *
+         * @param interceptorConfig
+         *            the InterceptorConfig from the configuration
+         * @param interceptorRefParams
+         *            a Map of params provided in the Interceptor reference in the
+         *            Action mapping or InterceptorStack definition
+         */
     public Interceptor buildInterceptor(InterceptorConfig interceptorConfig, Map interceptorRefParams) throws ConfigurationException {
         Interceptor interceptor = null;
-        Class interceptorClass = interceptorConfig.getClazz();
+        String interceptorClassName = interceptorConfig.getClassName();
         String message;
         Map thisInterceptorClassParams = interceptorConfig.getParams();
         Map params = (thisInterceptorClassParams == null) ? new HashMap() : new HashMap(thisInterceptorClassParams);
         params.putAll(interceptorRefParams);
 
         try {
-            interceptor = (Interceptor) buildBean(interceptorClass);
+            interceptor = (Interceptor) buildBean(interceptorClassName);
             OgnlUtil.setProperties(params, interceptor);
             interceptor.init();
 
             return interceptor;
         } catch (InstantiationException e) {
-            message = "Unable to instantiate an instance of Interceptor class [" + interceptorClass.getName() + "].";
+            message = "Unable to instantiate an instance of Interceptor class [" + interceptorClassName + "].";
         } catch (IllegalAccessException e) {
-            message = "IllegalAccessException while attempting to instantiate an instance of Interceptor class [" + interceptorClass.getName() + "].";
+            message = "IllegalAccessException while attempting to instantiate an instance of Interceptor class [" + interceptorClassName + "].";
         } catch (ClassCastException e) {
-            message = "Class [" + interceptorClass.getName() + "] does not implement com.opensymphony.xwork.interceptor.Interceptor";
+            message = "Class [" + interceptorClassName + "] does not implement com.opensymphony.xwork.interceptor.Interceptor";
         } catch (Exception e) {
-            throw new ConfigurationException("Caught Exception while registering Interceptor class " + interceptorClass.getName(), e);
+            throw new ConfigurationException("Caught Exception while registering Interceptor class " + interceptorClassName, e);
         }
 
         throw new ConfigurationException(message);
      * Build a Result using the type in the ResultConfig and set the parameters in the ResultConfig.
      */
     public Result buildResult(ResultConfig resultConfig) throws Exception {
-        Class resultClass = resultConfig.getClazz();
+        String resultClassName = resultConfig.getClassName();
         Result result = null;
 
-        if (resultClass != null) {
-            result = (Result) buildBean(resultClass);
+        if (resultClassName != null) {
+            result = (Result) buildBean(resultClassName);
             OgnlUtil.setProperties(resultConfig.getParams(), result, ActionContext.getContext().getContextMap());
         }
 
     /**
      * Build a Validator of the given type and set the parameters on it
      *
-     * @param clazz  the type of Validator to build
+     * @param className  the type of Validator to build
      * @param params property name -> value Map to set onto the Validator instance
      */
-    public Validator buildValidator(Class clazz, Map params) throws Exception {
-        Validator validator = (Validator) buildBean(clazz);
+    public Validator buildValidator(String className, Map params) throws Exception {
+        Validator validator = (Validator) buildBean(className);
         OgnlUtil.setProperties(params, validator);
 
         return validator;

src/java/com/opensymphony/xwork/Validateable.java

 
 
 /**
- * Provides an interface in which a call for a validation check can be done. 
+ * Provides an interface in which a call for a validation check can be done.
  *
  * @author Jason Carreira
  * @see ActionSupport

src/java/com/opensymphony/xwork/config/Configuration.java

 public interface Configuration {
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    public void rebuildRuntimeConfiguration();
+
     PackageConfig getPackageConfig(String name);
 
     Set getPackageConfigNames();
     Map getPackageConfigs();
 
     /**
-     * the current runtime configuration.  currently, if changes have been made to the Configuration since the last
-     * time buildRuntimeConfiguration() was called, you'll need to make sure to
-     * @return
-     */
+ * the current runtime configuration.  currently, if changes have been made to the Configuration since the last
+ * time buildRuntimeConfiguration() was called, you'll need to make sure to
+ * @return
+ */
     RuntimeConfiguration getRuntimeConfiguration();
 
     void addPackageConfig(String name, PackageConfig packageConfig);
 
     /**
-     * allow the Configuration to clean up any resources that have been used
-     */
+ * allow the Configuration to clean up any resources that have been used
+ */
     void destroy();
 
     /**
-     * @throws ConfigurationException
-     */
+ * @throws ConfigurationException
+ */
     void reload() throws ConfigurationException;
 
-    public void rebuildRuntimeConfiguration();
-
     void removePackageConfig(String name);
 }

src/java/com/opensymphony/xwork/config/entities/ActionConfig.java

  */
 package com.opensymphony.xwork.config.entities;
 
+import com.opensymphony.xwork.Action;
+import com.opensymphony.xwork.ObjectFactory;
 import com.opensymphony.xwork.interceptor.Interceptor;
 
 import java.io.Serializable;
-
 import java.lang.reflect.Method;
-
 import java.util.*;
 
 
     protected Map params;
     protected Map results;
     protected Method method;
+    protected String className;
     protected String methodName;
     protected String packageName;
-    private Class clazz;
 
     //~ Constructors ///////////////////////////////////////////////////////////
 
     //Helper constuctor to maintain backward compatibility with objects that create ActionConfigs
     //TODO this should be removed if these changes are rolled in to xwork CVS
     public ActionConfig(String methodName, Class clazz, Map parameters, Map results, List interceptors) {
-        this(methodName, clazz, parameters, results, interceptors, Collections.EMPTY_LIST, new String());
+        this(methodName, clazz.getName(), parameters, results, interceptors);
+    }
+
+    public ActionConfig(String methodName, String className, Map parameters, Map results, List interceptors) {
+        this(methodName, className, parameters, results, interceptors, Collections.EMPTY_LIST, new String());
     }
 
     //TODO If this is commited to CVS we should put the package arg at the front of the ctor and fix
     //code that uses it
-    public ActionConfig(String methodName, Class clazz, Map parameters, Map results, List interceptors, List externalRefs, String packageName) {
+    public ActionConfig(String methodName, String className, Map parameters, Map results, List interceptors, List externalRefs, String packageName) {
         this.methodName = methodName;
         this.interceptors = interceptors;
         this.params = parameters;
         this.results = results;
-        this.clazz = clazz;
+        this.className = className;
         this.externalRefs = externalRefs;
         this.packageName = packageName;
     }
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void setClazz(Class clazz) {
-        this.clazz = clazz;
+    public void setClassName(String className) {
+        this.className = className;
     }
 
-    public Class getClazz() {
-        return clazz;
+    public String getClassName() {
+        return className;
     }
 
     public List getExternalRefs() {
      * @return cached instance of the action method or null if method name was not specified
      */
     public Method getMethod() throws NoSuchMethodException {
+
         if (method != null) {
             return method;
         }
 
+        Class clazz = null;
+
+        try {
+            ActionConfig actionConfig = new ActionConfig(null, getClassName(), null, null, null);
+            Action action = ObjectFactory.getObjectFactory().buildAction(actionConfig);
+            clazz = action.getClass();
+        } catch (Exception e) { // TODO: Only doing this because buildAction() throws Exception
+            throw new NoSuchMethodException("Unable to load action: " + e.getMessage());
+        }
+
         if (methodName != null) {
             try {
                 method = clazz.getMethod(methodName, new Class[0]);
 
         final ActionConfig actionConfig = (ActionConfig) o;
 
-        if ((clazz != null) ? (!clazz.equals(actionConfig.clazz)) : (actionConfig.clazz != null)) {
+        if ((className != null) ? (!className.equals(actionConfig.className)) : (actionConfig.className != null)) {
             return false;
         }
 
         result = (29 * result) + ((results != null) ? results.hashCode() : 0);
         result = (29 * result) + ((method != null) ? method.hashCode() : 0);
         result = (29 * result) + ((methodName != null) ? methodName.hashCode() : 0);
-        result = (29 * result) + ((clazz != null) ? clazz.hashCode() : 0);
+        result = (29 * result) + ((className != null) ? className.hashCode() : 0);
 
         return result;
     }
 
     public String toString() {
-        return "{ActionConfig " + clazz.getName() + ((methodName != null) ? ("." + methodName + "()") : "") + "}";
+        return "{ActionConfig " + className + ((methodName != null) ? ("." + methodName + "()") : "") + "}";
     }
 }

src/java/com/opensymphony/xwork/config/entities/InterceptorConfig.java

 public class InterceptorConfig implements Parameterizable {
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    Class clazz;
     Map params;
+    String className;
     String name;
 
     //~ Constructors ///////////////////////////////////////////////////////////
 
     public InterceptorConfig(String name, Class clazz, Map params) {
         this.name = name;
-        this.clazz = clazz;
+        this.className = clazz.getName();
+        this.params = params;
+    }
+
+    public InterceptorConfig(String name, String className, Map params) {
+        this.name = name;
+        this.className = className;
         this.params = params;
     }
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void setClazz(Class clazz) {
-        this.clazz = clazz;
+    public void setClassName(String className) {
+        this.className = className;
     }
 
-    public Class getClazz() {
-        return clazz;
+    public String getClassName() {
+        return className;
     }
 
     public void setName(String name) {
 
         final InterceptorConfig interceptorConfig = (InterceptorConfig) o;
 
-        if ((clazz != null) ? (!clazz.equals(interceptorConfig.clazz)) : (interceptorConfig.clazz != null)) {
+        if ((className != null) ? (!className.equals(interceptorConfig.className)) : (interceptorConfig.className != null)) {
             return false;
         }
 
     public int hashCode() {
         int result;
         result = ((name != null) ? name.hashCode() : 0);
-        result = (29 * result) + ((clazz != null) ? clazz.hashCode() : 0);
+        result = (29 * result) + ((className != null) ? className.hashCode() : 0);
         result = (29 * result) + ((params != null) ? params.hashCode() : 0);
 
         return result;

src/java/com/opensymphony/xwork/config/entities/ResultConfig.java

 public class ResultConfig implements Parameterizable {
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    private Class clazz;
     private Map params;
+    private String className;
     private String name;
 
     //~ Constructors ///////////////////////////////////////////////////////////
 
     public ResultConfig(String name, Class clazz, Map params) {
         this.name = name;
-        this.clazz = clazz;
+        this.className = clazz.getName();
+        this.params = params;
+    }
+
+    public ResultConfig(String name, String className, Map params) {
+        this.name = name;
+        this.className = className;
         this.params = params;
     }
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void setClazz(Class clazz) {
-        this.clazz = clazz;
+    public void setClassName(String className) {
+        this.className = className;
     }
 
-    public Class getClazz() {
-        return clazz;
+    public String getClassName() {
+        return className;
     }
 
     public void setName(String name) {
 
         final ResultConfig resultConfig = (ResultConfig) o;
 
-        if ((clazz != null) ? (!clazz.equals(resultConfig.clazz)) : (resultConfig.clazz != null)) {
+        if ((className != null) ? (!className.equals(resultConfig.className)) : (resultConfig.className != null)) {
             return false;
         }
 
     public int hashCode() {
         int result;
         result = ((name != null) ? name.hashCode() : 0);
-        result = (29 * result) + ((clazz != null) ? clazz.hashCode() : 0);
+        result = (29 * result) + ((className != null) ? className.hashCode() : 0);
         result = (29 * result) + ((params != null) ? params.hashCode() : 0);
 
         return result;

src/java/com/opensymphony/xwork/config/impl/DefaultConfiguration.java

  */
 package com.opensymphony.xwork.config.impl;
 
-import com.opensymphony.xwork.config.Configuration;
-import com.opensymphony.xwork.config.ConfigurationException;
-import com.opensymphony.xwork.config.ConfigurationManager;
-import com.opensymphony.xwork.config.ConfigurationProvider;
-import com.opensymphony.xwork.config.RuntimeConfiguration;
+import com.opensymphony.xwork.config.*;
 import com.opensymphony.xwork.config.entities.ActionConfig;
 import com.opensymphony.xwork.config.entities.PackageConfig;
 import com.opensymphony.xwork.config.entities.ResultTypeConfig;
 import com.opensymphony.xwork.config.providers.InterceptorBuilder;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 
 /**
     public void destroy() {
     }
 
+    public void rebuildRuntimeConfiguration() {
+        runtimeConfiguration = buildRuntimeConfiguration();
+    }
+
     /**
     * Calls the ConfigurationProviderFactory.getConfig() to tell it to reload the configuration and then calls
     * buildRuntimeConfiguration().
         }
     }
 
-    public void rebuildRuntimeConfiguration() {
-        runtimeConfiguration = buildRuntimeConfiguration();
-    }
-
     /**
     * This methodName builds the internal runtime configuration used by Xwork for finding and configuring Actions from the
     * programmatic configuration data structures. All of the old runtime configuration will be discarded and rebuilt.
 
         List externalRefs = baseConfig.getExternalRefs();
 
-        ActionConfig config = new ActionConfig(baseConfig.getMethodName(), baseConfig.getClazz(), params, results, interceptors, baseConfig.getExternalRefs(), packageContext.getName());
+        ActionConfig config = new ActionConfig(baseConfig.getMethodName(), baseConfig.getClassName(), params, results, interceptors, externalRefs, packageContext.getName());
 
         return config;
     }

src/java/com/opensymphony/xwork/config/providers/XmlConfigurationProvider.java

 import com.opensymphony.util.ClassLoaderUtil;
 import com.opensymphony.util.FileManager;
 import com.opensymphony.util.TextUtils;
-
-import com.opensymphony.xwork.config.Configuration;
-import com.opensymphony.xwork.config.ConfigurationException;
-import com.opensymphony.xwork.config.ConfigurationProvider;
-import com.opensymphony.xwork.config.ConfigurationUtil;
-import com.opensymphony.xwork.config.ExternalReferenceResolver;
-import com.opensymphony.xwork.config.entities.ActionConfig;
-import com.opensymphony.xwork.config.entities.ExternalReference;
-import com.opensymphony.xwork.config.entities.InterceptorConfig;
-import com.opensymphony.xwork.config.entities.InterceptorStackConfig;
-import com.opensymphony.xwork.config.entities.PackageConfig;
-import com.opensymphony.xwork.config.entities.ResultConfig;
-import com.opensymphony.xwork.config.entities.ResultTypeConfig;
-
+import com.opensymphony.xwork.Action;
+import com.opensymphony.xwork.ObjectFactory;
+import com.opensymphony.xwork.config.*;
+import com.opensymphony.xwork.config.entities.*;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.xml.sax.*;
 
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 import java.io.IOException;
 import java.io.InputStream;
-
 import java.util.*;
 
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
 
 /**
  * Looks in the classpath for "xwork.xml" and uses it for the XWork configuration.
         //methodName should be null if it's not set
         methodName = (methodName.trim().length() > 0) ? methodName.trim() : null;
 
-        Class clazz = null;
-
         try {
-            clazz = ClassLoaderUtil.loadClass(className, XmlConfigurationProvider.class);
-        } catch (ClassNotFoundException e) {
+            ActionConfig actionConfig = new ActionConfig(null, className, null, null, null);
+            Action action = ObjectFactory.getObjectFactory().buildAction(actionConfig);
+        } catch (Exception e) { // TODO: Not pretty
             LOG.error("Action class [" + className + "] not found, skipping action [" + name + "]", e);
 
             return;
 
         List externalrefs = buildExternalRefs(actionElement, packageContext);
 
-        ActionConfig actionConfig = new ActionConfig(methodName, clazz, actionParams, results, interceptorList, externalrefs, packageContext.getName());
+        ActionConfig actionConfig = new ActionConfig(methodName, className, actionParams, results, interceptorList, externalrefs, packageContext.getName());
         packageContext.addActionConfig(name, actionConfig);
 
         if (LOG.isDebugEnabled()) {
             String className = interceptorElement.getAttribute("class");
             Class clazz = null;
 
+            Map params = XmlHelper.getParams(interceptorElement);
+            InterceptorConfig config = null;
+
             try {
-                clazz = ClassLoaderUtil.loadClass(className, XmlConfigurationProvider.class);
-            } catch (ClassNotFoundException e) {
+                config = new InterceptorConfig(name, className, params);
+                ObjectFactory.getObjectFactory().buildInterceptor(config, new HashMap());
+                context.addInterceptorConfig(config);
+            } catch (ConfigurationException e) {
                 String s = "Unable to load class " + className + " for interceptor name " + name + ". This interceptor will not be available.";
                 LOG.error(s);
-                throw new ConfigurationException(s, e);
+                throw e;
             }
 
-            Map params = XmlHelper.getParams(interceptorElement);
-            InterceptorConfig config = new InterceptorConfig(name, clazz, params);
             context.addInterceptorConfig(config);
         }
 

src/java/com/opensymphony/xwork/interceptor/AbstractLifecycleInterceptor.java

     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
- * This callback method will be called after the Action execution and before the Result execution.
- * @param invocation
- * @param resultCode
- */
+    * This callback method will be called after the Action execution and before the Result execution.
+    * @param invocation
+    * @param resultCode
+    */
     public void beforeResult(ActionInvocation invocation, String resultCode) {
     }
 
     /**
- * Called to let an interceptor clean up any resources it has allocated.
- */
+    * Called to let an interceptor clean up any resources it has allocated.
+    */
     public void destroy() {
     }
 
     /**
- * Called after an Interceptor is created, but before any requests are processed using the intercept() methodName. This
- * gives the Interceptor a chance to initialize any needed resources.
- */
+    * Called after an Interceptor is created, but before any requests are processed using the intercept() methodName. This
+    * gives the Interceptor a chance to initialize any needed resources.
+    */
     public void init() {
     }
 
     /**
- * Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the
- * request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.
- *
- * @param invocation
- * @return
- * @throws Exception
- */
+    * Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the
+    * request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.
+    *
+    * @param invocation
+    * @return
+    * @throws Exception
+    */
     public String intercept(ActionInvocation invocation) throws Exception {
         invocation.addPreResultListener(this);
 
     }
 
     /**
- * Called after the Action and Result have been executed.
- * @throws Exception
- */
+    * Called after the Action and Result have been executed.
+    * @throws Exception
+    */
     protected void after() throws Exception {
     }
 
     /**
- * Called before the rest of the ActionInvocation is forwarded to.
- * @throws Exception
- */
+    * Called before the rest of the ActionInvocation is forwarded to.
+    * @throws Exception
+    */
     protected void before() throws Exception {
     }
 
     /**
- * Called if an Exception is caught while executing the before(), the rest of the ActionInvocation, including the
- * Action and Result execution, or the after() call. The default implementation just rethrows the Exception. Subclasses
- * can choose to either throw an Exception or do some processing.
- * @param e the Exception caught
- * @throws Exception
- */
+    * Called if an Exception is caught while executing the before(), the rest of the ActionInvocation, including the
+    * Action and Result execution, or the after() call. The default implementation just rethrows the Exception. Subclasses
+    * can choose to either throw an Exception or do some processing.
+    * @param e the Exception caught
+    * @throws Exception
+    */
     protected void handleException(Exception e) throws Exception {
         throw e;
     }

src/java/com/opensymphony/xwork/interceptor/AroundInterceptor.java

 package com.opensymphony.xwork.interceptor;
 
 import com.opensymphony.xwork.ActionInvocation;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
     protected abstract void after(ActionInvocation dispatcher, String result) throws Exception;
 
     /**
-     * Called before the invocation has been executed. 
+     * Called before the invocation has been executed.
      */
     protected abstract void before(ActionInvocation invocation) throws Exception;
 }

src/java/com/opensymphony/xwork/interceptor/ConversionErrorInterceptor.java

 import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.util.XWorkConverter;
 
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.HashMap;
 
 
 /**
  * Date: Nov 27, 2003 3:57:06 PM
  */
 public class ConversionErrorInterceptor extends AroundInterceptor {
-    //~ Methods ////////////////////////////////////////////////////////////////
+    //~ Static fields/initializers /////////////////////////////////////////////
 
     public static final String ORIGINAL_PROPERTY_OVERRIDE = "original.property.override";
 
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    protected Object getOverrideExpr(ActionInvocation invocation, Object value) {
+        return "'" + value + "'";
+    }
+
     protected void after(ActionInvocation dispatcher, String result) throws Exception {
     }
 
         OgnlValueStack stack = invocationContext.getValueStack();
 
         HashMap fakie = null;
+
         for (Iterator iterator = conversionErrors.entrySet().iterator();
                 iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
                 if (fakie == null) {
                     fakie = new HashMap();
                 }
+
                 fakie.put(propertyName, getOverrideExpr(invocation, value));
             }
         }
             // if there were some errors, put the original (fake) values in place right before the result
             stack.getContext().put(ORIGINAL_PROPERTY_OVERRIDE, fakie);
             invocation.addPreResultListener(new PreResultListener() {
-                public void beforeResult(ActionInvocation invocation, String resultCode) {
-                    Map fakie = (Map) invocation.getInvocationContext().get(ORIGINAL_PROPERTY_OVERRIDE);
-                    if (fakie != null) {
-                        invocation.getStack().setExprOverrides(fakie);
+                    public void beforeResult(ActionInvocation invocation, String resultCode) {
+                        Map fakie = (Map) invocation.getInvocationContext().get(ORIGINAL_PROPERTY_OVERRIDE);
+
+                        if (fakie != null) {
+                            invocation.getStack().setExprOverrides(fakie);
+                        }
                     }
-                }
-            });
+                });
         }
     }
 
-    protected Object getOverrideExpr(ActionInvocation invocation, Object value) {
-        return "'" + value + "'";
-    }
-
     protected boolean shouldAddError(String propertyName, Object value) {
         return true;
     }

src/java/com/opensymphony/xwork/interceptor/StaticParametersInterceptor.java

 
 /**
  * Populates the Action with the static parameters defined in the Action
- * configuration by treating the Action as a bean.  If the  Action is 
+ * configuration by treating the Action as a bean.  If the  Action is
  * {@link Parameterizable}, a map of the static parameters will be also be
  * passed directly to the Action.
  * <p>

src/java/com/opensymphony/xwork/interceptor/component/ComponentManager.java

 public interface ComponentManager {
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    Object getComponent(Class enablerType);
+
     void setFallback(ComponentManager fallback);
 
     void addEnabler(Class component, Class enablerType);
     void dispose();
 
     void initializeObject(Object obj);
-
-    Object getComponent(Class enablerType);
 }

src/java/com/opensymphony/xwork/interceptor/component/DefaultComponentManager.java

 
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    public Object getComponent(Class enablerType) {
+        DefaultComponentManager dcm = this;
+
+        // loop all the DCMs and get the one that holds this enabler
+        Class resource = null;
+
+        while (dcm != null) {
+            resource = (Class) dcm.enablers.get(enablerType);
+
+            if (resource != null) {
+                break;
+            }
+
+            dcm = dcm.fallback;
+        }
+
+        if (resource == null) {
+            // this is an unknown resource, return null;
+            return null;
+        }
+
+        // now that we have the DCM and the resource class, we can set it up
+        try {
+            ResourceEnablerPair pair = setupAndOptionallyCreateResource(dcm, resource);
+
+            return pair.resource;
+        } catch (Exception e) {
+            String message = "Could not load resource with enabler " + enablerType;
+            log.error(message, e);
+            throw new RuntimeException(message);
+        }
+    }
+
     public void setFallback(ComponentManager fallback) {
         if (fallback instanceof DefaultComponentManager) {
             this.fallback = (DefaultComponentManager) fallback;
         //        }
     }
 
-    public Object getComponent(Class enablerType) {
-        DefaultComponentManager dcm = this;
-
-        // loop all the DCMs and get the one that holds this enabler
-        Class resource = null;
-        while (dcm != null) {
-            resource = (Class) dcm.enablers.get(enablerType);
-
-            if (resource != null) {
-                break;
-            }
-
-            dcm = dcm.fallback;
-        }
-
-        if (resource == null)
-        {
-            // this is an unknown resource, return null;
-            return null;
-        }
-
-        // now that we have the DCM and the resource class, we can set it up
-        try {
-            ResourceEnablerPair pair = setupAndOptionallyCreateResource(dcm, resource);
-            return pair.resource;
-        } catch (Exception e) {
-            String message = "Could not load resource with enabler " + enablerType;
-            log.error(message, e);
-            throw new RuntimeException(message);
-        }
-    }
-
     private Map getResourceDependencies(Class resourceClass) {
         List interfaces = new ArrayList();
         addAllInterfaces(resourceClass, interfaces);
             Map resources = getResourceDependencies(clazz);
 
             for (Iterator iterator = resources.entrySet().iterator();
-                 iterator.hasNext();) {
+                    iterator.hasNext();) {
                 Map.Entry mapEntry = (Map.Entry) iterator.next();
                 Class depResource = (Class) mapEntry.getKey();
                 DefaultComponentManager newDcm = (DefaultComponentManager) mapEntry.getValue();
         if (newResource == null) {
             newResource = ObjectFactory.getObjectFactory().buildBean(depResource);
         }
+
         pair.resource = newResource;
 
         Class enabler = loadResource(newResource, depResource, newDcm);
         pair.enabler = enabler;
+
         return pair;
     }
 
         }
 
         try {
-            enabler.getMethods()[0].invoke(resource, new Object[]{newResource});
+            enabler.getMethods()[0].invoke(resource, new Object[] {newResource});
         } catch (Exception e) {
             e.printStackTrace();
 
         }
     }
 
+    //~ Inner Classes //////////////////////////////////////////////////////////
+
     class ResourceEnablerPair {
         Class enabler;
         Object resource;

src/java/com/opensymphony/xwork/util/InstantiatingNullHandler.java

     //~ Static fields/initializers /////////////////////////////////////////////
 
     public static final String CREATE_NULL_OBJECTS = "xwork.NullHandler.createNullObjects";
-
     private static final Log LOG = LogFactory.getLog(InstantiatingNullHandler.class);
 
     //~ Instance fields ////////////////////////////////////////////////////////
         try {
             Class clazz = method.getParameterTypes()[0];
             Object param = createObject(context, clazz, target, property.toString());
-            method.invoke(target, new Object[]{param});
+            method.invoke(target, new Object[] {param});
 
             return param;
         } catch (Exception e) {
             mapping.putAll(props);
 
             for (Iterator iterator = mapping.entrySet().iterator();
-                 iterator.hasNext();) {
+                    iterator.hasNext();) {
                 Map.Entry entry = (Map.Entry) iterator.next();
                 String propName = (String) entry.getKey();
                 String className = (String) entry.getValue();

src/java/com/opensymphony/xwork/util/LocalizedTextUtil.java

 
     private static final List DEFAULT_RESOURCE_BUNDLES = Collections.synchronizedList(new ArrayList());
     private static final Log LOG = LogFactory.getLog(LocalizedTextUtil.class);
-
     private static boolean reloadBundles = false;
 
     static {
         }
     }
 
-    private static void reloadBundles(ResourceBundle resource) {
-        if (reloadBundles) {
-            try {
-                Class klass = resource.getClass().getSuperclass();
-                Field field = klass.getDeclaredField("cacheList");
-                field.setAccessible(true);
-                Object cache = field.get(null);
-                Method clearMethod = cache.getClass().getMethod("clear", new Class[0]);
-                clearMethod.invoke(cache, new Object[0]);
-            } catch (Exception e) {
-                LOG.error("Could not reload resource bundles", e);
-            }
-        }
-    }
-
     public static String findDefaultText(String aTextName, Locale locale) throws MissingResourceException {
         MissingResourceException e = null;
         List localList = new ArrayList(DEFAULT_RESOURCE_BUNDLES);
             try {
                 ResourceBundle bundle = findResourceBundle(bundleName, locale);
                 reloadBundles(bundle);
+
                 return bundle.getString(aTextName);
             } catch (MissingResourceException ex) {
                 e = ex;
             try {
                 ResourceBundle bundle = findResourceBundle(clazz.getName(), locale);
                 reloadBundles(bundle);
+
                 String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
 
                 return MessageFormat.format(message, args);
                         try {
                             ResourceBundle bundle = findResourceBundle(interfaces[x].getName(), locale);
                             reloadBundles(bundle);
+
                             String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
 
                             return MessageFormat.format(message, args);
                     try {
                         ResourceBundle bundle = findResourceBundle(clazz.getName(), locale);
                         reloadBundles(bundle);
+
                         String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
 
                         return MessageFormat.format(message, args);
                 String packageName = clazz.getPackage().getName();
                 ResourceBundle bundle = findResourceBundle(packageName + ".package", locale);
                 reloadBundles(bundle);
+
                 String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
 
                 return MessageFormat.format(message, args);
             }
         } while (!clazz.equals(Object.class));
 
-
         return getDefaultText(aTextName, locale, valueStack, args, defaultMessage);
     }
 
 
         try {
             reloadBundles(bundle);
+
             String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
 
             return MessageFormat.format(message, args);
 
         return MessageFormat.format(TextParseUtil.translateVariables(defaultMessage, valueStack), args);
     }
+
+    private static void reloadBundles(ResourceBundle resource) {
+        if (reloadBundles) {
+            try {
+                Class klass = resource.getClass().getSuperclass();
+                Field field = klass.getDeclaredField("cacheList");
+                field.setAccessible(true);
+
+                Object cache = field.get(null);
+                Method clearMethod = cache.getClass().getMethod("clear", new Class[0]);
+                clearMethod.invoke(cache, new Object[0]);
+            } catch (Exception e) {
+                LOG.error("Could not reload resource bundles", e);
+            }
+        }
+    }
 }

src/java/com/opensymphony/xwork/util/XWorkMethodAccessor.java

 
 /**
  * Allows methods to be executed under normal cirumstances, except when {@link #DENY_METHOD_EXECUTION}
- * is in the action context with a value of true.  
+ * is in the action context with a value of true.
  *
  * @author Patrick Lightbody
  */

src/java/com/opensymphony/xwork/validator/ValidatorFactory.java

 package com.opensymphony.xwork.validator;
 
 import com.opensymphony.util.ClassLoaderUtil;
-
 import com.opensymphony.xwork.ObjectFactory;
-import com.opensymphony.xwork.util.OgnlUtil;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import java.io.InputStream;
-
 import java.util.HashMap;
 import java.util.Map;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
     public static Validator getValidator(String type, Map params) {
-        Class clazz = (Class) validators.get(type);
+        String className = (String) validators.get(type);
 
-        if (clazz == null) {
+        if (className == null) {
             throw new IllegalArgumentException("There is no validator class mapped to the name " + type);
         }
 
         Validator validator;
 
         try {
-            validator = ObjectFactory.getObjectFactory().buildValidator(clazz, params);
+            validator = ObjectFactory.getObjectFactory().buildValidator(className, params);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new IllegalArgumentException("There was a problem creating a Validator of type " + clazz.getName());
+            throw new IllegalArgumentException("There was a problem creating a Validator of type " + className);
         }
 
         return validator;
     }
 
-    public static void registerValidator(String name, Class clazz) {
+    public static void registerValidator(String name, String className) {
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Registering validator of class " + clazz.getName() + " with name " + name);
+            LOG.debug("Registering validator of class " + className + " with name " + name);
         }
 
-        validators.put(name, clazz);
+        validators.put(name, className);
     }
 
     private static void parseValidators() {

src/java/com/opensymphony/xwork/validator/ValidatorFileParser.java

  */
 package com.opensymphony.xwork.validator;
 
-import com.opensymphony.util.ClassLoaderUtil;
-
+import com.opensymphony.xwork.ObjectFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.xml.sax.*;
 
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 import java.io.IOException;
 import java.io.InputStream;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
 
 /**
  * ValidatorFileParser
                 Class clazz = null;
 
                 try {
-                    clazz = ClassLoaderUtil.loadClass(className, ValidatorFileParser.class);
-                } catch (ClassNotFoundException e) {
-                    log.error("Unable to load validator class");
-                }
-
-                if (clazz != null) {
-                    ValidatorFactory.registerValidator(name, clazz);
+                    // catch any problems here
+                    ObjectFactory.getObjectFactory().buildValidator(className, new HashMap());
+                    ValidatorFactory.registerValidator(name, className);
+                } catch (Exception e) {
+                    log.error("Unable to load validator class " + className);
                 }
             }
         } catch (Exception e) {

src/test/com/opensymphony/xwork/config/ConfigurationTest.java

 import com.opensymphony.xwork.*;
 import com.opensymphony.xwork.config.providers.MockConfigurationProvider;
 import com.opensymphony.xwork.config.providers.XmlConfigurationProvider;
-
 import junit.framework.TestCase;
 
 import java.util.HashMap;
         try {
             ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy("/nonAbstract", "test", null);
             assertTrue(proxy.getActionName().equals("test"));
-            assertTrue(proxy.getConfig().getClazz().equals(SimpleAction.class));
+            assertTrue(proxy.getConfig().getClassName().equals(SimpleAction.class.getName()));
         } catch (Exception e) {
             e.printStackTrace();
             fail();

src/test/com/opensymphony/xwork/config/providers/XmlConfigurationProviderMultilevelTest.java

 import com.opensymphony.xwork.config.entities.PackageConfig;
 import com.opensymphony.xwork.config.entities.ResultConfig;
 import com.opensymphony.xwork.interceptor.ParametersInterceptor;
-
 import junit.framework.Assert;
 
 
         assertTrue(actionConfig.getResults().containsKey("success"));
 
         ResultConfig resultConfig = (ResultConfig) actionConfig.getResults().get("success");
-        assertEquals(ActionChainResult.class, resultConfig.getClazz());
+        assertEquals(ActionChainResult.class.getName(), resultConfig.getClassName());
     }
 }

src/test/com/opensymphony/xwork/interceptor/component/ComponentConfigurationTest.java

 package com.opensymphony.xwork.interceptor.component;
 
 import junit.framework.TestCase;
-
 import org.xml.sax.SAXException;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-
 import java.util.ArrayList;
 
 
         ArrayList initialized = new ArrayList();
         ArrayList resources = new ArrayList();
 
+        public Object getComponent(Class enablerType) {
+            return null;
+        }
+
         public void setFallback(ComponentManager fallback) {
         }
 
         public void initializeObject(Object component) {
             initialized.add(component);
         }
-
-        public Object getComponent(Class enablerType) {
-            return null;
-        }
     }
 }

src/test/com/opensymphony/xwork/util/OgnlValueStackTest.java

 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.SimpleAction;
 import com.opensymphony.xwork.TestBean;
-
 import junit.framework.TestCase;
 
 import java.io.*;
-
 import java.math.BigDecimal;
-
 import java.util.HashMap;
 import java.util.Map;
 
         assertEquals("Rover", vs.findValue("name", String.class));
     }
 
+    public void testCallMethodOnNullObject() {
+        OgnlValueStack stack = new OgnlValueStack();
+        assertNull(stack.findValue("foo.size()"));
+    }
+
     public void testCallMethodThatThrowsExceptionTwice() {
         SimpleAction action = new SimpleAction();
         OgnlValueStack stack = new OgnlValueStack();
         assertEquals("OK", stack.findValue("exceptionMethod()"));
     }
 
-    public void testCallMethodOnNullObject() {
-        OgnlValueStack stack = new OgnlValueStack();
-        assertNull(stack.findValue("foo.size()"));
-    }
-
     public void testCallMethodWithNullArg() {
         SimpleAction action = new SimpleAction();
         OgnlValueStack stack = new OgnlValueStack();