Commits

plightbo  committed 7a7c9af

jalopy formatting, beta 2 release!

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

  • Participants
  • Parent commits e5c48c0

Comments (0)

Files changed (22)

File build.properties

 name=webwork
-version=2.0-beta
+version=2.0-beta2
     <property name="lib.core" value="${lib}/core"/>
     <property name="lib.build" value="${lib}/build"/>
     <property name="lib.optional" value="${lib}/optional"/>
+    <property name="lib.migration" value="${lib}/migration"/>
     <property name="lib.example" value="${lib}/example"/>
 
     <property name="src" value="src"/>
 
     <target name="dist" depends="jar, migration, example-war, docs">
         <copy file="${build}/${name}-${version}.jar" todir="${build.dist}"/>
+        <copy file="${build.migration.jar}" todir="${build.dist}"/>
         <copy file="${build}/${name}-example.war" todir="${build.dist}"/>
         <copy todir="${build.dist}/src">
             <fileset dir="${src.java}"/>
         </copy>
+
+        <mkdir dir="${build.dist}/lib/core"/>
+        <copy todir="${build.dist}/lib/core">
+            <fileset dir="${lib.core}"/>
+        </copy>
+
+        <mkdir dir="${build.dist}/lib/example"/>
+        <copy todir="${build.dist}/lib/example">
+            <fileset dir="${lib.example}"/>
+        </copy>
+
+        <mkdir dir="${build.dist}/lib/migration"/>
+        <copy todir="${build.dist}/lib/migration">
+            <fileset dir="${lib.migration}"/>
+        </copy>
+
+        <mkdir dir="${build.dist}/lib/optional"/>
+        <copy todir="${build.dist}/lib/optional">
+            <fileset dir="${lib.optional}"/>
+        </copy>
+
         <zip zipfile="${build}/${name}-${version}.zip" basedir="${build.dist}"/>
     </target>
 </project>

File src/java/com/opensymphony/webwork/dispatcher/ChartResult.java

 /*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+/*
  * Created on Sep 20, 2003
  *
  * To change the template for this generated file go to
  */
 package com.opensymphony.webwork.dispatcher;
 
-import java.io.OutputStream;
+import com.opensymphony.webwork.ServletActionContext;
 
-import javax.servlet.http.HttpServletResponse;
+import com.opensymphony.xwork.ActionInvocation;
+import com.opensymphony.xwork.Result;
 
 import org.jfree.chart.ChartUtilities;
 import org.jfree.chart.JFreeChart;
 
