Anonymous avatar Anonymous committed 7fb1d44

jalopy formatting stuff

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

Comments (0)

Files changed (35)

src/java/com/opensymphony/xwork/ActionInvocation.java

     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
- * Get the Action associated with this ActionInvocation
- * @return
- */
+    * Get the Action associated with this ActionInvocation
+    * @return
+    */
     Action getAction();
 
     boolean isExecuted();
 
     /**
- * Gets the ActionContext associated with this ActionInvocation. The ActionProxy is
- * responsible for setting this ActionContext onto the ThreadLocal before invoking
- * the ActionInvocation and resetting the old ActionContext afterwards.
- * @return
- */
+    * Gets the ActionContext associated with this ActionInvocation. The ActionProxy is
+    * responsible for setting this ActionContext onto the ThreadLocal before invoking
+    * the ActionInvocation and resetting the old ActionContext afterwards.
+    * @return
+    */
     ActionContext getInvocationContext();
 
     ActionProxy getProxy();
 
     /**
- * If the DefaultActionInvocation has been executed before and the Result is an instance of ActionChainResult, this method
- * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
- * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
- * the result params.
- * @return a Result instance
- * @throws java.lang.Exception
- */
+    * If the DefaultActionInvocation has been executed before and the Result is an instance of ActionChainResult, this method
+    * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
+    * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
+    * the result params.
+    * @return a Result instance
+    * @throws java.lang.Exception
+    */
     Result getResult() throws Exception;
 
     /**
- * Gets the result code returned from this ActionInvocation
- * @return
- */
+    * Gets the result code returned from this ActionInvocation
+    * @return
+    */
     String getResultCode();
 
     OgnlValueStack getStack();
 
     /**
- * Register a com.opensymphony.xwork.interceptor.PreResultListener to be notified after the Action is executed and before the
- * Result is executed. The ActionInvocation implementation must guarantee that listeners will be called in the order
- * in which they are registered. Listener registration and execution does not need to be thread-safe.
- * @param listener
- */
+    * Register a com.opensymphony.xwork.interceptor.PreResultListener to be notified after the Action is executed and before the
+    * Result is executed. The ActionInvocation implementation must guarantee that listeners will be called in the order
+    * in which they are registered. Listener registration and execution does not need to be thread-safe.
+    * @param listener
+    */
     void addPreResultListener(PreResultListener listener);
 
     /**
- * Invokes the next step in processing this ActionInvocation. If there are more
- * Interceptors, this will call the next one. If Interceptors choose not to short-circuit
- * ActionInvocation processing and return their own return code, they will call
- * invoke() to allow the next Interceptor to execute. If there are no more Interceptors
- * to be applied, the Action is executed.
- * @return
- * @throws Exception
- */
+    * Invokes the next step in processing this ActionInvocation. If there are more
+    * Interceptors, this will call the next one. If Interceptors choose not to short-circuit
+    * ActionInvocation processing and return their own return code, they will call
+    * invoke() to allow the next Interceptor to execute. If there are no more Interceptors
+    * to be applied, the Action is executed.
+    * @return
+    * @throws Exception
+    */
     String invoke() throws Exception;
 }

src/java/com/opensymphony/xwork/ActionSupport.java

     }
 
     public Locale getLocale() {
-        return (ActionContext.getContext() != null) ?
-                ActionContext.getContext().getLocale() :
-                null;
+        return (ActionContext.getContext() != null) ? ActionContext.getContext().getLocale() : null;
     }
 
-
     public String getText(String aTextName) {
         return textProvider.getText(aTextName);
     }

src/java/com/opensymphony/xwork/DefaultActionProxy.java

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.Map;
 import java.util.Locale;
+import java.util.Map;
 
 
 /**
             String message;
 
             if ((namespace != null) && (namespace.trim().length() > 0)) {
-                message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION,
-                        Locale.getDefault(),
-                        new String[] {
+                message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION, Locale.getDefault(), new String[] {
                             namespace, actionName
                         });
             } else {
-                message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_ACTION_EXCEPTION,
-                        Locale.getDefault(),
-                        new String[] {
+                message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_ACTION_EXCEPTION, Locale.getDefault(), new String[] {
                             actionName
                         });
             }

src/java/com/opensymphony/xwork/LocaleProvider.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.xwork;
 
 import java.util.Locale;
 
+
 /**
  * LocaleProvider
  * @author Jason Carreira
  * Date: Oct 29, 2003 9:11:22 PM
  */
 public interface LocaleProvider {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
     Locale getLocale();
 }

