Commits

Anonymous committed 0214b62

formatting for the 2.0 final release

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@338573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (39)

src/java/com/opensymphony/webwork/dispatcher/ApplicationMap.java

                 final String key = enum.nextElement().toString();
                 final Object value = context.getAttribute(key);
                 entries.add(new Map.Entry() {
-                    public boolean equals(Object obj) {
-                        Map.Entry entry = (Map.Entry) obj;
+                        public boolean equals(Object obj) {
+                            Map.Entry entry = (Map.Entry) obj;
 
-                        return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                    }
+                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                        }
 
-                    public int hashCode() {
-                        return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                    }
+                        public int hashCode() {
+                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                        }
 
-                    public Object getKey() {
-                        return key;
-                    }
+                        public Object getKey() {
+                            return key;
+                        }
 
-                    public Object getValue() {
-                        return value;
-                    }
+                        public Object getValue() {
+                            return value;
+                        }
 
-                    public Object setValue(Object obj) {
-                        context.setAttribute(key.toString(), obj);
+                        public Object setValue(Object obj) {
+                            context.setAttribute(key.toString(), obj);
 
-                        return value;
-                    }
-                });
+                            return value;
+                        }
+                    });
             }
 
             // Add servlet context init params
                 final String key = enum.nextElement().toString();
                 final Object value = context.getInitParameter(key);
                 entries.add(new Map.Entry() {
-                    public boolean equals(Object obj) {
-                        Map.Entry entry = (Map.Entry) obj;
+                        public boolean equals(Object obj) {
+                            Map.Entry entry = (Map.Entry) obj;
 
-                        return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                    }
+                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                        }
 
-                    public int hashCode() {
-                        return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                    }
+                        public int hashCode() {
+                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                        }
 
-                    public Object getKey() {
-                        return key;
-                    }
+                        public Object getKey() {
+                            return key;
+                        }
 
-                    public Object getValue() {
-                        return value;
-                    }
+                        public Object getValue() {
+                            return value;
+                        }
 
-                    public Object setValue(Object obj) {
-                        context.setAttribute(key.toString(), obj);
+                        public Object setValue(Object obj) {
+                            context.setAttribute(key.toString(), obj);
 
-                        return value;
-                    }
-                });
+                            return value;
+                        }
+                    });
             }
         }
 