-import com.opensymphony.webwork.ServletActionContext;
-import com.opensymphony.xwork.ActionInvocation;
-import com.opensymphony.xwork.Result;
+import java.io.OutputStream;
+
+import javax.servlet.http.HttpServletResponse;
+
 
 /**
  * @author bchoi
  * Window - Preferences - Java - Code Generation - Code and Comments
  */
 public class ChartResult implements Result {
+    //~ Instance fields ////////////////////////////////////////////////////////
 
-    private int width;
-    private int height;
-    boolean chartSet = false;
     JFreeChart chart;
+    boolean chartSet = false;
+    private int height;
+    private int width;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setChart(JFreeChart chart) {
+        this.chart = chart;
+        chartSet = true;
+    }
+
+    public void setHeight(int height) {
+        this.height = height;
+    }
+
+    public void setWidth(int width) {
+        this.width = width;
+    }
 
     public void execute(ActionInvocation invocation) throws Exception {
         JFreeChart chart = null;
+
         if (chartSet) {
             chart = this.chart;
         } else {
         ChartUtilities.writeChartAsPNG(os, chart, width, height);
         os.flush();
     }
-
-    public void setHeight(int height) {
-        this.height = height;
-    }
-
-    public void setWidth(int width) {
-        this.width = width;
-    }
-
-    public void setChart(JFreeChart chart) {
-        this.chart = chart;
-        chartSet = true;
-    }
 }

File src/java/com/opensymphony/webwork/dispatcher/RequestMap.java

 
     public RequestMap(final HttpServletRequest request) {
         for (Enumeration attrNames = request.getAttributeNames();
-             attrNames.hasMoreElements();) {
+                attrNames.hasMoreElements();) {
             final String attrName = (String) attrNames.nextElement();
             entrySet.add(new Map.Entry() {
-                public Object getKey() {
-                    return attrName;
-                }
+                    public Object getKey() {
+                        return attrName;
+                    }
+
+                    public Object getValue() {
+                        return request.getAttribute(attrName);
+                    }
 
-                public Object getValue() {
-                    return request.getAttribute(attrName);
-                }
+                    public Object setValue(Object value) {
+                        request.setAttribute(attrName, value);
 
-                public Object setValue(Object value) {
-                    request.setAttribute(attrName, value);
+                        return value;
+                    }
 
-                    return value;
-                }
+                    public int hashCode() {
+                        return ((getKey() == null) ? 0 : getKey().hashCode()) ^ ((getValue() == null) ? 0 : getValue().hashCode());
+                    }
 
-                public int hashCode() {
-                    return (getKey() == null ? 0 : getKey().hashCode()) ^
-                            (getValue() == null ? 0 : getValue().hashCode());
-                }
+                    public boolean equals(Object obj) {
+                        if ((obj != null) && obj instanceof Entry) {
+                            Entry me = (Entry) obj;
 
-                public boolean equals(Object obj) {
-                    if ((obj != null) && obj instanceof Entry) {
-                        Entry me = (Entry) obj;
+                            return me.getKey().equals(getKey()) && me.getValue().equals(getValue());
+                        }
 
-                        return me.getKey().equals(getKey()) && me.getValue().equals(getValue());
+                        return false;
                     }
-
-                    return false;
-                }
-            });
+                });
         }
     }
 

File 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("/");

File 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 + ")");
 

File src/java/com/opensymphony/webwork/util/DateFormatter.java

 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+
 import java.util.Date;
 