src/java/com/opensymphony/xwork/TextProvider.java

  */
 package com.opensymphony.xwork;
 
+import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
-import java.util.List;
 
 
 /**

src/java/com/opensymphony/xwork/TextProviderSupport.java

 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    private Locale getLocale() {
-        return localeProvider.getLocale();
-    }
-
     /**
     * Get a text from the resource bundles associated with this action.
     * The resource bundles are searched, starting with the one associated
     public ResourceBundle getTexts() {
         return getTexts(clazz.getName());
     }
+
+    private Locale getLocale() {
+        return localeProvider.getLocale();
+    }
 }

src/java/com/opensymphony/xwork/XworkException.java

     //~ Constructors ///////////////////////////////////////////////////////////
 
     /**
- * Constructs a <code>XworkException</code> with no detail  message.
- */
+    * Constructs a <code>XworkException</code> with no detail  message.
+    */
     public XworkException() {
     }
 
     /**
- * Constructs a <code>XworkException</code> with the specified
- * detail message.
- *
- * @param   s   the detail message.
- */
+    * Constructs a <code>XworkException</code> with the specified
+    * detail message.
+    *
+    * @param   s   the detail message.
+    */
     public XworkException(String s) {
         super(s);
     }
 
     /**
- * Constructs a <code>XworkException</code> with no detail  message.
- */
+    * Constructs a <code>XworkException</code> with no detail  message.
+    */
     public XworkException(Throwable cause) {
         this.throwable = cause;
     }
 
     /**
- * Constructs a <code>XworkException</code> with the specified
- * detail message.
- *
- * @param   s   the detail message.
- */
+    * Constructs a <code>XworkException</code> with the specified
+    * detail message.
+    *
+    * @param   s   the detail message.
+    */
     public XworkException(String s, Throwable cause) {
         super(s);
         this.throwable = cause;
     }
 
     /**
- * Prints this <code>Throwable</code> and its backtrace to the
- * specified print stream.
- *
- * @param s <code>PrintStream</code> to use for output
- */
+    * Prints this <code>Throwable</code> and its backtrace to the
+    * specified print stream.
+    *
+    * @param s <code>PrintStream</code> to use for output
+    */
     public void printStackTrace(PrintStream s) {
         super.printStackTrace(s);
 
     }
 
     /**
- * Prints this <code>Throwable</code> and its backtrace to the specified
- * print writer.
- *
- * @param s <code>PrintWriter</code> to use for output
- * @since   JDK1.1
- */
+    * Prints this <code>Throwable</code> and its backtrace to the specified
+    * print writer.
+    *
+    * @param s <code>PrintWriter</code> to use for output
+    * @since   JDK1.1
+    */
     public void printStackTrace(PrintWriter s) {
         super.printStackTrace(s);
 
     }
 
     /**
- * Returns a short description of this throwable object.
- * If this <code>Throwable</code> object was
- * {@link #Throwable(String) created} with an error message string,
- * then the result is the concatenation of three strings:
- * <ul>
- * <li>The name of the actual class of this object
- * <li>": " (a colon and a space)
- * <li>The result of the {@link #getMessage} method for this object
- * </ul>
- * If this <code>Throwable</code> object was {@link #Throwable() created}
- * with no error message string, then the name of the actual class of
- * this object is returned.
- *
- * @return  a string representation of this <code>Throwable</code>.
- */
+    * Returns a short description of this throwable object.
+    * If this <code>Throwable</code> object was
+    * {@link #Throwable(String) created} with an error message string,
+    * then the result is the concatenation of three strings:
+    * <ul>
+    * <li>The name of the actual class of this object
+    * <li>": " (a colon and a space)
+    * <li>The result of the {@link #getMessage} method for this object
+    * </ul>
+    * If this <code>Throwable</code> object was {@link #Throwable() created}
+    * with no error message string, then the name of the actual class of
+    * this object is returned.
+    *
+    * @return  a string representation of this <code>Throwable</code>.
+    */
     public String toString() {
         if (throwable == null) {
             return super.toString();

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

     protected void before(ActionInvocation invocation) throws Exception {
         OgnlValueStack stack = invocation.getStack();
         CompoundRoot root = stack.getRoot();
-		Iterator iterator = root.iterator();
-		iterator.next();
-        while(iterator.hasNext()) {
+        Iterator iterator = root.iterator();
+        iterator.next();
+
+        while (iterator.hasNext()) {
             Object o = iterator.next();
             OgnlUtil.copy(o, invocation.getAction(), ActionContext.getContext().getContextMap());
         }

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

  */
 package com.opensymphony.xwork.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
-{
-}
+public interface NoParameters {
+}

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

                     final OgnlValueStack stack = ActionContext.getContext().getValueStack();
 
                     for (Iterator iterator = parameters.entrySet().iterator();
-                         iterator.hasNext();) {
+                            iterator.hasNext();) {
                         Map.Entry entry = (Map.Entry) iterator.next();
                         stack.setValue(entry.getKey().toString(), entry.getValue());
                     }

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

     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
- * This callback method will be called after the Action execution and before the Result execution.
- * @param invocation
- * @param resultCode
- */
+    * This callback method will be called after the Action execution and before the Result execution.
+    * @param invocation
+    * @param resultCode
+    */
     void beforeResult(ActionInvocation invocation, String resultCode);
 }

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

         Ognl.setRoot(context, o);
 
         for (Iterator iterator = props.entrySet().iterator();
-             iterator.hasNext();) {
+                iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             String expression = (String) entry.getKey();
 

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

 
 import java.io.ObjectStreamException;
 import java.io.Serializable;
-import java.util.Map;
-import java.util.Iterator;
+
 import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
 
 
 /**
         return context;
     }
 
+    public void setDefaultType(Class defaultType) {
+        this.defaultType = defaultType;
+    }
+
     public CompoundRoot getRoot() {
         return root;
     }
         return root.size();
     }
 
-    public void setDefaultType(Class defaultType) {
-        this.defaultType = defaultType;
-    }
-
     private void setRoot(CompoundRoot compoundRoot) {
         this.root = compoundRoot;
         this.context = Ognl.createDefaultContext(this.root, accessor, XWorkConverter.getInstance());

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

 package com.opensymphony.xwork.util;
 
 import com.opensymphony.util.TextUtils;
+
 import com.opensymphony.xwork.ActionContext;
 
 import ognl.DefaultTypeConverter;
 
 import java.lang.reflect.Member;
 
+import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.text.DateFormat;
 
 import java.util.*;
 
         if (value instanceof String) {
             String sa = (String) value;
             Locale locale = (Locale) context.get(ActionContext.LOCALE);
+
             if (locale == null) {
                 locale = Locale.getDefault();
             }
+
             DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
 
             try {

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

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.xwork.util;
 
 import ognl.EnumerationPropertyAccessor;
-import ognl.OgnlException;
 import ognl.ObjectPropertyAccessor;
+import ognl.OgnlException;
 
 import java.util.Map;
 
+
 /**
  * User: plightbo
  * Date: Nov 13, 2003
  * Time: 7:13:37 AM
  */
 public class XWorkEnumerationAcccessor extends EnumerationPropertyAccessor {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     ObjectPropertyAccessor opa = new ObjectPropertyAccessor();
 
+    //~ Methods ////////////////////////////////////////////////////////////////
+
     public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
         opa.setProperty(context, target, name, value);
     }

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

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.xwork.util;
 
 import ognl.IteratorPropertyAccessor;
-import ognl.OgnlException;
 import ognl.ObjectPropertyAccessor;
+import ognl.OgnlException;
 
 import java.util.Map;
 
+
 /**
  * User: plightbo
  * Date: Nov 13, 2003
  * Time: 7:12:22 AM
  */
 public class XWorkIteratorPropertyAccessor extends IteratorPropertyAccessor {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     ObjectPropertyAccessor opa = new ObjectPropertyAccessor();
 
+    //~ Methods ////////////////////////////////////////////////////////////////
+
     public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
         opa.setProperty(context, target, name, value);
     }

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

     public DelegatingValidatorContext(Object object) {
         this.localeProvider = makeLocaleProvider(object);
         this.validationAware = makeValidationAware(object);
-        this.textProvider = makeTextProvider(object,localeProvider);
+        this.textProvider = makeTextProvider(object, localeProvider);
     }
 
     //~ Methods ////////////////////////////////////////////////////////////////
         return validationAware.hasFieldErrors();
     }
 
+    protected static LocaleProvider makeLocaleProvider(Object object) {
+        if (object instanceof LocaleProvider) {
+            return (LocaleProvider) object;
+        } else {
+            return new ActionContextLocaleProvider();
+        }
+    }
+
     protected static TextProvider makeTextProvider(Object object, LocaleProvider localeProvider) {
         if (object instanceof LocaleProvider) {
             return (TextProvider) object;
         }
     }
 
-    protected static LocaleProvider makeLocaleProvider(Object object) {
-        if (object instanceof LocaleProvider) {
-            return (LocaleProvider) object;
-        } else {
-            return new ActionContextLocaleProvider();
-        }
-    }
-
     protected void setTextProvider(TextProvider textProvider) {
         this.textProvider = textProvider;
     }
 
     //~ Inner Classes //////////////////////////////////////////////////////////
 
+    private static class ActionContextLocaleProvider implements LocaleProvider {
+        public Locale getLocale() {
+            return ActionContext.getContext().getLocale();
+        }
+    }
+
     private static class LoggingValidationAware implements ValidationAware {
         private Log log;
 
             return false;
         }
     }
-
-    private static class ActionContextLocaleProvider implements LocaleProvider {
-        public Locale getLocale() {
-            return ActionContext.getContext().getLocale();
-        }
-
-    }
 }

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

  */
 package com.opensymphony.xwork.validator;
 
+import com.opensymphony.xwork.LocaleProvider;
 import com.opensymphony.xwork.TextProvider;
 import com.opensymphony.xwork.ValidationAware;
-import com.opensymphony.xwork.LocaleProvider;
 
 
 /**

src/test/com/opensymphony/xwork/LocaleAwareTest.java

 import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.providers.MockConfigurationProvider;
 import com.opensymphony.xwork.util.OgnlValueStack;
+
 import junit.framework.TestCase;
 
 import java.util.Locale;

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

 
 import com.mockobjects.dynamic.C;
 import com.mockobjects.dynamic.Mock;
+
 import com.opensymphony.util.FileManager;
+
 import junit.framework.TestCase;
 
 

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

 import com.opensymphony.xwork.config.Configuration;
 import com.opensymphony.xwork.config.ConfigurationProvider;
 import com.opensymphony.xwork.config.impl.MockConfiguration;
+
 import junit.framework.TestCase;
 
 

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

 public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestBase {
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        ConfigurationManager.destroyConfiguration();
-    }
-
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        ConfigurationManager.destroyConfiguration();
-    }
-
     public void testBasicInterceptors() throws ConfigurationException {
         final String filename = "com/opensymphony/xwork/config/providers/xwork-test-interceptors-basic.xml";
         ConfigurationProvider provider = buildConfigurationProvider(filename);
         assertEquals(4, subSubPkg.getAllInterceptorConfigs().size());
         assertEquals(inheritedStack, subSubPkg.getInterceptorConfigs().get("subSubDefaultStack"));
     }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        ConfigurationManager.destroyConfiguration();
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+
+        ConfigurationManager.destroyConfiguration();
+    }
 }

src/test/com/opensymphony/xwork/interceptor/PreResultListenerTest.java

                 }
 
                 /**
-* Initializes the configuration object.
-*/
+                * Initializes the configuration object.
+                */
                 public void init(Configuration configuration) throws ConfigurationException {
                     PackageConfig packageConfig = new PackageConfig("package");
                     ActionConfig actionConfig = new ActionConfig(null, SimpleFooAction.class, null, null, null);
                 }
 
                 /**
-* Tells whether the ConfigurationProvider should reload its configuration
-* @return
-*/
+                * Tells whether the ConfigurationProvider should reload its configuration
+                * @return
+                */
                 public boolean needsReload() {
                     return false;
                 }

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

 public class Bar {
     //~ Instance fields ////////////////////////////////////////////////////////
 
+    Long id;
     String title;
     int somethingElse;
-	Long id;
-	
+
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
     public void setSomethingElse(int somethingElse) {
         this.somethingElse = somethingElse;
     }
     public String getTitle() {
         return title;
     }
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getId() {
-		return this.id;
-	}
 }

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

 
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    String name;
     Foo foo;
+    String name;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
+    public void setFoo(Foo foo) {
+        this.foo = foo;
     }
 
     public Foo getFoo() {
         return foo;
     }
 
-    public void setFoo(Foo foo) {
-        this.foo = foo;
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
     }
 }

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

 
     Bar bar;
     Date birthday;
+    Foo child;
     String title;
     long[] points;
+    Foo[] relatives;
     boolean useful;
     int number;
     long aLong;
-    Foo child;
-    Foo[] relatives;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    public void setALong(long aLong) {
+        this.aLong = aLong;
+    }
+
+    public long getALong() {
+        return aLong;
+    }
+
     public void setBar(Bar bar) {
         this.bar = bar;
     }
         return birthday;
     }
 
+    public void setChild(Foo child) {
+        this.child = child;
+    }
+
+    public Foo getChild() {
+        return child;
+    }
+
     public void setNumber(int number) {
         this.number = number;
     }
         return points;
     }
 
+    public void setRelatives(Foo[] relatives) {
+        this.relatives = relatives;
+    }
+
+    public Foo[] getRelatives() {
+        return relatives;
+    }
+
     public void setTitle(String title) {
         this.title = title;
     }
     public boolean isUseful() {
         return useful;
     }
-
-    public long getALong() {
-        return aLong;
-    }
-
-    public void setALong(long aLong) {
-        this.aLong = aLong;
-    }
-
-    public void setChild(Foo child) {
-        this.child = child;
-    }
-
-    public Foo getChild() {
-        return child;
-    }
-
-    public Foo[] getRelatives() {
-        return relatives;
-    }
-
-    public void setRelatives(Foo[] relatives) {
-        this.relatives = relatives;
-    }
 }

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

     }
 
     /* (non-Javadoc)
- * @see ognl.TypeConverter#convertValue(java.util.Map, java.lang.Object, java.lang.reflect.Member, java.lang.String, java.lang.Object, java.lang.Class)
- */
+    * @see ognl.TypeConverter#convertValue(java.util.Map, java.lang.Object, java.lang.reflect.Member, java.lang.String, java.lang.Object, java.lang.Class)
+    */
     public Object convertValue(Map context, Object source, Member member, String property, Object value, Class toClass) {
         return convertValue(context, value, toClass);
     }

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

 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.XWorkMessages;
 import com.opensymphony.xwork.config.ConfigurationManager;