src/java/com/opensymphony/webwork/dispatcher/FilterDispatcher.java

         HashMap newConfig = new HashMap();
 
         for (Iterator iterator = namespaceActionConfigs.entrySet().iterator();
-             iterator.hasNext();) {
+                iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             String namespace = (String) entry.getKey();
             Map actionConfigs = (Map) entry.getValue();
 
             for (Iterator configIterator = actionConfigs.entrySet().iterator();
-                 configIterator.hasNext();) {
+                    configIterator.hasNext();) {
                 Map.Entry entry2 = (Map.Entry) configIterator.next();
                 String actionName = (String) entry2.getKey();
                 ActionConfig actionConfig = (ActionConfig) entry2.getValue();

src/java/com/opensymphony/webwork/dispatcher/HttpHeaderResult.java

  */
 package com.opensymphony.webwork.dispatcher;
 
-import com.opensymphony.xwork.Result;
-import com.opensymphony.xwork.ActionInvocation;
+import com.opensymphony.webwork.ServletActionContext;
+
 import com.opensymphony.xwork.ActionContext;
+import com.opensymphony.xwork.ActionInvocation;
+import com.opensymphony.xwork.Result;
 import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.util.TextParseUtil;
-import com.opensymphony.webwork.ServletActionContext;
 
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 
 /**
  * HttpHeaderResult
  * Date: Nov 16, 2003 12:12:44 AM
  */
 public class HttpHeaderResult implements Result {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
     public static final String DEFAULT_PARAM = "status";
 
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     protected boolean parse = true;
-    private int status = -1;
     private Map headers;
+    private int status = -1;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public Map getHeaders() {
+        if (headers == null) {
+            headers = new HashMap();
+        }
+
+        return headers;
+    }
 
     /**
      * If parse is true (the default) the header values will be evaluated against the ValueStack
         this.status = status;
     }
 
-    public Map getHeaders() {
-        if (headers == null) {
-            headers = new HashMap();
-        }
-        return headers;
-    }
-
     /**
      * Represents a generic interface for all action execution results, whether that be displaying a webpage, generating
      * an email, sending a JMS message, etc.
      */
     public void execute(ActionInvocation invocation) throws Exception {
         HttpServletResponse response = ServletActionContext.getResponse();
+
         if (status != -1) {
             response.setStatus(status);
         }
+
         if (headers != null) {
             OgnlValueStack stack = ActionContext.getContext().getValueStack();
-            for (Iterator iterator = headers.entrySet().iterator(); iterator.hasNext();) {
+
+            for (Iterator iterator = headers.entrySet().iterator();
+                    iterator.hasNext();) {
                 Map.Entry entry = (Map.Entry) iterator.next();
                 String value = (String) entry.getValue();
                 String finalValue = parse ? TextParseUtil.translateVariables(value, stack) : value;
             }
         }
     }
-
-
 }

src/java/com/opensymphony/webwork/dispatcher/ServletDispatcher.java

     }
 
     /**
-* Service a request - get the namespace, actionName, paramMap, sessionMap, applicationMap from the providers
-* and delegate to the service call
-*
-* @param request
-* @param response
-* @exception javax.servlet.ServletException
-*/
+    * Service a request - get the namespace, actionName, paramMap, sessionMap, applicationMap from the providers
+    * and delegate to the service call
+    *
+    * @param request
+    * @param response
+    * @exception javax.servlet.ServletException
+    */
     public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
         try {
             request = wrapRequest(request);
     }
 
     /**
-* The request is first checked to see if it is a multi-part. If it is, then the request
-* is wrapped so WW will be able to work with the multi-part as if it was a normal request.
-* Then the request is handed to GenericDispatcher and executed.
-*/
+    * The request is first checked to see if it is a multi-part. If it is, then the request
+    * is wrapped so WW will be able to work with the multi-part as if it was a normal request.
+    * Then the request is handed to GenericDispatcher and executed.
+    */
     public void serviceAction(HttpServletRequest request, HttpServletResponse response, String namespace, String actionName, Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap) {
         HashMap extraContext = createContextMap(requestMap, parameterMap, sessionMap, applicationMap, request, response, getServletConfig());
         extraContext.put(SERLVET_DISPATCHER, this);
     }
 
     /**
-* build the name of the action from the request
-*
-* override this method to customize a ULR -> action name mapping
-*/
+    * build the name of the action from the request
+    *
+    * override this method to customize a ULR -> action name mapping
+    */
     protected String getActionName(HttpServletRequest request) {
         String servletPath = (String) request.getAttribute("javax.servlet.include.servlet_path");
 
     }
 
     /**
-* get the namespace of the action from the request
-*
-* override this method to customize a ULR -> action namespace mapping
-*/
+    * get the namespace of the action from the request
+    *
+    * override this method to customize a ULR -> action namespace mapping
+    */
     protected String getNameSpace(HttpServletRequest request) {
         // Path is always original path, even if it is included in page with another path
         String servletPath = request.getServletPath();
     }
 
     /**
-* send a http error response
-*
-* @param request
-* @param response
-* @param code the HttpServletResponse error code
-* @param e the exception that needs to be reported on
-*/
+    * send a http error response
+    *
+    * @param request
+    * @param response
+    * @param code the HttpServletResponse error code
+    * @param e the exception that needs to be reported on
+    */
     protected void sendError(HttpServletRequest request, HttpServletResponse response, int code, Exception e) {
         try {
             // send a http error response to use the servlet defined error handler
     }
 
     /**
-* Wrap servlet request with the appropriate request. It will check to
-* see if request is a multipart request and wrap in appropriately.
-*
-* @param request
-* @return wrapped request or original request
-*/
+    * Wrap servlet request with the appropriate request. It will check to
+    * see if request is a multipart request and wrap in appropriately.
+    *
+    * @param request
+    * @return wrapped request or original request
+    */
     protected HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException {
         // don't wrap more than once
         if (request instanceof MultiPartRequestWrapper) {
     }
 
     /**
-* Determine action name by extracting last string and removing
-* extension. (/.../.../Foo.action -> Foo)
-*/
+    * Determine action name by extracting last string and removing
+    * extension. (/.../.../Foo.action -> Foo)
+    */
     String getActionName(String name) {
         // Get action name ("Foo.action" -> "Foo" action)
         int beginIdx = name.lastIndexOf("/");

src/java/com/opensymphony/webwork/dispatcher/SessionMap.java

 import java.util.Map;
 import java.util.Set;
 
-import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
 
 
 /**
 
     public void clear() {
         HttpSession session = request.getSession();
+
         synchronized (session) {
             entries = null;
             session.invalidate();
 
     public Set entrySet() {
         HttpSession session = request.getSession();
+
         synchronized (session) {
             if (entries == null) {
                 entries = new HashSet();
                     final String key = enum.nextElement().toString();
                     final Object value = session.getAttribute(key);
                     entries.add(new Map.Entry() {
-                        public boolean equals(Object obj) {
-                            Map.Entry entry = (Map.Entry) obj;
+                            public boolean equals(Object obj) {
+                                Map.Entry entry = (Map.Entry) obj;
 
-                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                        }
+                                return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                            }
 
-                        public int hashCode() {
-                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                        }
+                            public int hashCode() {
+                                return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                            }
 
-                        public Object getKey() {
-                            return key;
-                        }
+                            public Object getKey() {
+                                return key;
+                            }
 
-                        public Object getValue() {
-                            return value;
-                        }
+                            public Object getValue() {
+                                return value;
+                            }
 
-                        public Object setValue(Object obj) {
-                            request.getSession().setAttribute(key.toString(), obj);
+                            public Object setValue(Object obj) {
+                                request.getSession().setAttribute(key.toString(), obj);
 
-                            return value;
-                        }
-                    });
+                                return value;
+                            }
+                        });
                 }
             }
         }
 
     public Object get(Object key) {
         HttpSession session = request.getSession();
+
         synchronized (session) {
             return session.getAttribute(key.toString());
         }
 
     public Object put(Object key, Object value) {
         HttpSession session = request.getSession();
+
         synchronized (session) {
             entries = null;
             session.setAttribute(key.toString(), value);
 
     public Object remove(Object key) {
         HttpSession session = request.getSession();
+
         synchronized (session) {
             entries = null;
 

src/java/com/opensymphony/webwork/dispatcher/multipart/MultiPartRequestWrapper.java

                 }
 
                 // get the constructor
-                Constructor ctor = clazz.getDeclaredConstructor(new Class[]{
-                    Class.forName("javax.servlet.http.HttpServletRequest"),
-                    java.lang.String.class, int.class
-                });
+                Constructor ctor = clazz.getDeclaredConstructor(new Class[] {
+                        Class.forName("javax.servlet.http.HttpServletRequest"),
+                        java.lang.String.class, int.class
+                    });
 
                 // build the parameter list
-                Object[] parms = new Object[]{
+                Object[] parms = new Object[] {
                     request, saveDir, new Integer(maxSize)
                 };
 

src/java/com/opensymphony/webwork/dispatcher/multipart/PellMultiPartRequest.java

 
 import http.utils.multipartrequest.ServletMultipartRequest;
 
+import org.apache.commons.logging.LogFactory;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.commons.logging.LogFactory;
-
 
 /* ------------------------------------------------------------ */
 
      */
     private static void setEncoding() {
         String encoding = null;
+
         try {
             //encoding = Configuration.getString("webwork.i18n.encoding");
             if (encoding != null) {
                 //ServletMultiPartRequest, as it can cause problems.
                 //See javadoc for MultipartRequest.setEncoding()
                 http.utils.multipartrequest.MultipartRequest.setEncoding(encoding);
-            }
-            else {
+            } else {
                 http.utils.multipartrequest.MultipartRequest.setEncoding("UTF-8");
             }
         } catch (IllegalArgumentException e) {

src/java/com/opensymphony/webwork/interceptor/NoParameters.java

  */
 package com.opensymphony.webwork.interceptor;
 
+
 /**
  * This marker interface should be implemented by actions that do not want any
  * parameters set on them automatically (by the ParametersActionFactoryProxy)
  * It may also be useful if one for security reasons wants to make sure that
  * parameters cannot be set by malicious users.
  *
- * @author	Dick Zetterberg (dick@transitor.se)
- * @version	$Revision$, $Date$
+ * @author        Dick Zetterberg (dick@transitor.se)
+ * @version        $Revision$, $Date$
  */
 public interface NoParameters extends com.opensymphony.xwork.interceptor.NoParameters {
-}
+}

src/java/com/opensymphony/webwork/util/ClassLoaderUtils.java

     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
- * Load a given resource.
- * <p>
- * This method will try to load the resource using the following methods (in order):
- * <ul>
- *  <li>From {@link Thread#getContextClassLoader() Thread.currentThread().getContextClassLoader()}
- *  <li>From {@link Class#getClassLoader() ClassLoaderUtil.class.getClassLoader()}
- *  <li>From the {@link Class#getClassLoader() callingClass.getClassLoader() }
- * </ul>
- *
- * @param resourceName The name of the resource to load
- * @param callingClass The Class object of the calling object
- */
+    * Load a given resource.
+    * <p>
+    * This method will try to load the resource using the following methods (in order):
+    * <ul>
+    *  <li>From {@link Thread#getContextClassLoader() Thread.currentThread().getContextClassLoader()}
+    *  <li>From {@link Class#getClassLoader() ClassLoaderUtil.class.getClassLoader()}
+    *  <li>From the {@link Class#getClassLoader() callingClass.getClassLoader() }
+    * </ul>
+    *
+    * @param resourceName The name of the resource to load
+    * @param callingClass The Class object of the calling object
+    */
     public static URL getResource(String resourceName, Class callingClass) {
         URL url = null;
 
     }
 
     /**
- * This is a convenience method to load a resource as a stream.
- *
- * The algorithm used to find the resource is given in getResource()
- *
- * @param resourceName The name of the resource to load
- * @param callingClass The Class object of the calling object
- */
+    * This is a convenience method to load a resource as a stream.
+    *
+    * The algorithm used to find the resource is given in getResource()
+    *
+    * @param resourceName The name of the resource to load
+    * @param callingClass The Class object of the calling object
+    */
     public static InputStream getResourceAsStream(String resourceName, Class callingClass) {
         URL url = getResource(resourceName, callingClass);
 
     }
 
     /**
- * Load a class with a given name.
- * <p>
- * It will try to load the class in the following order:
- * <ul>
- *  <li>From {@link Thread#getContextClassLoader() Thread.currentThread().getContextClassLoader()}
- *  <li>Using the basic {@link Class#forName(java.lang.String) }
- *  <li>From {@link Class#getClassLoader() ClassLoaderUtil.class.getClassLoader()}
- *  <li>From the {@link Class#getClassLoader() callingClass.getClassLoader() }
- * </ul>
- *
- * @param className The name of the class to load
- * @param callingClass The Class object of the calling object
- * @throws ClassNotFoundException If the class cannot be found anywhere.
- */
+    * Load a class with a given name.
+    * <p>
+    * It will try to load the class in the following order:
+    * <ul>
+    *  <li>From {@link Thread#getContextClassLoader() Thread.currentThread().getContextClassLoader()}
+    *  <li>Using the basic {@link Class#forName(java.lang.String) }
+    *  <li>From {@link Class#getClassLoader() ClassLoaderUtil.class.getClassLoader()}
+    *  <li>From the {@link Class#getClassLoader() callingClass.getClassLoader() }
+    * </ul>
+    *
+    * @param className The name of the class to load
+    * @param callingClass The Class object of the calling object
+    * @throws ClassNotFoundException If the class cannot be found anywhere.
+    */
     public static Class loadClass(String className, Class callingClass) throws ClassNotFoundException {
         try {
             return Thread.currentThread().getContextClassLoader().loadClass(className);
     }
 
     /**
- * Prints the current classloader hierarchy - useful for debugging.
- */
+    * Prints the current classloader hierarchy - useful for debugging.
+    */
     public static void printClassLoader() {
         System.out.println("ClassLoaderUtils.printClassLoader");
         printClassLoader(Thread.currentThread().getContextClassLoader());
     }
 
     /**
- * Prints the classloader hierarchy from a given classloader - useful for debugging.
- */
+    * Prints the classloader hierarchy from a given classloader - useful for debugging.
+    */
     public static void printClassLoader(ClassLoader cl) {
         System.out.println("ClassLoaderUtils.printClassLoader(cl = " + cl + ")");
 

src/java/com/opensymphony/webwork/util/FastByteArrayOutputStream.java

     }
 
     /**
- * Create a new buffer and store the
- * current one in linked list
- */
+    * Create a new buffer and store the
+    * current one in linked list
+    */
     protected void addBuffer() {
         if (buffers == null) {
             buffers = new LinkedList();

src/java/com/opensymphony/webwork/util/TokenHelper.java

         String sessionToken = (String) session.getAttribute(tokenName);
 
         if (!token.equals(sessionToken)) {
-            LOG.warn(LocalizedTextUtil.findText(TokenHelper.class, "webwork.invalid.token", request.getLocale(), "Form token {0} does not match the session token {1}.", new Object[]{
-                token, sessionToken
-            }));
+            LOG.warn(LocalizedTextUtil.findText(TokenHelper.class, "webwork.invalid.token", request.getLocale(), "Form token {0} does not match the session token {1}.", new Object[] {
+                        token, sessionToken
+                    }));
 
             return false;
         }

src/java/com/opensymphony/webwork/util/URLBean.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.util;
 
 import com.opensymphony.webwork.views.util.UrlHelper;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
 /**
  * User: plightbo
  * Date: Nov 16, 2003
  * Time: 4:13:11 PM
  */
 public class URLBean {
-    String page;
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    HashMap params;
     HttpServletRequest request;
     HttpServletResponse response;
-    HashMap params;
+    String page;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public void setPage(String page) {
         this.page = page;
         this.response = response;
     }
 
-    public URLBean addParameter(String name, Object value) {
-        if (params == null) {
-            params = new HashMap();
-        }
-
-        if (value == null) {
-            params.remove(name);
-        } else {
-            params.put(name, value.toString());
-        }
-
-        return this;
-    }
-
     public String getURL() {
         // all this trickier with maps is to reduce the number of objects created
         Map fullParams = null;
+
         if (params != null) {
             fullParams = new HashMap();
         }
 
-
         if (page == null) {
             // No particular page requested, so go to "same page"
             // Add query params to parameters
         return UrlHelper.buildUrl(page, request, response, fullParams);
     }
 
+    public URLBean addParameter(String name, Object value) {
+        if (params == null) {
+            params = new HashMap();
+        }
+
+        if (value == null) {
+            params.remove(name);
+        } else {
+            params.put(name, value.toString());
+        }
+
+        return this;
+    }
+
     public String toString() {
         return getURL();
     }

src/java/com/opensymphony/webwork/util/WebWorkUtil.java

 package com.opensymphony.webwork.util;
 
 import com.opensymphony.util.TextUtils;
+
 import com.opensymphony.xwork.util.OgnlValueStack;
 
 import org.apache.commons.logging.Log;
         return writer.toString();
     }
 
+    public Object findString(String name) {
+        return stack.findValue(name, String.class);
+    }
+
     public String htmlEncode(Object obj) {
         if (obj == null) {
             return null;
         return TextUtils.htmlEncode(obj.toString());
     }
 
-    public Object findString(String name) {
-        return stack.findValue(name, String.class);
-    }
-
     public String include(Object aName, ServletRequest aRequest, ServletResponse aResponse) throws Exception {
         try {
             RequestDispatcher dispatcher = aRequest.getRequestDispatcher(aName.toString());

src/java/com/opensymphony/webwork/views/jsp/I18nTag.java

 package com.opensymphony.webwork.views.jsp;
 
 import com.opensymphony.xwork.ActionContext;
-import com.opensymphony.xwork.TextProviderSupport;
 import com.opensymphony.xwork.LocaleProvider;
+import com.opensymphony.xwork.TextProviderSupport;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
 
 import org.apache.commons.logging.*;
 
+import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
-import java.util.List;
 
 import javax.servlet.jsp.JspException;
 
             if (bundle != null) {
                 final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
                 getStack().push(new TextProviderSupport(bundle, new LocaleProvider() {
-                    public Locale getLocale() {
-                        return locale;
-                    }
-                }));
+                        public Locale getLocale() {
+                            return locale;
+                        }
+                    }));
             }
         } catch (Exception e) {
             LogFactory.getLog(getClass()).error("Could not find the bundle " + nameAttr, e);

src/java/com/opensymphony/webwork/views/jsp/IncludeTag.java

     // Public --------------------------------------------------------
 
     /**
- * Name of page/servlet to include.
- *
- * @param   aPage
- * @deprecated use value attribute instead
- */
+    * Name of page/servlet to include.
+    *
+    * @param   aPage
+    * @deprecated use value attribute instead
+    */
     public void setPage(String aPage) {
         pageAttr = aPage;
     }
 
     /* (non-Javadoc)
- * @see com.opensymphony.webwork.views.jsp.ParameterizedTag#getParams()
- */
+    * @see com.opensymphony.webwork.views.jsp.ParameterizedTag#getParams()
+    */
     public Map getParams() {
         return params;
     }
 
     /**
- * Name of property whose value is the name of the page/servlet to include.
- *
- * @param   aName
- */
+    * Name of property whose value is the name of the page/servlet to include.
+    *
+    * @param   aName
+    */
     public void setValue(String aName) {
         valueAttr = aName;
     }
     // ParamTag.Parametric implementation ----------------------------
 
     /**
- * Add a parameter to the URL of the included page/servlet.
- *
- * @param   name
- * @param   value
- */
+    * Add a parameter to the URL of the included page/servlet.
+    *
+    * @param   name
+    * @param   value
+    */
     public void addParam(String name, Object value) {
         if (value != null) {
             List currentValues = (List) params.get(name);
     }
 
     /**
- * Get the encoding specified by the property 'webwork.i18n.encoding' in webwork.properties,
- * or return the default platform encoding if not specified.
- * <p>
- * Note that if the property is not initially defined, this will return the system default,
- * even if the property is later defined.  This is mainly for performance reasons.  Undefined
- * properties throw exceptions, which are a costly operation.
- * <p>
- * If the property is initially defined, it is read every time, until is is undefined, and then
- * the system default is used.
- * <p>
- * Why not cache it completely?  Some applications will wish to be able to dynamically set the
- * encoding at runtime.
- *
- * @return  The encoding to be used.
- */
+    * Get the encoding specified by the property 'webwork.i18n.encoding' in webwork.properties,
+    * or return the default platform encoding if not specified.
+    * <p>
+    * Note that if the property is not initially defined, this will return the system default,
+    * even if the property is later defined.  This is mainly for performance reasons.  Undefined
+    * properties throw exceptions, which are a costly operation.
+    * <p>
+    * If the property is initially defined, it is read every time, until is is undefined, and then
+    * the system default is used.
+    * <p>
+    * Why not cache it completely?  Some applications will wish to be able to dynamically set the
+    * encoding at runtime.
+    *
+    * @return  The encoding to be used.
+    */
     private static String getEncoding() {
         if (encodingDefined) {
             try {
     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
- * Return the content buffered inside the {@link com.opensymphony.webwork.views.jsp.PageOutputStream}.
- * @return
- * @throws IOException
- */
+    * Return the content buffered inside the {@link com.opensymphony.webwork.views.jsp.PageOutputStream}.
+    * @return
+    * @throws IOException
+    */
     public FastByteArrayOutputStream getContent() throws IOException {
         //if we are using a writer, we need to flush the
         //data to the underlying outputstream.
     }
 
     /**
- * Return instance of {@link com.opensymphony.webwork.views.jsp.PageOutputStream}
- * allowing all data written to stream to be stored in temporary buffer.
- */
+    * Return instance of {@link com.opensymphony.webwork.views.jsp.PageOutputStream}
+    * allowing all data written to stream to be stored in temporary buffer.
+    */
     public ServletOutputStream getOutputStream() throws IOException {
         if (pageOutputStream == null) {
             pageOutputStream = new PageOutputStream();

src/java/com/opensymphony/webwork/views/jsp/TagUtils.java

 package com.opensymphony.webwork.views.jsp;
 
 import com.opensymphony.webwork.ServletActionContext;
-import com.opensymphony.webwork.util.AttributeMap;
 import com.opensymphony.webwork.dispatcher.ApplicationMap;
 import com.opensymphony.webwork.dispatcher.RequestMap;
 import com.opensymphony.webwork.dispatcher.ServletDispatcher;
 import com.opensymphony.webwork.dispatcher.SessionMap;
+import com.opensymphony.webwork.util.AttributeMap;
 
-import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.ActionContext;
+import com.opensymphony.xwork.util.OgnlValueStack;
 
 import java.util.Map;
 
             // let's make sure that the current page context is in the action context
             Map context = stack.getContext();
             context.put(ServletActionContext.PAGE_CONTEXT, pageContext);
+
             AttributeMap attrMap = new AttributeMap(context);
             context.put("attr", attrMap);
         }

src/java/com/opensymphony/webwork/views/jsp/ui/AbstractListTag.java

         if (listAttr != null) {
             Object value = findValue(listAttr);
             addParam("list", MakeIterator.convert(value));
+
             if (value instanceof Collection) {
                 addParam("listSize", new Integer(((Collection) value).size()));
             }

src/java/com/opensymphony/webwork/views/jsp/ui/CheckboxTag.java

     //~ Static fields/initializers /////////////////////////////////////////////
 
     /**
- * The name of the default template for the CheckboxTag
- */
+    * The name of the default template for the CheckboxTag
+    */
     final public static String TEMPLATE = "checkbox.vm";
 
     //~ Instance fields ////////////////////////////////////////////////////////

src/java/com/opensymphony/webwork/views/jsp/ui/TabbedPaneTag.java

  */
 package com.opensymphony.webwork.views.jsp.ui;
 
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspTagException;
-import javax.servlet.jsp.PageContext;
+import com.opensymphony.webwork.util.TabbedPane;
+import com.opensymphony.webwork.views.jsp.ui.ComponentTag;
 
 import java.util.Map;
 import java.util.Vector;
 
-import com.opensymphony.webwork.views.jsp.ui.ComponentTag;
-import com.opensymphony.webwork.util.TabbedPane;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspTagException;
+import javax.servlet.jsp.PageContext;
+
 
 /**
- *	TabbedPane tag.
- *	@author Onyeje Bose (digi9ten@yahoo.com)
- *	@version $Revision$
+ *        TabbedPane tag.
+ *        @author Onyeje Bose (digi9ten@yahoo.com)
+ *        @version $Revision$
  */
-
 public class TabbedPaneTag extends ComponentTag {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
     private final static String TEMPLATE = "tabbedpane.vm";
 
-    // Protected --------------------------------------------------------
-    protected TabbedPane tabPane;
-    protected String contentName;
+    //~ Instance fields ////////////////////////////////////////////////////////
 
-    protected String strVal(String objName) {
-        try {
-            return String.valueOf(findValue(objName));
-        } catch (Exception e) {
-            return objName;
-        }
-    }
+    protected String contentName;
 
-    protected String getDefaultTemplate() {
-        return TEMPLATE;
-    }
+    // Protected --------------------------------------------------------
+    protected TabbedPane tabPane;
 
-    public String getSelectedUrl() {
-        Map.Entry me = (Map.Entry) this.getContent().elementAt(this.getSelectedIndex());
-        return me.getValue().toString();
-    }
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public int getColSpanLength() {
-        return (this.getTabAlign().compareToIgnoreCase("CENTER") == 0 ? this.getContent().size() + 2 : this.getContent().size() + 1);
+        return ((this.getTabAlign().compareToIgnoreCase("CENTER") == 0) ? (this.getContent().size() + 2) : (this.getContent().size() + 1));
     }
 
-    public String getIndexLink() {
-        return ("TABBEDPANE_" + getId() + "_INDEX");
+    public void setContent(java.util.Vector content) {
+        tabPane.setContent(content);
     }
 
-    public String getContentName() {
-        return this.contentName;
+    public java.util.Vector getContent() {
+        return tabPane.getContent();
     }
 
     public void setContentName(String contentName) {
         this.contentName = strVal(contentName);
 
         Object obj = findValue(this.contentName);
-        if (obj instanceof Vector)
+
+        if (obj instanceof Vector) {
             this.setContent((Vector) obj);
+        }
     }
 
-    public int getSelectedIndex() {
-        return tabPane.getSelectedIndex();
+    public String getContentName() {
+        return this.contentName;
+    }
+
+    public String getIndexLink() {
+        return ("TABBEDPANE_" + getId() + "_INDEX");
+    }
+
+    // BodyTagSupport overrides --------------------------------------
+    public void setPageContext(PageContext aPageContext) {
+        tabPane = new TabbedPane(0);
+        contentName = null;
+        setSelectedIndex(0);
+        setTabAlign("'CENTER'");
+
+        super.setPageContext(aPageContext);
     }
 
     public void setSelectedIndex(int selectedIndex) {
         tabPane.setSelectedIndex(selectedIndex);
     }
 
-    public java.util.Vector getContent() {
-        return tabPane.getContent();
+    public int getSelectedIndex() {
+        return tabPane.getSelectedIndex();
     }
 
-    public void setContent(java.util.Vector content) {
-        tabPane.setContent(content);
-    }
+    public String getSelectedUrl() {
+        Map.Entry me = (Map.Entry) this.getContent().elementAt(this.getSelectedIndex());
 
-    public String getTabAlign() {
-        return tabPane.getTabAlign();
+        return me.getValue().toString();
     }
 
     public void setTabAlign(String tabAlign) {
         tabPane.setTabAlign(strVal(tabAlign));
     }
 
-    // BodyTagSupport overrides --------------------------------------
-    public void setPageContext(PageContext aPageContext) {
-        tabPane = new TabbedPane(0);
-        contentName = null;
-        setSelectedIndex(0);
-        setTabAlign("'CENTER'");
+    public String getTabAlign() {
+        return tabPane.getTabAlign();
+    }
 
-        super.setPageContext(aPageContext);
+    public boolean compareNumbers(Number n1, Number n2) {
+        return n1.longValue() == n2.longValue();
     }
 
     // BodyTag implementation ----------------------------------------
     public int doStartTag() throws JspException {
         String indexStr = pageContext.getRequest().getParameter(getIndexLink());
+
         if (indexStr != null) {
             try {
                 int index = Integer.parseInt(indexStr);
-                this.setSelectedIndex((index < 0 ? 0 : index));
+                this.setSelectedIndex(((index < 0) ? 0 : index));
             } catch (Exception e) {
                 throw new JspTagException("TabbedPane Error: " + e.toString());
             }
         }
-        return super.doStartTag();
-    }
 
-    public boolean compareNumbers(Number n1, Number n2) {
-        return n1.longValue() == n2.longValue();
+        return super.doStartTag();
     }
 
     // IncludeTag overrides ------------------------------------------
     public void release() {
         this.setSelectedIndex(0);
 
-        if (this.getTabAlign() == null)
+        if (this.getTabAlign() == null) {
             this.setTabAlign("'CENTER'");
+        }
+    }
+
+    protected String getDefaultTemplate() {
+        return TEMPLATE;
+    }
+
+    protected String strVal(String objName) {
+        try {
+            return String.valueOf(findValue(objName));
+        } catch (Exception e) {
+            return objName;
+        }
     }
 }

src/java/com/opensymphony/webwork/views/jsp/ui/TextFieldTag.java

 
     public void evaluateExtraParams(OgnlValueStack stack) {
         super.evaluateExtraParams(stack);
-        
+
         if (sizeAttr != null) {
             addParam("size", findValue(sizeAttr, String.class));
         }

src/java/com/opensymphony/webwork/views/jsp/ui/TextareaTag.java

 
     public void evaluateExtraParams(OgnlValueStack stack) {
         super.evaluateExtraParams(stack);
-        
+
         if (readonlyAttr != null) {
             addParam("readonly", findValue(readonlyAttr, Boolean.class));
         }

src/java/com/opensymphony/webwork/views/jsp/ui/table/SortFilterModel.java

 
     public void addMouseListener(final JTable table) {
         table.getTableHeader().addMouseListener(new MouseAdapter() {
-            public void mouseClicked(MouseEvent event) {
-                // check for double click
-                if (event.getClickCount() < 2) {
-                    return;
+                public void mouseClicked(MouseEvent event) {
+                    // check for double click
+                    if (event.getClickCount() < 2) {
+                        return;
+                    }
+
+                    // find column of click and
+                    int tableColumn = table.columnAtPoint(event.getPoint());
+
+                    // translate to table model index and sort
+                    int modelColumn = table.convertColumnIndexToModel(tableColumn);
+                    sort(modelColumn);
                 }
-
-                // find column of click and
-                int tableColumn = table.columnAtPoint(event.getPoint());
-
-                // translate to table model index and sort
-                int modelColumn = table.convertColumnIndexToModel(tableColumn);
-                sort(modelColumn);
-            }
-        });
+            });
     }
 
     public void removeRow(int rowNum) throws ArrayIndexOutOfBoundsException, IllegalStateException {

src/java/com/opensymphony/webwork/views/jsp/ui/table/WebTable.java

 import com.opensymphony.webwork.views.jsp.ui.ComponentTag;
 import com.opensymphony.webwork.views.jsp.ui.table.renderer.CellRenderer;
 
+import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.util.OgnlUtil;
 import com.opensymphony.xwork.util.OgnlValueStack;
-import com.opensymphony.xwork.ActionContext;
 
 import org.apache.commons.logging.LogFactory;
 
      * The name of the default template for the CheckboxTag
      */
     final public static String TEMPLATE = "table.vm";
+
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    protected String modelNameAttr = null;
     protected String _sortOrder = SortableTableModel.NONE;
+    protected String modelNameAttr = null;
     protected TableModel model = null;
     protected WebTableColumn[] _columns = null;
     protected boolean sortableAttr = false;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    protected String getDefaultTemplate() {
-        return TEMPLATE;
-    }
-
-
     public WebTableColumn getColumn(int index) {
         try {
             return (_columns[index]);
         super.addParam(name, value);
     }
 
-
-    protected void evaluateExtraParams(OgnlValueStack stack) {
-        if(modelNameAttr != null) {
-            modelNameAttr = (String) stack.findValue(modelNameAttr);
-
-            Object obj = stack.findValue(this.modelNameAttr);
-
-            if (obj instanceof TableModel) {
-                setModel((TableModel) obj);
-            }
-        }
-
-        // evaluate all the parameters for the webtable
-        Map params = getParams();
-        Set set = params.keySet();
-        for (Iterator iterator = set.iterator(); iterator.hasNext();) {
-            String key = (String) iterator.next();
-            Object value = params.get(key);
-            OgnlUtil.setProperty(key, value, this, ActionContext.getContext().getContextMap());
-        }
-
-        super.evaluateExtraParams(stack);    //To change body of overriden methods use Options | File Templates.
-    }
-
-
-
-
-
     public int doEndTag() throws JspException {
         if (sortableAttr && model instanceof SortableTableModel) {
             LogFactory.getLog(this.getClass()).debug("we are looking for " + getSortColumnLinkName());
         return super.doEndTag();
     }
 
+    protected String getDefaultTemplate() {
+        return TEMPLATE;
+    }
+
     protected int getNumberOfVisibleColumns() {
         int count = 0;
 
         return count;
     }
 
+    protected void evaluateExtraParams(OgnlValueStack stack) {
+        if (modelNameAttr != null) {
+            modelNameAttr = (String) stack.findValue(modelNameAttr);
+
+            Object obj = stack.findValue(this.modelNameAttr);
+
+            if (obj instanceof TableModel) {
+                setModel((TableModel) obj);
+            }
+        }
+
+        // evaluate all the parameters for the webtable
+        Map params = getParams();
+        Set set = params.keySet();
+
+        for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+            String key = (String) iterator.next();
+            Object value = params.get(key);
+            OgnlUtil.setProperty(key, value, this, ActionContext.getContext().getContextMap());
+        }
+
+        super.evaluateExtraParams(stack); //To change body of overriden methods use Options | File Templates.
+    }
+
     //~ Inner Classes //////////////////////////////////////////////////////////
 
     /**
- * inner class to iteratoe over a row of the table.
- * It can return formatted data, using the columnRenderer
- * for the column or it can return the raw data.
- */
+    * inner class to iteratoe over a row of the table.
+    * It can return formatted data, using the columnRenderer
+    * for the column or it can return the raw data.
+    */
     public class WebTableRowIterator implements Iterator {
         public static final int FORMATTED_DATA = 0;
         public static final int RAW_DATA = 1;

src/java/com/opensymphony/webwork/views/jsp/ui/table/renderer/NumericCellRenderer.java

     DecimalFormat _formater = new DecimalFormat();
 
     /**
- * this is the format string that DecimalFormat would use.
- * @see DecimalFormat
- */
+    * this is the format string that DecimalFormat would use.
+    * @see DecimalFormat
+    */
     String _formatString = null;
 
     /**
- * if set the is the color to use if Number is negative.
- */
+    * if set the is the color to use if Number is negative.
+    */
     String _negativeColor = null;
 
     /**
- * if set this is the color to render if number is positive
- */
+    * if set this is the color to render if number is positive
+    */
     String _positiveColor = null;
 
     //~ Constructors ///////////////////////////////////////////////////////////

src/java/com/opensymphony/webwork/views/jsp/vui/FilledTag.java

  */
 package com.opensymphony.webwork.views.jsp.vui;
 
+import com.opensymphony.webwork.views.util.UrlHelper;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import com.opensymphony.webwork.views.util.UrlHelper;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

src/java/com/opensymphony/webwork/views/velocity/BodyTagDirective.java

         Map propertyMap = new HashMap();
 
         for (int index = 1, length = node.jjtGetNumChildren() - 1;
-             index < length; index++) {
+                index < length; index++) {
             this.putProperty(propertyMap, contextAdapter, node.jjtGetChild(index));
         }
 

src/java/com/opensymphony/webwork/views/velocity/WebWorkVelocityContext.java

 public class WebWorkVelocityContext extends VelocityContext {
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    VelocityContext[] chainedContexts;
     OgnlValueStack stack;
+    VelocityContext[] chainedContexts;
 
     //~ Constructors ///////////////////////////////////////////////////////////
 
         // still no luck?  let's look against the value stack
         if (stack != null) {
             Object object = stack.findValue(key);
+
             if (object != null) {
                 return object;
             }

src/test/com/opensymphony/webwork/dispatcher/ChartResultTest.java

 /*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+/*
  * Created on Nov 10, 2003
- * 
+ *
  * To change the template for this generated file go to Window - Preferences -
  * Java - Code Generation - Code and Comments
  */
 package com.opensymphony.webwork.dispatcher;
 
-import java.io.IOException;
+import com.mockobjects.dynamic.Mock;
 
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
+import com.opensymphony.webwork.ServletActionContext;
+import com.opensymphony.webwork.dispatcher.ChartResult;
+
+import com.opensymphony.xwork.ActionContext;
+import com.opensymphony.xwork.ActionInvocation;
 
 import junit.framework.TestCase;
+
 import ognl.Ognl;
 
 import org.jfree.chart.ChartFactory;
 import org.jfree.chart.JFreeChart;
+
 import org.jfree.data.DefaultPieDataset;
 
-import com.mockobjects.dynamic.Mock;
-import com.opensymphony.webwork.ServletActionContext;
-import com.opensymphony.webwork.dispatcher.ChartResult;
-import com.opensymphony.xwork.ActionContext;
-import com.opensymphony.xwork.ActionInvocation;
+import java.io.IOException;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
 
 /**
  * @author bchoi
- * 
+ *
  * To change the template for this generated type comment go to Window -
  * Preferences - Java - Code Generation - Code and Comments
  */
 public class ChartResultTest extends TestCase {
-
-    private JFreeChart mockChart;
+    //~ Instance fields ////////////////////////////////////////////////////////
 
     private ActionInvocation actionInvocation;
-    private MockServletOutputStream os;
+    private JFreeChart mockChart;
     private Mock responseMock;
+    private MockServletOutputStream os;
 
-    protected void setUp() throws Exception {
-        DefaultPieDataset data = new DefaultPieDataset();
-        data.setValue("Java", new Double(43.2));
-        data.setValue("Visual Basic", new Double(0.0));
-        data.setValue("C/C++", new Double(17.5));
-        mockChart = ChartFactory.createPieChart("Pie Chart", data, true, true, false);
+    //~ Methods ////////////////////////////////////////////////////////////////
 
-        Mock mockActionInvocation = new Mock(ActionInvocation.class);
-        actionInvocation = (ActionInvocation) mockActionInvocation.proxy();
-        os = new MockServletOutputStream();
-        responseMock = new Mock(HttpServletResponse.class);
+    public void testChart() throws Exception {
+        responseMock.expectAndReturn("getOutputStream", os);
 
-        ActionContext.setContext(
-                new ActionContext(Ognl.createDefaultContext(null)));
-        ServletActionContext.setResponse(
-                (HttpServletResponse) responseMock.proxy());
-    }
+        ChartResult result = new ChartResult();
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see junit.framework.TestCase#tearDown()
-     */
-    protected void tearDown() throws Exception {
-        actionInvocation = null;
-        os = null;
-        responseMock = null;
+        result.setChart(mockChart);
+
+        result.setHeight(10);
+        result.setWidth(10);
+        result.execute(actionInvocation);
+
+        responseMock.verify();
+        assertTrue(os.isWritten());
     }
 
     public void testChartNotSet() {
         assertFalse(os.isWritten());
     }
 
-    public void testChart() throws Exception {
-        responseMock.expectAndReturn("getOutputStream", os);
-
-        ChartResult result = new ChartResult();
+    protected void setUp() throws Exception {
+        DefaultPieDataset data = new DefaultPieDataset();
+        data.setValue("Java", new Double(43.2));
+        data.setValue("Visual Basic", new Double(0.0));
+        data.setValue("C/C++", new Double(17.5));
+        mockChart = ChartFactory.createPieChart("Pie Chart", data, true, true, false);
 
-        result.setChart(mockChart);
+        Mock mockActionInvocation = new Mock(ActionInvocation.class);
+        actionInvocation = (ActionInvocation) mockActionInvocation.proxy();
+        os = new MockServletOutputStream();
+        responseMock = new Mock(HttpServletResponse.class);
 
-        result.setHeight(10);
-        result.setWidth(10);
-        result.execute(actionInvocation);
+        ActionContext.setContext(new ActionContext(Ognl.createDefaultContext(null)));
+        ServletActionContext.setResponse((HttpServletResponse) responseMock.proxy());
+    }
 
-        responseMock.verify();
-        assertTrue(os.isWritten());
+    /*
+     * (non-Javadoc)
+     *
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        actionInvocation = null;
+        os = null;
+        responseMock = null;
     }
 
+    //~ Inner Classes //////////////////////////////////////////////////////////
+
     private class MockServletOutputStream extends ServletOutputStream {
         // very simple check that outputStream was written to.
         private boolean written = false;
 
-        public void write(int arg0) throws IOException {
-            written = true;
-        }
-
         /**
          * @return Returns the written.
          */
             return written;
         }
 
+        public void write(int arg0) throws IOException {
+            written = true;
+        }
     }
 }

src/test/com/opensymphony/webwork/dispatcher/HttpHeaderResultTest.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.dispatcher;
 
-import junit.framework.TestCase;
+import com.mockobjects.dynamic.C;
+import com.mockobjects.dynamic.Mock;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import com.opensymphony.webwork.ServletActionContext;
 
-import com.mockobjects.dynamic.Mock;
-import com.mockobjects.dynamic.C;
-import com.opensymphony.xwork.ActionInvocation;
 import com.opensymphony.xwork.ActionContext;
+import com.opensymphony.xwork.ActionInvocation;
 import com.opensymphony.xwork.util.OgnlUtil;
 import com.opensymphony.xwork.util.OgnlValueStack;
-import com.opensymphony.webwork.ServletActionContext;
 
-import java.util.Map;
+import junit.framework.TestCase;
+
 import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 
 /**
  * HttpHeaderResultTest
  * Date: Nov 16, 2003 1:08:20 AM
  */
 public class HttpHeaderResultTest extends TestCase {
-    Mock responseMock;
-    HttpServletResponse response;
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     ActionInvocation invocation;
     HttpHeaderResult result;
+    HttpServletResponse response;
+    Mock responseMock;
 
-    protected void setUp() throws Exception {
-        super.setUp();
-        result = new HttpHeaderResult();
-        responseMock = new Mock(HttpServletResponse.class);
-        response = (HttpServletResponse) responseMock.proxy();
-        invocation = (ActionInvocation) new Mock(ActionInvocation.class).proxy();
-        ServletActionContext.setResponse(response);
-    }
-
-    public void testStatusIsSet() throws Exception {
-        responseMock.expect("setStatus", C.eq(123));
-        result.setStatus(123);
-        result.execute(invocation);
-        responseMock.verify();
-    }
+    //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void testHeaderValuesAreParsedAndSet() throws Exception {
+    public void testHeaderValuesAreNotParsedWhenParseIsFalse() throws Exception {
         Map params = new HashMap();
         params.put("headers.foo", "${bar}");
         params.put("headers.baz", "baz");
 
         OgnlUtil.setProperties(params, result);
 
-        responseMock.expect("addHeader", C.args(C.eq("foo"), C.eq("abc")));
+        responseMock.expect("addHeader", C.args(C.eq("foo"), C.eq("${bar}")));
         responseMock.expect("addHeader", C.args(C.eq("baz"), C.eq("baz")));
+        result.setParse(false);
         result.execute(invocation);
         responseMock.verify();
     }
 
-    public void testHeaderValuesAreNotParsedWhenParseIsFalse() throws Exception {
+    public void testHeaderValuesAreParsedAndSet() throws Exception {
         Map params = new HashMap();
         params.put("headers.foo", "${bar}");
         params.put("headers.baz", "baz");
 
         OgnlUtil.setProperties(params, result);
 
-        responseMock.expect("addHeader", C.args(C.eq("foo"), C.eq("${bar}")));
+        responseMock.expect("addHeader", C.args(C.eq("foo"), C.eq("abc")));
         responseMock.expect("addHeader", C.args(C.eq("baz"), C.eq("baz")));
-        result.setParse(false);
         result.execute(invocation);
         responseMock.verify();
     }
 
+    public void testStatusIsSet() throws Exception {
+        responseMock.expect("setStatus", C.eq(123));
+        result.setStatus(123);
+        result.execute(invocation);
+        responseMock.verify();
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        result = new HttpHeaderResult();
+        responseMock = new Mock(HttpServletResponse.class);
+        response = (HttpServletResponse) responseMock.proxy();
+        invocation = (ActionInvocation) new Mock(ActionInvocation.class).proxy();
+        ServletActionContext.setResponse(response);
+    }
+
     protected void tearDown() throws Exception {
         super.tearDown();
         ServletActionContext.setResponse(null);

src/test/com/opensymphony/webwork/dispatcher/SessionMapTest.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.dispatcher;
 
-import com.mockobjects.constraint.IsEqual;
 import com.mockobjects.constraint.Constraint;
 import com.mockobjects.constraint.IsAnything;
+import com.mockobjects.constraint.IsEqual;
+
 import com.mockobjects.dynamic.Mock;
 
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpServletRequest;
+import junit.framework.TestCase;
+
 import java.util.HashMap;
 import java.util.Map;
 
-import junit.framework.TestCase;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
 
 /**
  * @author Robert Dawson (robert@rojotek.com)
  */
 public class SessionMapTest extends TestCase {
-    private Mock sessionMock;
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     private Mock requestMock;
+    private Mock sessionMock;
 
-    protected void setUp() throws Exception {
-        sessionMock = new Mock(HttpSession.class);