Commits

Anonymous committed 01c27b6

ok, this is really annoying -- fixed all the formatting issues

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

Comments (0)

Files changed (10)

 <?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
+<module version="4" relativePaths="true">
   <component name="LvcsConfiguration">
     <option name="LOCAL_VCS_ENABLED" value="false" />
     <option name="LOCAL_VCS_PURGING_PERIOD" value="259200000" />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="library" name="xalan" level="application" />
-    <orderEntry type="library" name="xerces" level="application" />
-    <orderEntry type="library" name="xml-apis" level="application" />
-    <orderEntryProperties />
   </component>
 </module>
 

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

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

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

 package com.opensymphony.xwork.config;
 
 import com.opensymphony.util.FileManager;
-
 import com.opensymphony.xwork.config.impl.DefaultConfiguration;
 import com.opensymphony.xwork.config.providers.XmlConfigurationProvider;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
 
 /**
  * ConfigurationManager
+ *
  * @author Jason Carreira
- * Created Mar 1, 2003 1:06:04 AM
+ *         Created Mar 1, 2003 1:06:04 AM
  */
 public class ConfigurationManager {
     //~ Static fields/initializers /////////////////////////////////////////////
     }
 
     /**
-* Get the current XWork configuration object.  By default an instance of DefaultConfiguration will be returned
-* @see com.opensymphony.xwork.config.impl.DefaultConfiguration
-*/
+     * Get the current XWork configuration object.  By default an instance of DefaultConfiguration will be returned
+     *
+     * @see com.opensymphony.xwork.config.impl.DefaultConfiguration
+     */
     public static synchronized Configuration getConfiguration() {
         if (configurationInstance == null) {
             configurationInstance = new DefaultConfiguration();
     }
 
     /**
-* <p>
-* get the current list of ConfigurationProviders.
-* </p>
-* <p>
-* if no custom ConfigurationProviders have been added, this method
-* will return a list containing only the default ConfigurationProvider, XMLConfigurationProvider.  if a custom
-* ConfigurationProvider has been added, then the XmlConfigurationProvider must be added by hand.
-* </p>
-* @todo the lazy instantiation of XmlConfigurationProvider should be refactored to be elsewhere.  the behavior described above seems unintuitive.
-* @return the list of registered ConfigurationProvider objects
-* @see com.opensymphony.xwork.config.ConfigurationProvider
-*/
+     * <p/>
+     * get the current list of ConfigurationProviders.
+     * </p>
+     * <p/>
+     * if no custom ConfigurationProviders have been added, this method
+     * will return a list containing only the default ConfigurationProvider, XMLConfigurationProvider.  if a custom
+     * ConfigurationProvider has been added, then the XmlConfigurationProvider must be added by hand.
+     * </p>
+     *
+     * @return the list of registered ConfigurationProvider objects
+     * @todo the lazy instantiation of XmlConfigurationProvider should be refactored to be elsewhere.  the behavior described above seems unintuitive.
+     * @see com.opensymphony.xwork.config.ConfigurationProvider
+     */
     public static List getConfigurationProviders() {
         synchronized (configurationProviders) {
             if (configurationProviders.size() == 0) {
     }
 
     /**
-* adds a configuration provider to the List of ConfigurationProviders.  a given ConfigurationProvider may be added
-* more than once
-* @param provider the ConfigurationProvider to register
-*/
+     * adds a configuration provider to the List of ConfigurationProviders.  a given ConfigurationProvider may be added
+     * more than once
+     *
+     * @param provider the ConfigurationProvider to register
+     */
     public static void addConfigurationProvider(ConfigurationProvider provider) {
         synchronized (configurationProviders) {
             if (!configurationProviders.contains(provider)) {
     }
 
     /**
-* clears the registered ConfigurationProviders.  this method will call destroy() on each of the registered
-* ConfigurationProviders
-* @see com.opensymphony.xwork.config.ConfigurationProvider#destroy
-*/
+     * clears the registered ConfigurationProviders.  this method will call destroy() on each of the registered
+     * ConfigurationProviders
+     *
+     * @see com.opensymphony.xwork.config.ConfigurationProvider#destroy
+     */
     public static void clearConfigurationProviders() {
         synchronized (configurationProviders) {
             for (Iterator iterator = configurationProviders.iterator();
-                    iterator.hasNext();) {
+                 iterator.hasNext();) {
                 ConfigurationProvider provider = (ConfigurationProvider) iterator.next();
                 provider.destroy();
             }
     }
 
     /**
-* reloads the Configuration files if the configuration files indicate that they need to be reloaded.
-*
-* @todo as FileManager.setReloadingConfigs never appears to be set anywhere, will this ever do anything?
-* @todo it currently appears that the reload strategy is to check on each call to getConfiguration().  this seems extremely burdensome.  a caching mechanism should be implemented
-*/
+     * reloads the Configuration files if the configuration files indicate that they need to be reloaded.
+     *
+     * @todo as FileManager.setReloadingConfigs never appears to be set anywhere, will this ever do anything?
+     * @todo it currently appears that the reload strategy is to check on each call to getConfiguration().  this seems extremely burdensome.  a caching mechanism should be implemented
+     */
     private static synchronized void conditionalReload() {
         if (FileManager.isReloadingConfigs()) {
             boolean reload;
                 reload = false;
 
                 for (Iterator iterator = getConfigurationProviders().iterator();
-                        iterator.hasNext();) {
+                     iterator.hasNext();) {
                     ConfigurationProvider provider = (ConfigurationProvider) iterator.next();
 
                     if (provider.needsReload()) {

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

      * @return cached instance of the action method or null if method name was not specified
      */
     public Method getMethod() throws NoSuchMethodException {
-
         if (method != null) {
             return method;
         }
                 }
             }
         } else // return default execute() method if method name is not specified
-         {
+        {
             method = clazz.getMethod("execute", new Class[0]);
         }
 

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

 
 /**
  * DefaultConfiguration
+ *
  * @author Jason Carreira
- * Created Feb 24, 2003 7:38:06 AM
+ *         Created Feb 24, 2003 7:38:06 AM
  */
 public class DefaultConfiguration implements Configuration {
     //~ Static fields/initializers /////////////////////////////////////////////
     }
 
     /**
-    * Allows the configuration to clean up any resources used
-    */
+     * Allows the configuration to clean up any resources used
+     */
     public void destroy() {
     }
 
     }
 
     /**
-    * Calls the ConfigurationProviderFactory.getConfig() to tell it to reload the configuration and then calls
-    * buildRuntimeConfiguration().
-    * @throws ConfigurationException
-    */
+     * Calls the ConfigurationProviderFactory.getConfig() to tell it to reload the configuration and then calls
+     * buildRuntimeConfiguration().
+     *
+     * @throws ConfigurationException
+     */
     public synchronized void reload() throws ConfigurationException {
         packageContexts.clear();
 
         for (Iterator iterator = ConfigurationManager.getConfigurationProviders().iterator();
-                iterator.hasNext();) {
+             iterator.hasNext();) {
             ConfigurationProvider provider = (ConfigurationProvider) iterator.next();
             provider.init(this);
         }
 
         if (toBeRemoved != null) {
             for (Iterator iterator = packageContexts.values().iterator();
-                    iterator.hasNext();) {
+                 iterator.hasNext();) {
                 PackageConfig packageContext = (PackageConfig) iterator.next();
                 packageContext.removeParent(toBeRemoved);
             }
     }
 
     /**
-    * This methodName builds the internal runtime configuration used by Xwork for finding and configuring Actions from the
-    * programmatic configuration data structures. All of the old runtime configuration will be discarded and rebuilt.
-    */
+     * This methodName builds the internal runtime configuration used by Xwork for finding and configuring Actions from the
+     * programmatic configuration data structures. All of the old runtime configuration will be discarded and rebuilt.
+     */
     protected synchronized RuntimeConfiguration buildRuntimeConfiguration() throws ConfigurationException {
         Map namespaceActionConfigs = new HashMap();
 
         for (Iterator iterator = packageContexts.values().iterator();
-                iterator.hasNext();) {
+             iterator.hasNext();) {
             PackageConfig packageContext = (PackageConfig) iterator.next();
 
             if (!packageContext.isAbstract()) {
                 Map actionConfigs = packageContext.getAllActionConfigs();
 
                 for (Iterator actionIterator = actionConfigs.keySet().iterator();
-                        actionIterator.hasNext();) {
+                     actionIterator.hasNext();) {
                     String actionName = (String) actionIterator.next();
                     ActionConfig baseConfig = (ActionConfig) actionConfigs.get(actionName);
                     configs.put(actionName, buildFullActionConfig(packageContext, baseConfig));
         String defaultResult = packageContext.getFullDefaultResultType();
 
         for (Iterator iterator = results.entrySet().iterator();
-                iterator.hasNext();) {
+             iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
 
             if (entry.getValue() == null) {
     }
 
     /**
-    * Builds the full runtime actionconfig with all of the defaults and inheritance
-    * @param packageContext the PackageConfig which holds the base config we're building from
-    * @param baseConfig the ActionConfig which holds only the configuration specific to itself, without the defaults
-    * and inheritance
-    * @return a full ActionConfig for runtime configuration with all of the inherited and default params
-    */
+     * Builds the full runtime actionconfig with all of the defaults and inheritance
+     *
+     * @param packageContext the PackageConfig which holds the base config we're building from
+     * @param baseConfig     the ActionConfig which holds only the configuration specific to itself, without the defaults
+     *                       and inheritance
+     * @return a full ActionConfig for runtime configuration with all of the inherited and default params
+     */
     private ActionConfig buildFullActionConfig(PackageConfig packageContext, ActionConfig baseConfig) throws ConfigurationException {
         Map params = new HashMap(baseConfig.getParams());
         Map results = new HashMap(packageContext.getAllGlobalResults());
         }
 
         /**
-        * Gets the configuration information for an action name, or returns null if the
-        * name is not recognized.
-        *
-        * @param name the name of the action
-        * @param namespace the namespace for the action or null for the empty namespace, ""
-        * @return the configuration information for action requested
-        */
+         * Gets the configuration information for an action name, or returns null if the
+         * name is not recognized.
+         *
+         * @param name      the name of the action
+         * @param namespace the namespace for the action or null for the empty namespace, ""
+         * @return the configuration information for action requested
+         */
         public synchronized ActionConfig getActionConfig(String namespace, String name) {
             ActionConfig config = null;
             Map actions = (Map) namespaceActionConfigs.get((namespace == null) ? "" : namespace);
         }
 
         /**
-        * Gets the configuration settings for every action.
-        *
-        * @return a Map of namespace - > Map of ActionConfig objects, with the key being the action name
-        */
+         * Gets the configuration settings for every action.
+         *
+         * @return a Map of namespace - > Map of ActionConfig objects, with the key being the action name
+         */
         public synchronized Map getActionConfigs() {
             return namespaceActionConfigs;
         }
             StringBuffer buff = new StringBuffer("RuntimeConfiguration - actions are\n");
 
             for (Iterator iterator = namespaceActionConfigs.keySet().iterator();
-                    iterator.hasNext();) {
+                 iterator.hasNext();) {
                 String namespace = (String) iterator.next();
                 Map actionConfigs = (Map) namespaceActionConfigs.get(namespace);
 
                 for (Iterator iterator2 = actionConfigs.keySet().iterator();
-                        iterator2.hasNext();) {
+                     iterator2.hasNext();) {
                     buff.append(namespace + "/" + iterator2.next() + "\n");
                 }
             }

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

             Map resources = getResourceDependencies(clazz);
 
             for (Iterator iterator = resources.entrySet().iterator();
-                    iterator.hasNext();) {
+                 iterator.hasNext();) {
                 Map.Entry mapEntry = (Map.Entry) iterator.next();
                 Class depResource = (Class) mapEntry.getKey();
                 DefaultComponentManager newDcm = (DefaultComponentManager) mapEntry.getValue();
         }
 
         try {
-            enabler.getMethods()[0].invoke(resource, new Object[] {newResource});
+            enabler.getMethods()[0].invoke(resource, new Object[]{newResource});
         } catch (Exception e) {
             e.printStackTrace();
 

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

 
 /**
  * ConfigurationTest
- *
+ * <p/>
  * Created : Jan 27, 2003 1:30:08 AM
  *
  * @author Jason Carreira

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

     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
-    * attempt to load an xwork.xml file that has multilevel levels of inheritance and verify that the interceptors are
-    * correctly propagated through.
-    *
-    * @throws Exception
-    */
+     * attempt to load an xwork.xml file that has multilevel levels of inheritance and verify that the interceptors are
+     * correctly propagated through.
+     *
+     * @throws Exception
+     */
     public void testMultiLevelInheritance() throws Exception {
         final String filename = "com/opensymphony/xwork/config/providers/xwork-test-multilevel.xml";
         ConfigurationProvider provider = buildConfigurationProvider(filename);
         provider.init(configuration);
 
         /**
-        * for this test, we expect the action named, action3, in the namespace, namespace3, to have a single
-        * ParameterInterceptor.  The ParameterInterceptor, param, has been defined far up namespace3's parentage ...
-        * namespace3 -> namespace2 -> namespace1 -> default
-        */
+         * for this test, we expect the action named, action3, in the namespace, namespace3, to have a single
+         * ParameterInterceptor.  The ParameterInterceptor, param, has been defined far up namespace3's parentage ...
+         * namespace3 -> namespace2 -> namespace1 -> default
+         */
         PackageConfig packageConfig = configuration.getPackageConfig("namespace3");
         Assert.assertNotNull(packageConfig);
         assertEquals(2, packageConfig.getAllInterceptorConfigs().size());

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

 
 
 /**
- *
- *
  * @author $Author$
  * @version $Revision$
  */

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

 
 
 /**
- *
- *
  * @author $Author$
  * @version $Revision$
  */
         Dog dog = new Dog();
         dog.setAge(12);
         dog.setName("Rover");
-        dog.setChildAges(new int[] {1, 2});
+        dog.setChildAges(new int[]{1, 2});
 
         vs.push(dog);
         assertEquals("1, 2", vs.findValue("childAges", String.class));
         OgnlValueStack vs = new OgnlValueStack();
         vs.push(foo);
 
-        vs.setValue("strings", new String[] {"one", "two"});
+        vs.setValue("strings", new String[]{"one", "two"});
 
         assertNotNull(foo.getStrings());
         assertEquals("one", foo.getStrings().get(0));
         Dog dog = new Dog();
         dog.setAge(12);
         dog.setName("Rover");
-        dog.setChildAges(new int[] {1, 2});
+        dog.setChildAges(new int[]{1, 2});
         dog.setHates(cat);
 
         vs.push(dog);
 
         // relatives
         Foo fooA = new Foo();
-        foo.setRelatives(new Foo[] {fooA});
+        foo.setRelatives(new Foo[]{fooA});
 
         Foo fooB = new Foo();
-        foo2.setRelatives(new Foo[] {fooB});
+        foo2.setRelatives(new Foo[]{fooB});
 
         Foo fooC = new Foo();
-        foo3.setRelatives(new Foo[] {fooC});
+        foo3.setRelatives(new Foo[]{fooC});
 
         // the bar
         Bar bar = new Bar();
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.