+
 import junit.framework.TestCase;
 
 import java.util.Locale;
 
     public void testParameterizedDefaultMessage() {
         try {
-            String message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_ACTION_EXCEPTION,
-                    Locale.getDefault(),
-                    new String[]{
-                "AddUser"
-            });
+            String message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_ACTION_EXCEPTION, Locale.getDefault(), new String[] {
+                    "AddUser"
+                });
             assertEquals("There is no Action mapped for action name AddUser", message);
         } catch (MissingResourceException e) {
             e.printStackTrace();
 
     public void testParameterizedDefaultMessageWithPackage() {
         try {
-            String message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION,
-                    Locale.getDefault(),
-                    new String[]{
-                "blah", "AddUser"
-            });
+            String message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION, Locale.getDefault(), new String[] {
+                    "blah", "AddUser"
+                });
             assertEquals("There is no Action mapped for namespace blah and action name AddUser", message);
         } catch (MissingResourceException e) {
             e.printStackTrace();
         super.setUp();
         ConfigurationManager.destroyConfiguration();
         ConfigurationManager.getConfiguration().reload();
+
         OgnlValueStack stack = new OgnlValueStack();
         ActionContext.setContext(new ActionContext(stack.getContext()));
         ActionContext.getContext().setLocale(Locale.US);

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

         assertEquals(123456, foo.getNumber());
     }
 