+
 /**
- *	A bean that can be used to format dates
- *      
- *	@author Rickard �berg (rickard@middleware-company.com)
- *	@version $Revision$
+ *        A bean that can be used to format dates
+ *
+ *        @author Rickard �berg (rickard@middleware-company.com)
+ *        @version $Revision$
  */
 public class DateFormatter {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    Date date;
+    DateFormat format;
+
     // Attributes ----------------------------------------------------
     DateFormat parser;
-    DateFormat format;
-    Date date;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
 
     // Public --------------------------------------------------------
     public DateFormatter() {
         this.date = new Date();
     }
 
-    public void setFormat(String format) {
-        this.format = new SimpleDateFormat(format);
-    }
-
-    public void setParseFormat(String format) {
-        this.parser = new SimpleDateFormat(format);
-    }
-
-    public String getFormattedDate() {
-        return format.format(date);
-    }
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public void setDate(String date) {
         try {
         return this.date;
     }
 
-    public void setTime(long time) {
-        date.setTime(time);
+    public void setFormat(String format) {
+        this.format = new SimpleDateFormat(format);
+    }
+
+    public void setFormat(DateFormat format) {
+        this.format = format;
+    }
+
+    public String getFormattedDate() {
+        return format.format(date);
+    }
+
+    public void setParseFormat(String format) {
+        this.parser = new SimpleDateFormat(format);
     }
 
     public void setParser(DateFormat parser) {
         this.parser = parser;
     }
 
-    public void setFormat(DateFormat format) {
-        this.format = format;
+    public void setTime(long time) {
+        date.setTime(time);
     }
 }

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

  */
 package com.opensymphony.webwork.util;
 
-import javax.servlet.jsp.JspWriter;
 import java.io.*;
-import java.util.LinkedList;
+
 import java.util.Iterator;
+import java.util.LinkedList;
+
+import javax.servlet.jsp.JspWriter;
+
 
 /**
  * A speedy implementation of ByteArrayOutputStream. It's not synchronized, and it
  * @author Rickard �berg
  * @version $Revision$
  */
-public class FastByteArrayOutputStream
-        extends OutputStream {
+public class FastByteArrayOutputStream extends OutputStream {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
     // Static --------------------------------------------------------
     private static final int DEFAULT_BLOCK_SIZE = 8192;
 
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private LinkedList buffers;
+
     // Attributes ----------------------------------------------------
     // internal buffer
     private byte[] buffer;
-    private LinkedList buffers;
-    private int index;
-    private int size;
-    private int blockSize;
+
     // is the stream closed?
     private boolean closed;
+    private int blockSize;
+    private int index;
+    private int size;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
 
     // Constructors --------------------------------------------------
     public FastByteArrayOutputStream() {
         buffer = new byte[blockSize];
     }
 
-    // Public
-    public void writeTo(OutputStream out) throws IOException {
-        // Check if we have a list of buffers
-        if (buffers != null) {
-            Iterator enum = buffers.iterator();
-            while (enum.hasNext()) {
-                byte[] bytes = (byte[]) enum.next();
-                out.write(bytes, 0, blockSize);
-            }
-        }
-
-        // write the internal buffer directly
-        out.write(buffer, 0, index);
-    }
-
-    public void writeTo(RandomAccessFile out) throws IOException {
-        // Check if we have a list of buffers
-        if (buffers != null) {
-            Iterator enum = buffers.iterator();
-            while (enum.hasNext()) {
-                byte[] bytes = (byte[]) enum.next();
-                out.write(bytes, 0, blockSize);
-            }
-        }
-
-        // write the internal buffer directly
-        out.write(buffer, 0, index);
-    }
-
-    public void writeTo(JspWriter out, String encoding) throws IOException {
-        // Check if we have a list of buffers
-        if (buffers != null) {
-            Iterator enum = buffers.iterator();
-            while (enum.hasNext()) {
-                byte[] bytes = (byte[]) enum.next();
-
-                if (encoding != null)
-                    out.write(new String(bytes, encoding));
-                else
-                    out.write(new String(bytes));
-            }
-        }
-
-        // write the internal buffer directly
-        if (encoding != null)
-            out.write(new String(buffer, 0, index, encoding));
-        else
-            out.write(new String(buffer, 0, index));
-    }
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public int getSize() {
         return size + index;
     }
 
+    public void close() {
+        closed = true;
+    }
+
     public byte[] toByteArray() {
         byte[] data = new byte[getSize()];
 
         // Check if we have a list of buffers
         int pos = 0;
+
         if (buffers != null) {
             Iterator enum = buffers.iterator();
+
             while (enum.hasNext()) {
                 byte[] bytes = (byte[]) enum.next();
                 System.arraycopy(bytes, 0, data, pos, blockSize);
         return new String(toByteArray());
     }
 
-    /**
-     * Create a new buffer and store the
-     * current one in linked list
-     */
-    protected void addBuffer() {
-        if (buffers == null)
-            buffers = new LinkedList();
-
-        buffers.addLast(buffer);
-
-        buffer = new byte[blockSize];
-        size += index;
-        index = 0;
-    }
-
     // OutputStream overrides ----------------------------------------
     public void write(int datum) throws IOException {
         if (closed) {
             throw new IOException("Stream closed");
         } else {
-            if (index == blockSize)
+            if (index == blockSize) {
                 addBuffer();
+            }
 
             // store the byte
             buffer[index++] = (byte) datum;
         }
     }
 
-    public void write(byte[] data, int offset, int length)
-            throws IOException {
+    public void write(byte[] data, int offset, int length) throws IOException {
         if (data == null) {
             throw new NullPointerException();
-        } else if ((offset < 0) || (offset + length > data.length)
-                || (length < 0)) {
+        } else if ((offset < 0) || ((offset + length) > data.length) || (length < 0)) {
             throw new IndexOutOfBoundsException();
         } else if (closed) {
             throw new IOException("Stream closed");
         } else {
-            if (index + length > blockSize) {
+            if ((index + length) > blockSize) {
                 int copyLength;
+
                 do {
-                    if (index == blockSize)
+                    if (index == blockSize) {
                         addBuffer();
+                    }
 
                     copyLength = blockSize - index;
-                    if (length < copyLength)
+
+                    if (length < copyLength) {
                         copyLength = length;
+                    }
+
                     System.arraycopy(data, offset, buffer, index, copyLength);
                     offset += copyLength;
                     index += copyLength;
         }
     }
 
-    public void close() {
-        closed = true;
+    // Public
+    public void writeTo(OutputStream out) throws IOException {
+        // Check if we have a list of buffers
+        if (buffers != null) {
+            Iterator enum = buffers.iterator();
+
+            while (enum.hasNext()) {
+                byte[] bytes = (byte[]) enum.next();
+                out.write(bytes, 0, blockSize);
+            }
+        }
+
+        // write the internal buffer directly
+        out.write(buffer, 0, index);
+    }
+
+    public void writeTo(RandomAccessFile out) throws IOException {
+        // Check if we have a list of buffers
+        if (buffers != null) {
+            Iterator enum = buffers.iterator();
+
+            while (enum.hasNext()) {
+                byte[] bytes = (byte[]) enum.next();
+                out.write(bytes, 0, blockSize);
+            }
+        }
+
+        // write the internal buffer directly
+        out.write(buffer, 0, index);
+    }
+
+    public void writeTo(JspWriter out, String encoding) throws IOException {
+        // Check if we have a list of buffers
+        if (buffers != null) {
+            Iterator enum = buffers.iterator();
+
+            while (enum.hasNext()) {
+                byte[] bytes = (byte[]) enum.next();
+
+                if (encoding != null) {
+                    out.write(new String(bytes, encoding));
+                } else {
+                    out.write(new String(bytes));
+                }
+            }
+        }
+
+        // write the internal buffer directly
+        if (encoding != null) {
+            out.write(new String(buffer, 0, index, encoding));
+        } else {
+            out.write(new String(buffer, 0, index));
+        }
+    }
+
+    /**
+ * Create a new buffer and store the
+ * current one in linked list
+ */
+    protected void addBuffer() {
+        if (buffers == null) {
+            buffers = new LinkedList();
+        }
+
+        buffers.addLast(buffer);
+
+        buffer = new byte[blockSize];
+        size += index;
+        index = 0;
     }
 }

File src/java/com/opensymphony/webwork/util/IteratorGenerator.java

 import com.opensymphony.xwork.Action;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
-import java.util.Iterator;
 
 
 /**

File src/java/com/opensymphony/webwork/util/SortIteratorFilter.java

  */
 package com.opensymphony.webwork.util;
 
+import com.opensymphony.xwork.Action;
+
 import org.apache.commons.logging.LogFactory;
 
 import java.util.*;
 
-import com.opensymphony.xwork.Action;
 
 /**
  *        A bean that takes an iterator and outputs a subset of it.

File src/java/com/opensymphony/webwork/util/Sorter.java

 
 import java.util.Comparator;
 
+
 /**
- *	Sorters. Utility sorters for use with the "sort" tag.
+ *        Sorters. Utility sorters for use with the "sort" tag.
  *
- *	@see com.opensymphony.webwork.views.jsp.iterator.SortIteratorTag
- *	@see SortIteratorFilter
- *	@author Rickard �berg (rickard@middleware-company.com)
- *	@version $Revision$
+ *        @see com.opensymphony.webwork.views.jsp.iterator.SortIteratorTag
+ *        @see SortIteratorFilter
+ *        @author Rickard �berg (rickard@middleware-company.com)
+ *        @version $Revision$
  */
 public class Sorter {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
     public Comparator getAscending() {
         return new Comparator() {
-            public int compare(Object o1, Object o2) {
-                if (o1 instanceof Comparable) {
-                    return ((Comparable) o1).compareTo(o2);
-                } else {
-                    String s1 = o1.toString();
-                    String s2 = o2.toString();
-                    return s1.compareTo(s2);
+                public int compare(Object o1, Object o2) {
+                    if (o1 instanceof Comparable) {
+                        return ((Comparable) o1).compareTo(o2);
+                    } else {
+                        String s1 = o1.toString();
+                        String s2 = o2.toString();
+
+                        return s1.compareTo(s2);
+                    }
                 }
-            }
-        };
+            };
     }
 
-    public Comparator getDescending() {
+    public Comparator getAscending(final String anExpression) {
         return new Comparator() {
-            public int compare(Object o1, Object o2) {
-                if (o2 instanceof Comparable) {
-                    return ((Comparable) o2).compareTo(o1);
-                } else {
-                    String s1 = o1.toString();
-                    String s2 = o2.toString();
-                    return s2.compareTo(s1);
+                private OgnlValueStack stack = new OgnlValueStack();
+
+                public int compare(Object o1, Object o2) {
+                    // Get value for first object
+                    stack.push(o1);
+
+                    Object v1 = stack.findValue(anExpression);
+                    stack.pop();
+
+                    // Get value for second object
+                    stack.push(o2);
+
+                    Object v2 = stack.findValue(anExpression);
+                    stack.pop();
+
+                    // Ensure non-null
+                    if (v1 == null) {
+                        v1 = "";
+                    }
+
+                    if (v2 == null) {
+                        v2 = "";
+                    }
+
+                    // Compare them
+                    if (v1 instanceof Comparable && v1.getClass().equals(v2.getClass())) {
+                        return ((Comparable) v1).compareTo(v2);
+                    } else {
+                        String s1 = v1.toString();
+                        String s2 = v2.toString();
+
+                        return s1.compareTo(s2);
+                    }
                 }
-            }
-        };
+            };
     }
 
     public Comparator getComparator(String anExpression, boolean ascending) {
-        if (ascending)
+        if (ascending) {
             return getAscending(anExpression);
-        else
+        } else {
             return getDescending(anExpression);
+        }
     }
 
-    public Comparator getAscending(final String anExpression) {
+    public Comparator getDescending() {
         return new Comparator() {
-            private OgnlValueStack stack = new OgnlValueStack();
-
-            public int compare(Object o1, Object o2) {
-                // Get value for first object
-                stack.push(o1);
-                Object v1 = stack.findValue(anExpression);
-                stack.pop();
-
-                // Get value for second object
-                stack.push(o2);
-                Object v2 = stack.findValue(anExpression);
-                stack.pop();
-
-                // Ensure non-null
-                if (v1 == null)
-                    v1 = "";
-                if (v2 == null)
-                    v2 = "";
-
-                // Compare them
-                if (v1 instanceof Comparable && v1.getClass().equals(v2.getClass())) {
-                    return ((Comparable) v1).compareTo(v2);
-                } else {
-                    String s1 = v1.toString();
-                    String s2 = v2.toString();
-                    return s1.compareTo(s2);
+                public int compare(Object o1, Object o2) {
+                    if (o2 instanceof Comparable) {
+                        return ((Comparable) o2).compareTo(o1);
+                    } else {
+                        String s1 = o1.toString();
+                        String s2 = o2.toString();
+
+                        return s2.compareTo(s1);
+                    }
                 }
-            }
-        };
+            };
     }
 
     public Comparator getDescending(final String anExpression) {
         return new Comparator() {
-            private OgnlValueStack stack = new OgnlValueStack();
-
-            public int compare(Object o1, Object o2) {
-                // Get value for first object
-                stack.push(o1);
-                Object v1 = stack.findValue(anExpression);
-                stack.pop();
-
-                // Get value for second object
-                stack.push(o2);
-                Object v2 = stack.findValue(anExpression);
-                stack.pop();
-
-                // Ensure non-null
-                if (v1 == null)
-                    v1 = "";
-                if (v2 == null)
-                    v2 = "";
-
-                // Compare them
-                if (v2 instanceof Comparable && v1.getClass().equals(v2.getClass())) {
-                    return ((Comparable) v2).compareTo(v1);
-                } else {
-                    String s1 = v1.toString();
-                    String s2 = v2.toString();
-                    return s2.compareTo(s1);
+                private OgnlValueStack stack = new OgnlValueStack();
+
+                public int compare(Object o1, Object o2) {
+                    // Get value for first object
+                    stack.push(o1);
+
+                    Object v1 = stack.findValue(anExpression);
+                    stack.pop();
+
+                    // Get value for second object
+                    stack.push(o2);
+
+                    Object v2 = stack.findValue(anExpression);
+                    stack.pop();
+
+                    // Ensure non-null
+                    if (v1 == null) {
+                        v1 = "";
+                    }
+
+                    if (v2 == null) {
+                        v2 = "";
+                    }
+
+                    // Compare them
+                    if (v2 instanceof Comparable && v1.getClass().equals(v2.getClass())) {
+                        return ((Comparable) v2).compareTo(v1);
+                    } else {
+                        String s1 = v1.toString();
+                        String s2 = v2.toString();
+
+                        return s2.compareTo(s1);
+                    }
                 }
-            }
-        };
+            };
     }
 }

File src/java/com/opensymphony/webwork/util/SubsetIteratorFilter.java

  */
 package com.opensymphony.webwork.util;
 
+import com.opensymphony.xwork.Action;
+
 import org.apache.commons.logging.LogFactory;
 
 import java.util.ArrayList;
 import java.util.Iterator;
 
-import com.opensymphony.xwork.Action;
-
 
 /**
  *        A bean that takes an iterator and outputs a subset of it.

File src/java/com/opensymphony/webwork/util/Timer.java

  */
 package com.opensymphony.webwork.util;
 
+
 /**
- *	A bean that can be used to time execution of pages
- *      
- *	@author Rickard �berg (rickard@middleware-company.com)
- *	@version $Revision$
+ *        A bean that can be used to time execution of pages
+ *
+ *        @author Rickard �berg (rickard@middleware-company.com)
+ *        @version $Revision$
  */
 public class Timer {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     // Attributes ----------------------------------------------------
     long current = System.currentTimeMillis();
     long start = current;
-   
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
     // Public --------------------------------------------------------
-   
     public long getTime() {
         // Return how long time has passed since last check point
         long now = System.currentTimeMillis();
         long time = now - current;
-      
+
         // Reset so that next time we get from this point
         current = now;
+
         return time;
     }
 

File 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();

File src/java/com/opensymphony/webwork/views/jsp/ParametereizedBodyTagSupport.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.webwork.views.jsp;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
+
 
 /**
  * User: plightbo
  * Time: 3:25:09 PM
  */
 public class ParametereizedBodyTagSupport extends WebWorkBodyTagSupport implements ParameterizedTag {
-    //~ Instance fields ////////////////////////////////////////////////////////
+    //~ Static fields/initializers /////////////////////////////////////////////
+
     final protected static Log log = LogFactory.getLog(ParameterizedTagSupport.class);
 
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     Map params;
 
     //~ Methods ////////////////////////////////////////////////////////////////

File src/java/com/opensymphony/webwork/views/jsp/iterator/SortIteratorTag.java

 import com.opensymphony.webwork.util.SortIteratorFilter;
 import com.opensymphony.webwork.views.jsp.ActionTag;
 
+import java.util.Comparator;
+
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.Tag;
-import java.util.Comparator;
 
 
 /**

File 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 ////////////////////////////////////////////////////////

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

     //~ 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;

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

 
 import com.opensymphony.webwork.views.jsp.ui.table.WebTable;
 
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
 public class LinkCellRenderer extends AbstractCellRenderer {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     /**
      * this is the actual renderer tha will be used to display the text
      */
     protected CellRenderer _delegateRenderer = new DefaultCellRenderer();
 
     /**
-     * this is the link we are setting (required)
+     * the CSS class this link belongs to. Optional
      */
-    protected String _link = null;
+    protected String _cssClass = null;
 
     /**
-     * if set there will be a parameter attached to link.  (optional)
-     * This should be extended to allow multiple parameters
+     * the id attribute this link belongs to. Optional
      */
-    protected String _param = null;
+    protected String _cssId = null;
 
     /**
-     * the target frame to open in. Optional
+     * this is the link we are setting (required)
      */
-    protected String _target = null;
+    protected String _link = null;
 
     /**
-     * additional parameters after the above parameter is generated. Optional
+     * the (Java)script/ function to execute when the link is clicked. Optional
      */
-    protected String _trailParams = null;
+    protected String _onclick = null;
 
     /**
-     * the CSS class this link belongs to. Optional
+     * the (Java)script/ function to execute when the link is clicked twice. Optional
      */
-    protected String _cssClass = null;
+    protected String _ondblclick = null;
 
     /**
-     * the id attribute this link belongs to. Optional
+     * the (Java)script/ function to execute when cursor is away from the link. Optional
      */
-    protected String _cssId = null;
+    protected String _onmouseout = null;
 
     /**
-     * the title attribute this link belongs to. Optional
+     * the (Java)script/ function to execute when cursor is over the link. Optional
      */
-    protected String _title = null;
+    protected String _onmouseover = null;
 
     /**
-     * the (Java)script/ function to execute when cursor is over the link. Optional
+     * if set there will be a parameter attached to link.  (optional)
+     * This should be extended to allow multiple parameters
      */
-    protected String _onmouseover = null;
+    protected String _param = null;
 
     /**
-     * the (Java)script/ function to execute when the link is clicked. Optional
+     * directly set the value for the param.  Will overide paramColumn if set.
+     * optional.  Either this or paramColumn must be set if param is used.
+     * Will be ignored if param not used
      */
-    protected String _onclick = null;
+    protected String _paramValue = null;
 
     /**
-     * the (Java)script/ function to execute when the link is clicked twice. Optional
+     * the target frame to open in. Optional
      */
-    protected String _ondblclick = null;
+    protected String _target = null;
 
     /**
-     * the (Java)script/ function to execute when cursor is away from the link. Optional
+     * the title attribute this link belongs to. Optional
      */
-    protected String _onmouseout = null;
+    protected String _title = null;
+
+    /**
+     * additional parameters after the above parameter is generated. Optional
+     */
+    protected String _trailParams = null;
 
     /**
      * if used the param value will be taken from another column in the table.  Useful if each row
      */
     protected int _paramColumn = -1;
 
-    /**
-     * directly set the value for the param.  Will overide paramColumn if set.
-     * optional.  Either this or paramColumn must be set if param is used.
-     * Will be ignored if param not used
-     */
-    protected String _paramValue = null;
+    //~ Constructors ///////////////////////////////////////////////////////////
 
     public LinkCellRenderer() {
     }
 
+    //~ Methods ////////////////////////////////////////////////////////////////
+
     /**
      * should the link data be encodeed?
      */
 
         StringBuffer cell = new StringBuffer(256);
         cell.append("<a href='").append(_link);
+
         if (_param != null) {
             cell.append("?").append(_param).append("=");
+
             if (_paramValue != null) {
                 cell.append(_paramValue);
             } else if (_paramColumn >= 0) {
             }
         }
 
-        if (_trailParams != null && !"".equals(_trailParams)) {
-            if (_param == null)
+        if ((_trailParams != null) && !"".equals(_trailParams)) {
+            if (_param == null) {
                 cell.append("?");
-            else
+            } else {
                 cell.append("&");
+            }
+
             cell.append(_trailParams);
         }
 
         }
 
         cell.append(">").append(value).append("</a>");
-        return cell.toString();
-    }
-
-    public void setLink(String link) {
-        _link = link;
-    }
-
-    public void setParam(String param) {
-        _param = param;
-    }
 
-    public void setTarget(String target) {
-        _target = target;
-    }
-
-    public void setParamColumn(int paramColumn) {
-        _paramColumn = paramColumn;
-    }
-
-    public void setTrailParams(String trailParams) {
-        _trailParams = trailParams;
+        return cell.toString();
     }
 
     public void setCssClass(String cssClass) {
         _cssId = cssId;
     }
 
-    public void setTitle(String title) {
-        _title = title;
-    }
-
-    public void setOnmouseover(String onmouseover) {
-        _onmouseover = onmouseover;
+    public void setLink(String link) {
+        _link = link;
     }
 
     public void setOnclick(String onclick) {
         _onmouseout = onmouseout;
     }
 
+    public void setOnmouseover(String onmouseover) {
+        _onmouseover = onmouseover;
+    }
+
+    public void setParam(String param) {
+        _param = param;
+    }
+
+    public void setParamColumn(int paramColumn) {
+        _paramColumn = paramColumn;
+    }
+
+    public void setParamValue(String paramValue) {
+        _paramValue = paramValue;
+    }
+
     /**
      * used to set the renderer to delgate to.
      * if the render is an AbstractCellRenderer then it will take the alignment from
      */
     public void setRenderer(CellRenderer delegateRenderer) {
         _delegateRenderer = delegateRenderer;
+
         if (_delegateRenderer instanceof AbstractCellRenderer) {
             setAlignment(((AbstractCellRenderer) _delegateRenderer).getAlignment());
         }
     }
 
-    public void setParamValue(String paramValue) {
-        _paramValue = paramValue;
+    public void setTarget(String target) {
+        _target = target;
+    }
+
+    public void setTitle(String title) {
+        _title = title;
+    }
+
+    public void setTrailParams(String trailParams) {
+        _trailParams = trailParams;
     }
-}
+}

File 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 ///////////////////////////////////////////////////////////

File src/java/com/opensymphony/webwork/views/jsp/vui/AbstractVUITag.java

     protected abstract void initializeAttributes();
 
     /**
-     * get the template directory for a specific voice browser
-     */
+ * get the template directory for a specific voice browser
+ */
     protected String getTemplateDirectory() {
         String ua = getBrowserUserAgent();
 

File src/test/com/opensymphony/webwork/views/jsp/WebWorkMockHttpServletRequest.java

         return attributes.get(s);
     }
 
+    public Enumeration getAttributeNames() {
+        Vector v = new Vector();
+        v.addAll(attributes.keySet());
+
+        return v.elements();
+    }
+
     public void setLocale(Locale locale) {
         this.locale = locale;
     }
         return pathInfo;
     }
 
-    public Enumeration getAttributeNames() {
-        Vector v = new Vector();
-        v.addAll(attributes.keySet());
-        return v.elements();
+    public void setQueryString(String queryString) {
+        this.queryString = queryString;
+    }
+
+    public String getQueryString() {
+        return queryString;
+    }
+
+    public void setRequestURI(String requestURI) {
+        this.requestURI = requestURI;
+    }
+
+    public String getRequestURI() {
+        return requestURI;
     }
 
     public HttpSession getSession() {
     public void setupGetPathInfo(String pathInfo) {
         this.pathInfo = pathInfo;
     }
-
-    public void setQueryString(String queryString) {
-        this.queryString = queryString;
-    }
-
-    public String getQueryString() {
-        return queryString;
-    }
-
-    public void setRequestURI(String requestURI) {
-        this.requestURI = requestURI;
-    }
-
-    public String getRequestURI() {
-        return requestURI;
-    }
 }