-	public void testStringToLong() {
-		Foo foo = new Foo();
+    public void testStringToLong() {
+        Foo foo = new Foo();
 
-		Map context = Ognl.createDefaultContext(foo);
+        Map context = Ognl.createDefaultContext(foo);
 
-		HashMap props = new HashMap();
-		props.put("aLong", "123");
+        HashMap props = new HashMap();
+        props.put("aLong", "123");
 
-		OgnlUtil.setProperties(props, foo, context);
-		assertEquals(123, foo.getALong());
+        OgnlUtil.setProperties(props, foo, context);
+        assertEquals(123, foo.getALong());
 
-		props.put("aLong", new String[] {"123"});
+        props.put("aLong", new String[] {"123"});
 
-		foo.setALong(0);
-		OgnlUtil.setProperties(props, foo, context);
-		assertEquals(123, foo.getALong());
-	}
+        foo.setALong(0);
+        OgnlUtil.setProperties(props, foo, context);
+        assertEquals(123, foo.getALong());
+    }
 
-	
     //~ Inner Classes //////////////////////////////////////////////////////////
 
     public static class Email {

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

  */
 package com.opensymphony.xwork.util;
 
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
 public class Owner {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
     private Dog dog;
 
-    public Dog getDog() {
-        return dog;
-    }
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public void setDog(Dog dog) {
         this.dog = dog;
     }
+
+    public Dog getDog() {
+        return dog;
+    }
 }

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

 /*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+/*
  * Created on 6/10/2003
  *
  */
 package com.opensymphony.xwork.util;
 
+import junit.framework.TestCase;
+
+import ognl.Ognl;
+
 import java.util.HashMap;
 import java.util.Map;
 
-import ognl.Ognl;
-import junit.framework.TestCase;
 
 /**
  * @author CameronBraid
  *
  */
-public class SetPropertiesTest extends TestCase
-{
+public class SetPropertiesTest extends TestCase {
+    //~ Constructors ///////////////////////////////////////////////////////////
 
-	/**
-	 * 
-	 */
-	public SetPropertiesTest(String a)
-	{
-		super(a);
-	}
+    /**
+     *
+     */
+    public SetPropertiesTest(String a) {
+        super(a);
+    }
 
+    //~ Methods ////////////////////////////////////////////////////////////////
 
-	public void testOgnlUtilEmptyStringAsLong() {
-		Bar bar = new Bar();
-		bar.setId(null);
+    public void testOgnlUtilEmptyStringAsLong() {
+        Bar bar = new Bar();
+        bar.setId(null);
 
-		Map context = Ognl.createDefaultContext(bar);
+        Map context = Ognl.createDefaultContext(bar);
 
-		HashMap props = new HashMap();
-		props.put("id", "");
+        HashMap props = new HashMap();
+        props.put("id", "");
 
-		OgnlUtil.setProperties(props, bar, context);
+        OgnlUtil.setProperties(props, bar, context);
         assertNull(bar.getId());
 
-		props.put("id", new String[] {""});
+        props.put("id", new String[] {""});
 
-		bar.setId(null);
-		OgnlUtil.setProperties(props, bar, context);
+        bar.setId(null);
+        OgnlUtil.setProperties(props, bar, context);
         assertNull(bar.getId());
-	}
+    }
 
-	public void testValueStackSetValueEmptyStringAsLong() {
-		Bar bar = new Bar();
+    public void testValueStackSetValueEmptyStringAsLong() {
+        Bar bar = new Bar();
 
-		OgnlValueStack vs = new OgnlValueStack();
-		vs.push(bar);
+        OgnlValueStack vs = new OgnlValueStack();
+        vs.push(bar);
 
-		vs.setValue("id", "");
+        vs.setValue("id", "");
         assertNull(bar.getId());
 
         bar.setId(null);
 
-		vs.setValue("id", new String[]{""});
+        vs.setValue("id", new String[] {""});
         assertNull(bar.getId());
-	}
-
+    }
 }

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

         assertEquals(date, date2);
     }
 
-    public void testFieldErrorMessageAddedWhenConversionFails() {
+    public void testFieldErrorMessageAddedForComplexProperty() {
         SimpleAction action = new SimpleAction();
-        action.setDate(null);
+        action.setBean(new TestBean());
 
         OgnlValueStack stack = new OgnlValueStack();
         stack.push(action);
+
         Map context = stack.getContext();
         context.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);
-        assertEquals("Conversion should have failed.",
-                null,
-                converter.convertValue(context, action, null, "date", new String[]{
+        context.put(XWorkConverter.CONVERSION_PROPERTY_FULLNAME, "bean.birth");
+        assertEquals("Conversion should have failed.", null, converter.convertValue(context, action.getBean(), null, "birth", new String[] {
                     "invalid date"
                 }, Date.class));
         stack.pop();
         assertTrue(action.hasFieldErrors());
-        assertNotNull(action.getFieldErrors().get("date"));
-        assertEquals("Invalid field value for field \"date\".", ((List) action.getFieldErrors().get("date")).get(0));
+        assertNotNull(action.getFieldErrors().get("bean.birth"));
+        assertEquals("Invalid field value for field \"bean.birth\".", ((List) action.getFieldErrors().get("bean.birth")).get(0));
     }
 
-    public void testFieldErrorMessageAddedForComplexProperty() {
+    public void testFieldErrorMessageAddedWhenConversionFails() {
         SimpleAction action = new SimpleAction();
-        action.setBean(new TestBean());
+        action.setDate(null);
 
         OgnlValueStack stack = new OgnlValueStack();
         stack.push(action);
+
         Map context = stack.getContext();
         context.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);
-        context.put(XWorkConverter.CONVERSION_PROPERTY_FULLNAME, "bean.birth");
-        assertEquals("Conversion should have failed.",
-                null,
-                converter.convertValue(context, action.getBean(), null, "birth", new String[]{
+        assertEquals("Conversion should have failed.", null, converter.convertValue(context, action, null, "date", new String[] {
                     "invalid date"
                 }, Date.class));
         stack.pop();
         assertTrue(action.hasFieldErrors());
-        assertNotNull(action.getFieldErrors().get("bean.birth"));
-        assertEquals("Invalid field value for field \"bean.birth\".", ((List) action.getFieldErrors().get("bean.birth")).get(0));
+        assertNotNull(action.getFieldErrors().get("date"));
+        assertEquals("Invalid field value for field \"date\".", ((List) action.getFieldErrors().get("date")).get(0));
     }
 
     public void testFieldErrorMessageAddedWhenConversionFailsOnModelDriven() {
         OgnlValueStack stack = new OgnlValueStack();
         stack.push(action);
         stack.push(action.getModel());
+
         Map context = stack.getContext();
         context.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);
-        assertEquals("Conversion should have failed.",
-                null,
-                converter.convertValue(context, action, null, "birth", new String[]{
+        assertEquals("Conversion should have failed.", null, converter.convertValue(context, action, null, "birth", new String[] {
                     "invalid date"
                 }, Date.class));
         stack.pop();
         list.add("foo");
         list.add("bar");
         list.add("baz");
-        assertEquals(list, converter.convertValue(context, null, null, null, new String[]{
-            "foo", "bar", "baz"
-        }, Collection.class));
+        assertEquals(list, converter.convertValue(context, null, null, null, new String[] {
+                    "foo", "bar", "baz"
+                }, Collection.class));
     }
 
     public void testStringArrayToList() {
         list.add("foo");
         list.add("bar");
         list.add("baz");
-        assertEquals(list, converter.convertValue(context, null, null, null, new String[]{
-            "foo", "bar", "baz"
-        }, List.class));
+        assertEquals(list, converter.convertValue(context, null, null, null, new String[] {
+                    "foo", "bar", "baz"
+                }, List.class));
     }
 
     public void testStringArrayToPrimitiveWrappers() {
-        Long[] longs = (Long[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, Long[].class);
+        Long[] longs = (Long[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, Long[].class);
         assertNotNull(longs);
-        assertTrue(Arrays.equals(new Long[]{new Long(123), new Long(456)}, longs));
+        assertTrue(Arrays.equals(new Long[] {new Long(123), new Long(456)}, longs));
 
-        Integer[] ints = (Integer[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, Integer[].class);
+        Integer[] ints = (Integer[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, Integer[].class);
         assertNotNull(ints);
-        assertTrue(Arrays.equals(new Integer[]{
-            new Integer(123), new Integer(456)
-        }, ints));
+        assertTrue(Arrays.equals(new Integer[] {
+                    new Integer(123), new Integer(456)
+                }, ints));
 
-        Double[] doubles = (Double[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, Double[].class);
+        Double[] doubles = (Double[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, Double[].class);
         assertNotNull(doubles);
-        assertTrue(Arrays.equals(new Double[]{new Double(123), new Double(456)}, doubles));
+        assertTrue(Arrays.equals(new Double[] {new Double(123), new Double(456)}, doubles));
 
-        Float[] floats = (Float[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, Float[].class);
+        Float[] floats = (Float[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, Float[].class);
         assertNotNull(floats);
-        assertTrue(Arrays.equals(new Float[]{new Float(123), new Float(456)}, floats));
+        assertTrue(Arrays.equals(new Float[] {new Float(123), new Float(456)}, floats));
 
-        Boolean[] booleans = (Boolean[]) converter.convertValue(context, null, null, null, new String[]{
-            "true", "false"
-        }, Boolean[].class);
+        Boolean[] booleans = (Boolean[]) converter.convertValue(context, null, null, null, new String[] {
+                "true", "false"
+            }, Boolean[].class);
         assertNotNull(booleans);
-        assertTrue(Arrays.equals(new Boolean[]{Boolean.TRUE, Boolean.FALSE}, booleans));
+        assertTrue(Arrays.equals(new Boolean[] {Boolean.TRUE, Boolean.FALSE}, booleans));
     }
 
     public void testStringArrayToPrimitives() throws OgnlException {
-        long[] longs = (long[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, long[].class);
+        long[] longs = (long[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, long[].class);
         assertNotNull(longs);
-        assertTrue(Arrays.equals(new long[]{123, 456}, longs));
+        assertTrue(Arrays.equals(new long[] {123, 456}, longs));
 
-        int[] ints = (int[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, int[].class);
+        int[] ints = (int[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, int[].class);
         assertNotNull(ints);
-        assertTrue(Arrays.equals(new int[]{123, 456}, ints));
+        assertTrue(Arrays.equals(new int[] {123, 456}, ints));
 
-        double[] doubles = (double[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, double[].class);
+        double[] doubles = (double[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, double[].class);
         assertNotNull(doubles);
-        assertTrue(Arrays.equals(new double[]{123, 456}, doubles));
+        assertTrue(Arrays.equals(new double[] {123, 456}, doubles));
 
-        float[] floats = (float[]) converter.convertValue(context, null, null, null, new String[]{
-            "123", "456"
-        }, float[].class);
+        float[] floats = (float[]) converter.convertValue(context, null, null, null, new String[] {
+                "123", "456"
+            }, float[].class);
         assertNotNull(floats);
-        assertTrue(Arrays.equals(new float[]{123, 456}, floats));
+        assertTrue(Arrays.equals(new float[] {123, 456}, floats));
 
-        boolean[] booleans = (boolean[]) converter.convertValue(context, null, null, null, new String[]{
-            "true", "false"
-        }, boolean[].class);
+        boolean[] booleans = (boolean[]) converter.convertValue(context, null, null, null, new String[] {
+                "true", "false"
+            }, boolean[].class);
         assertNotNull(booleans);
-        assertTrue(Arrays.equals(new boolean[]{true, false}, booleans));
+        assertTrue(Arrays.equals(new boolean[] {true, false}, booleans));
     }
 
     public void testStringArrayToSet() {
         list.add("foo");
         list.add("bar");
         list.add("baz");
-        assertEquals(list, converter.convertValue(context, null, null, null, new String[]{
-            "foo", "bar", "bar", "baz"
-        }, Set.class));
+        assertEquals(list, converter.convertValue(context, null, null, null, new String[] {
+                    "foo", "bar", "bar", "baz"
+                }, Set.class));
     }
 
     public void testStringToCustomTypeUsingCustomConverter() {
     protected void setUp() throws Exception {
         converter = XWorkConverter.getInstance();
         ConfigurationManager.destroyConfiguration();
+
         OgnlValueStack stack = new OgnlValueStack();
         ActionContext ac = new ActionContext(stack.getContext());
         ac.setLocale(Locale.US);

src/test/com/opensymphony/xwork/validator/ExpressionValidatorTest.java

 import com.opensymphony.xwork.TestBean;
 import com.opensymphony.xwork.ValidationAware;
 import com.opensymphony.xwork.ValidationAwareSupport;
-import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.providers.MockConfigurationProvider;
+import com.opensymphony.xwork.util.OgnlValueStack;
 
 import junit.framework.TestCase;
 

src/test/com/opensymphony/xwork/validator/ModelDrivenValidationTest.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
 package com.opensymphony.xwork.validator;
 
 import com.opensymphony.xwork.*;
 import com.opensymphony.xwork.config.ConfigurationManager;
+
 import junit.framework.TestCase;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+
 /**
  * ModelDrivenValidationTest
  * @author Jason Carreira
  * Created Oct 1, 2003 10:08:25 AM
  */
 public class ModelDrivenValidationTest extends TestCase {
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public void testModelDrivenValidation() throws Exception {
         Map params = new HashMap();
-        params.put("count", new String[]{"11"});
+        params.put("count", new String[] {"11"});
+
         Map context = new HashMap();
         context.put(ActionContext.PARAMETERS, params);
+
         ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(null, "TestModelDrivenValidation", context);
         assertEquals(Action.SUCCESS, proxy.execute());
+
         ModelDrivenAction action = (ModelDrivenAction) proxy.getAction();
         assertTrue(action.hasFieldErrors());
         assertTrue(action.getFieldErrors().containsKey("count"));

src/test/com/opensymphony/xwork/validator/SimpleActionValidationTest.java

 import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.providers.MockConfigurationProvider;
 import com.opensymphony.xwork.util.OgnlValueStack;
+
 import junit.framework.TestCase;
 
 import java.util.HashMap;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.