commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1355373 - in /commons/proper/chain/trunk: apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/ apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/ apps/cookbook-examples/src/mai...
Date Fri, 29 Jun 2012 13:29:39 GMT
Author: simonetripodi
Date: Fri Jun 29 13:29:34 2012
New Revision: 1355373

URL: http://svn.apache.org/viewvc?rev=1355373&view=rev
Log:
[CHAIN-69] Fixed Checkstyle / PMD Warnings - patch submitted by Elijah Zupancic

Modified:
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/Controller.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/RequestHandler.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/ControllerCatalog.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/HandlerCommand.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/MailReader.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LocaleChange.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LogonUser.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/ProfileCheck.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/Profile.java
    commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/ProfileContext.java
    commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java
    commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java
    commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java
    commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ExampleServlet.java
    commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java
    commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java
    commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/DispatchLookupCommand.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/LookupCommand.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogFactoryBase.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ChainBase.java
    commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ContextBase.java
    commons/proper/chain/trunk/src/changes/changes.xml
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesGetLocaleCommand.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesSetLocaleCommand.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletGetLocaleCommand.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletSetLocaleCommand.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletWebContext.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ChainProcessor.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletGetLocaleCommand.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletSetLocaleCommand.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletWebContext.java

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/Controller.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/Controller.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/Controller.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/Controller.java Fri Jun 29 13:29:34 2012
@@ -18,6 +18,6 @@ package org.apache.commons.chain2.cookbo
 
 public interface Controller {
     void addHandler(RequestHandler handler);
-    RequestHandler getHandler(String name) throws ProcessException;
-    void process(Request request) throws ProcessException;
+    RequestHandler getHandler(String name);
+    void process(Request request);
 }

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/RequestHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/RequestHandler.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/RequestHandler.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/RequestHandler.java Fri Jun 29 13:29:34 2012
@@ -18,5 +18,5 @@ package org.apache.commons.chain2.cookbo
 
 public interface RequestHandler {
     String getName();
-    void handle(Request request) throws ProcessException;
+    void handle(Request request);
 }

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/ControllerCatalog.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/ControllerCatalog.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/ControllerCatalog.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/ControllerCatalog.java Fri Jun 29 13:29:34 2012
@@ -18,7 +18,6 @@ package org.apache.commons.chain2.cookbo
 
 import org.apache.commons.chain2.Command;
 import org.apache.commons.chain2.cookbook.agility.Controller;
-import org.apache.commons.chain2.cookbook.agility.ProcessException;
 import org.apache.commons.chain2.cookbook.agility.Request;
 import org.apache.commons.chain2.cookbook.agility.RequestHandler;
 import org.apache.commons.chain2.impl.CatalogBase;
@@ -27,10 +26,8 @@ public class ControllerCatalog extends C
         implements Controller {
 
     public RequestHandler getHandler(String name) {
-        @SuppressWarnings("unchecked")
-        RequestHandler handler = (RequestHandler) getCommand(name);
 
-        return handler;
+        return (RequestHandler) getCommand(name);
     }
 
     public void addHandler(RequestHandler handler) {
@@ -41,8 +38,11 @@ public class ControllerCatalog extends C
         this.addCommand(handler.getName(), command);
     }
 
-    public void process(Request request) throws ProcessException {
+    public void process(Request request) {
         RequestHandler handler = getHandler(request.getName());
-        if (handler != null) handler.handle(request);
+
+        if (handler != null) {
+            handler.handle(request);
+        }
     }
 }

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/HandlerCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/HandlerCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/HandlerCommand.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/agility/impl/HandlerCommand.java Fri Jun 29 13:29:34 2012
@@ -24,7 +24,7 @@ import org.apache.commons.chain2.cookboo
 
 public class HandlerCommand implements Command<String, Object, RequestContext>,
         RequestHandler {
-    String name =  null;
+    private String name =  null;
 
     public HandlerCommand(String name) {
         this.name = name;
@@ -34,7 +34,7 @@ public class HandlerCommand implements C
         return name;
     }
 
-    public void handle(Request request) throws ProcessException {
+    public void handle(Request request) {
         try {
             String name = request.getName();
             Response response = new ResponseContext(name);

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/MailReader.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/MailReader.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/MailReader.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/MailReader.java Fri Jun 29 13:29:34 2012
@@ -23,12 +23,14 @@ import java.util.Locale;
 
 public class MailReader extends ContextBase {
 
-    public static String LOCALE_KEY = "locale";
+    public static final String LOCALE_KEY = "locale";
 
     private Writer logger;
     private Locale locale;
 
-    public MailReader() {}
+    public MailReader() {
+
+    }
 
     public Locale getLocale() {
         return locale;

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LocaleChange.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LocaleChange.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LocaleChange.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LocaleChange.java Fri Jun 29 13:29:34 2012
@@ -31,8 +31,7 @@ public class LocaleChange implements Com
             Writer logger = mailReader.getLogger();
             logger.write("LocaleChange.execute ");
             logger.write("[Locale is: " + mailReader.getLocale() + "]\n");
-        }
-        catch (IOException ioe) {
+        } catch (IOException ioe) {
             throw new RuntimeException(ioe);
         }
 

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LogonUser.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LogonUser.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LogonUser.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/LogonUser.java Fri Jun 29 13:29:34 2012
@@ -28,8 +28,7 @@ public class LogonUser implements Comman
     public boolean execute(MailReader mailReader) {
         try {
             mailReader.getLogger().write("LogonUser.execute");
-        }
-        catch (IOException ioe) {
+        } catch (IOException ioe) {
             throw new RuntimeException(ioe);
         }
 

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/ProfileCheck.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/ProfileCheck.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/ProfileCheck.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/mailreader/commands/ProfileCheck.java Fri Jun 29 13:29:34 2012
@@ -28,8 +28,7 @@ public class ProfileCheck implements Com
     public boolean execute(MailReader mailReader) {
         try {
             mailReader.getLogger().write("ProfileCheck.execute\n");
-        }
-        catch (IOException ioe) {
+        } catch (IOException ioe) {
             throw new RuntimeException(ioe);
         }
 

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/Profile.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/Profile.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/Profile.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/Profile.java Fri Jun 29 13:29:34 2012
@@ -17,5 +17,5 @@
 package org.apache.commons.chain2.cookbook.profile;
 
 public class Profile {
-    public static String PROFILE_KEY = "profile";
+    public static final String PROFILE_KEY = "profile";
 }

Modified: commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/ProfileContext.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/ProfileContext.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/ProfileContext.java (original)
+++ commons/proper/chain/trunk/apps/cookbook-examples/src/main/java/org/apache/commons/chain2/cookbook/profile/ProfileContext.java Fri Jun 29 13:29:34 2012
@@ -21,7 +21,8 @@ import org.apache.commons.chain2.impl.Co
 public class ProfileContext extends ContextBase {
     private Profile profile;
 
-    public ProfileContext() {}
+    public ProfileContext() {
+    }
 
     public Profile getProfile() {
         return profile;

Modified: commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java (original)
+++ commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java Fri Jun 29 13:29:34 2012
@@ -65,7 +65,6 @@ public class CountCommand implements Com
      *
      * @param context The {@link Context} we are operating on
      * @return <code>false</code> so that processng will continue
-     * @throws Exception If an error occurs during execution.
      */
     public boolean execute(WebContext context) {
 

Modified: commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java (original)
+++ commons/proper/chain/trunk/apps/example1/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java Fri Jun 29 13:29:34 2012
@@ -65,7 +65,6 @@ public class ForwardCommand implements C
      *
      * @param context The {@link Context} we are operating on
      * @return <code>false</code> so that processng will continue
-     * @throws Exception If an error occurs during execution.
      */
     public boolean execute(ServletWebContext context) {
         try {

Modified: commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java (original)
+++ commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/CountCommand.java Fri Jun 29 13:29:34 2012
@@ -65,7 +65,6 @@ public class CountCommand implements Com
      *
      * @param context The {@link Context} we are operating on
      * @return <code>false</code> so that processng will continue
-     * @throws Exception If an error occurs during execution.
      */
     public boolean execute(WebContext context) {
 

Modified: commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ExampleServlet.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ExampleServlet.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ExampleServlet.java (original)
+++ commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ExampleServlet.java Fri Jun 29 13:29:34 2012
@@ -16,13 +16,6 @@
  */
 package org.apache.commons.chain2.apps.example;
 
-import java.io.IOException;
-import java.lang.Object;
-import java.lang.String;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.CatalogFactory;
 import org.apache.commons.chain2.Command;
@@ -30,6 +23,12 @@ import org.apache.commons.chain2.web.ser
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
 /**
  * Custom chain servlet implementation.
  */
@@ -67,7 +66,6 @@ public class ExampleServlet extends Http
      * @param response The response we are creating
      *
      * @exception IOException if an input/output error occurs
-     * @exception ServletException if a servlet exception occurs
      */
     public void service(HttpServletRequest request,
                         HttpServletResponse response)

Modified: commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java (original)
+++ commons/proper/chain/trunk/apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java Fri Jun 29 13:29:34 2012
@@ -25,10 +25,9 @@ import org.apache.commons.logging.LogFac
 import javax.servlet.ServletException;
 import javax.servlet.RequestDispatcher;
 import java.io.IOException;
-import java.lang.RuntimeException;
 
 /**
- * <p>Foo Command</p>
+ * <p>Forward Command</p>
  *
  * @version $Revision$ $Date$
  */
@@ -65,7 +64,6 @@ public class ForwardCommand implements C
      *
      * @param context The {@link Context} we are operating on
      * @return <code>false</code> so that processng will continue
-     * @throws Exception If an error occurs during execution.
      */
     public boolean execute(ServletWebContext context) {
         try {

Modified: commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java (original)
+++ commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java Fri Jun 29 13:29:34 2012
@@ -17,13 +17,13 @@
 package org.apache.commons.chain2.config;
 
 
-import java.util.Map;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.CatalogFactory;
 import org.apache.commons.digester3.Rule;
 import org.xml.sax.Attributes;
 
+import java.util.Map;
+
 
 /**
  * <p>Digester rule that will cause the top-most element on the Digester
@@ -96,7 +96,7 @@ class ConfigCatalogRule extends Rule {
         throws Exception {
 
         // Retrieve any current Catalog with the specified name
-        Catalog<Object, Object, Map<Object, Object>> catalog = null;
+        Catalog<Object, Object, Map<Object, Object>> catalog;
         CatalogFactory<Object, Object, Map<Object, Object>> factory = CatalogFactory.getInstance();
         String nameValue = attributes.getValue(nameAttribute);
         if (nameValue == null) {
@@ -112,7 +112,9 @@ class ConfigCatalogRule extends Rule {
             /* Convert catalog pulled from digester to default generic signature
              * with the assumption that the Catalog returned from digester will
              * comply with the the historic chain contract. */
-            Catalog<Object, Object, Map<Object, Object>> digesterCatalog = (Catalog<Object, Object, Map<Object, Object>>) clazz.newInstance();
+            @SuppressWarnings("unchecked")
+            Catalog<Object, Object, Map<Object, Object>> digesterCatalog =
+                    (Catalog<Object, Object, Map<Object, Object>>) clazz.newInstance();
 
             catalog = digesterCatalog;
 

Modified: commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java (original)
+++ commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java Fri Jun 29 13:29:34 2012
@@ -17,13 +17,13 @@
 package org.apache.commons.chain2.config;
 
 
-import java.net.URL;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.Context;
 import org.apache.commons.digester3.Digester;
 import org.apache.commons.digester3.RuleSet;
 
+import java.net.URL;
+
 
 /**
  * <p>Class to parse the contents of an XML configuration file (using
@@ -135,7 +135,11 @@ public class ConfigParser {
      * <code>RuleSet</code>, registering top level commands into the specified
      * {@link Catalog}.  Use this method <strong>only</strong> if you have
      * <strong>NOT</strong> included any <code>factory</code> element in your
-     * configuration resource, and wish to supply the catalog explictly.</p>
+     * configuration resource, and wish to supply the catalog explicitly.</p>
+     *
+     * @param <K> Context key type
+     * @param <V> Context value type
+     * @param <C> Type of the context associated with this command
      *
      * @param catalog {@link Catalog} into which configured chains are
      *  to be registered

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java Fri Jun 29 13:29:34 2012
@@ -16,14 +16,14 @@
  */
 package org.apache.commons.chain2;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
 import org.apache.commons.chain2.impl.CatalogFactoryBase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
 /**
  * <p>A {@link CatalogFactory} is a class used to store and retrieve
  * {@link Catalog}s.  The factory allows for a default {@link Catalog}
@@ -118,7 +118,6 @@ public abstract class CatalogFactory<K, 
      * more than one DELIMITER will cause an
      * <code>IllegalArgumentException</code> to be thrown.</p>
      *
-     * @param <C> Type of the context associated with this command
      * @param commandID the identifier of the command to return
      * @return the command located with commandID, or <code>null</code>
      *  if either the command name or the catalog name cannot be resolved
@@ -189,6 +188,9 @@ public abstract class CatalogFactory<K, 
      * instance for each application, even if this class is loaded from
      * a shared parent class loader.</p>
      *
+     * @param <K> Context key type
+     * @param <V> Context value type
+     * @param <C> Type of the context associated with this command
      * @return the per-application singleton instance of {@link CatalogFactory}
      */
     public static <K, V, C extends Map<K, V>> CatalogFactory<K, V, C> getInstance() {

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java Fri Jun 29 13:29:34 2012
@@ -49,6 +49,8 @@ import java.util.Map;
  * the <code>execute()</code> method of the {@link Chain} is first called.
  * After that, the configuration of the {@link Chain} is frozen.</p>
  *
+ * @param <K> Context key type
+ * @param <V> Context value type
  * @param <C> Type of the context associated with this command
  *
  * @author Craig R. McClanahan
@@ -105,9 +107,6 @@ public interface Chain<K, V, C extends M
      * @param context The {@link Context} to be processed by this
      *  {@link Chain}
      *
-     * @exception Exception if thrown by one of the {@link Command}s
-     *  in this {@link Chain} but not handled by a <code>postprocess()</code>
-     *  method of a {@link Filter}
      * @exception IllegalArgumentException if <code>context</code>
      *  is <code>null</code>
      *

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java Fri Jun 29 13:29:34 2012
@@ -42,12 +42,21 @@ public class ChainException extends Runt
      */
     private final Command<?, ?, ?> failedCommand;
 
+    /**
+     * Create an exception object with a message.
+     * @param message Message to associate with exception
+     */
     public ChainException(String message) {
         super(message);
         this.context = null;
         this.failedCommand = null;
     }
 
+    /**
+     * Create an exception object with a message and chain it to another exception.
+     * @param message Message to associate with exception
+     * @param cause Exception to chain to this exception
+     */
     public ChainException(String message, Throwable cause) {
         super(message, cause);
         this.context = null;
@@ -57,6 +66,9 @@ public class ChainException extends Runt
     /**
      * Constructs a new ChainException with references to the {@link Context}
      * and {@link Command} associated with the exception being wrapped (cause).
+     * @param <K> Context key type
+     * @param <V> Context value type
+     * @param <C> Type of the context associated with this command
      * @param   message   the detail message. The detail message is saved for
      *          later retrieval by the {@link #getMessage()} method.
      * @param cause the cause (which is saved for later retrieval by the

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/DispatchLookupCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/DispatchLookupCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/DispatchLookupCommand.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/DispatchLookupCommand.java Fri Jun 29 13:29:34 2012
@@ -144,7 +144,7 @@ public class DispatchLookupCommand<K, V,
      * @throws DispatchException if no such {@link Command} can be found and the
      *  <code>optional</code> property is set to <code>false</code>
      */
-	@Override
+    @Override
     public boolean execute(C context) {
 
         if (this.getMethod() == null && this.getMethodKey() == null) {
@@ -158,7 +158,7 @@ public class DispatchLookupCommand<K, V,
                 Method methodObject = extractMethod(command, context);
                 Object obj = methodObject.invoke(command, getArguments(context));
 
-                Boolean result = (Boolean)obj;
+                Boolean result = (Boolean) obj;
                 return (result != null && result);
 
             } catch (NoSuchMethodException e) {
@@ -168,7 +168,7 @@ public class DispatchLookupCommand<K, V,
             } catch (InvocationTargetException e) {
                 Throwable cause = e.getTargetException();
                 throw new DispatchException("Error in reflected dispatched command", cause, context, this);
-        }
+            }
 
         } else {
             return false;

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/LookupCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/LookupCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/LookupCommand.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/generic/LookupCommand.java Fri Jun 29 13:29:34 2012
@@ -17,14 +17,14 @@
 package org.apache.commons.chain2.generic;
 
 
-import java.util.Map;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.CatalogFactory;
 import org.apache.commons.chain2.Command;
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.Filter;
 
+import java.util.Map;
+
 
 /**
  * <p>Look up a specified {@link Command} (which could also be a
@@ -42,6 +42,8 @@ import org.apache.commons.chain2.Filter;
  * silently ignored.  Otherwise, a lookup failure will trigger an
  * <code>IllegalArgumentException</code>.</p>
  *
+ * @param <K> Context key type
+ * @param <V> Context value type
  * @param <C> Type of the context associated with this command
  *
  * @author Craig R. McClanahan
@@ -337,10 +339,7 @@ public class LookupCommand<K, V, C exten
         if (command != null) {
             if (command instanceof Filter) {
                 boolean result = (((Filter<K, V, C>) command).postprocess(context, exception));
-                if (isIgnorePostprocessResult()) {
-                    return false;
-                }
-                return result;
+                return !isIgnorePostprocessResult() && result;
             }
         }
         return (false);
@@ -391,7 +390,6 @@ public class LookupCommand<K, V, C exten
     /**
      * <p>Return the {@link Command} instance to be delegated to.</p>
      *
-     * @param <C> Type of the context associated with this command
      * @param context {@link Context} for this request
      * @return The looked-up Command.
      * @exception IllegalArgumentException if no such {@link Command}
@@ -402,7 +400,7 @@ public class LookupCommand<K, V, C exten
 
         Catalog<K, V, C> catalog = getCatalog(context);
 
-        Command<K, V, C> command = null;
+        Command<K, V, C> command;
         String name = getCommandName(context);
         if (name != null) {
             command = catalog.getCommand(name);

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogFactoryBase.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogFactoryBase.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogFactoryBase.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogFactoryBase.java Fri Jun 29 13:29:34 2012
@@ -27,6 +27,9 @@ import org.apache.commons.chain2.Catalog
 /**
  * <p>A simple implementation of {@link CatalogFactory}.</p>
  *
+ * @param <K> Context key type
+ * @param <V> Context value type
+ * @param <C> Type of the context associated with this command
  * @author Sean Schofield
  * @version $Revision$ $Date$
  */
@@ -41,7 +44,8 @@ public class CatalogFactoryBase<K, V, C 
      * <p>Construct an empty instance of {@link CatalogFactoryBase}.  This
      * constructor is intended solely for use by {@link CatalogFactory}.</p>
      */
-    public CatalogFactoryBase() { }
+    public CatalogFactoryBase() {
+    }
 
 
     // ----------------------------------------------------- Instance Variables
@@ -95,7 +99,7 @@ public class CatalogFactoryBase<K, V, C 
      * @param name the name of the Catalog to retrieve
      * @return the specified Catalog
      */
-	@Override
+    @Override
     public Catalog<K, V, C> getCatalog(String name) {
 
         return catalogs.get(name);
@@ -107,12 +111,12 @@ public class CatalogFactoryBase<K, V, C 
      * <p>Adds a named instance of Catalog to the factory (for subsequent
      * retrieval later).</p>
      *
-     * @param name the name of the Catalog to add
+     * @param name    the name of the Catalog to add
      * @param catalog the Catalog to add
      */
     public void addCatalog(String name, Catalog<K, V, C> catalog) {
 
-            catalogs.put(name, catalog);
+        catalogs.put(name, catalog);
 
     }
 
@@ -121,11 +125,12 @@ public class CatalogFactoryBase<K, V, C 
      * <p>Return an <code>Iterator</code> over the set of named
      * {@link Catalog}s known to this {@link CatalogFactory}.
      * If there are no known catalogs, an empty Iterator is returned.</p>
+     *
      * @return An Iterator of the names of the Catalogs known by this factory.
      */
     public Iterator<String> getNames() {
 
-            return catalogs.keySet().iterator();
+        return catalogs.keySet().iterator();
 
     }
 

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ChainBase.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ChainBase.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ChainBase.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ChainBase.java Fri Jun 29 13:29:34 2012
@@ -16,8 +16,11 @@
  */
 package org.apache.commons.chain2.impl;
 
-import static java.lang.String.format;
-import org.apache.commons.chain2.*;
+import org.apache.commons.chain2.Chain;
+import org.apache.commons.chain2.Command;
+import org.apache.commons.chain2.Context;
+import org.apache.commons.chain2.Filter;
+import org.apache.commons.chain2.ChainException;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -157,7 +160,6 @@ public class ChainBase<K, V, C extends M
      * @param context The {@link Context} to be processed by this
      *  {@link Chain}
      *
-     * @throws Exception if thrown by one of the {@link Command}s
      *  in this {@link Chain} but not handled by a <code>postprocess()</code>
      *  method of a {@link Filter}
      * @throws IllegalArgumentException if <code>context</code>
@@ -203,7 +205,7 @@ public class ChainBase<K, V, C extends M
             i--;
         }
         boolean handled = false;
-        boolean result = false;
+        boolean result;
         for (int j = i; j >= 0; j--) {
             if (commands.get(j) instanceof Filter) {
                 try {
@@ -248,7 +250,7 @@ public class ChainBase<K, V, C extends M
 
         String msg = failedCommand == null ?
                         "An error occurred when executing the chain" :
-                        format("An error occurred when executing the command %s in the chain",
+                        String.format("An error occurred when executing the command %s in the chain",
                                failedCommand.getClass().getName());
 
         return new ChainException(msg, unhandled, context, failedCommand);

Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ContextBase.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ContextBase.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ContextBase.java (original)
+++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/ContextBase.java Fri Jun 29 13:29:34 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.chain2.impl;
 
+import org.apache.commons.chain2.Context;
 
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
@@ -30,9 +31,6 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.chain2.Context;
-
-
 /**
  * <p>Convenience base class for {@link Context} implementations.</p>
  *
@@ -187,17 +185,16 @@ public class ContextBase extends Context
         // Case 1 -- no local properties
         if (descriptors == null) {
             return (super.containsValue(value));
-        }
 
         // Case 2 -- value found in the underlying Map
-        else if (super.containsValue(value)) {
+        } else if (super.containsValue(value)) {
             return (true);
         }
 
         // Case 3 -- check the values of our readable properties
-        for (int i = 0; i < pd.length; i++) {
-            if (pd[i].getReadMethod() != null) {
-                Object prop = readProperty(pd[i]);
+        for (PropertyDescriptor aPd : pd) {
+            if (aPd.getReadMethod() != null) {
+                Object prop = readProperty(aPd);
                 if (value == null) {
                     if (prop == null) {
                         return (true);

Modified: commons/proper/chain/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/src/changes/changes.xml?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/src/changes/changes.xml (original)
+++ commons/proper/chain/trunk/src/changes/changes.xml Fri Jun 29 13:29:34 2012
@@ -40,6 +40,9 @@ The <action> type attribute can be add,u
   <body>
 
     <release version="2.0" description="Major release">
+      <action dev="simonetripodi" type="add" issue="CHAIN-69" due-to="Elijah Zupancic">
+        Fixed Checkstyle / PMD Warnings
+      </action>
       <action dev="simonetripodi" type="add" issue="CHAIN-68" due-to="Elijah Zupancic">
         SNAPSHOT tomcat plugin breaks the build
       </action>

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java Fri Jun 29 13:29:34 2012
@@ -17,15 +17,6 @@
 package org.apache.commons.chain2.web;
 
 
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.CatalogFactory;
 import org.apache.commons.chain2.config.ConfigParser;
@@ -35,6 +26,14 @@ import org.apache.commons.digester3.Rule
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
 
 /**
  * <p><code>ServletContextListener</code> that automatically
@@ -58,7 +57,7 @@ import org.apache.commons.logging.LogFac
  *     contain <code>&lt;catalog&gt;</code> elements (which will
  *     cause registration of the created {@link Catalog}s into
  *     the {@link CatalogFactory} for this application, and no
- *     servet context attribute will be created.
+ *     servlet context attribute will be created.
  *     <strong>NOTE</strong> - This parameter is deprecated.</p>
  * <li><strong>org.apache.commons.chain2.RULE_SET</strong> -
  *     Fully qualified class name of a Digester <code>RuleSet</code>
@@ -78,7 +77,7 @@ import org.apache.commons.logging.LogFac
  * <li>Resources loaded from specified resource paths from the
  *     webapp's class loader (via <code>ClassLoader.getResource()</code>).</li>
  * <li>Resources loaded from specified resource paths in the web application
- *     archive (via <code>ServetContext.getResource()</code>).</li>
+ *     archive (via <code>ServletContext.getResource()</code>).</li>
  * </ul>
  *
  * <p>If no attribute key is specified, on the other hand, parsed configuration
@@ -184,7 +183,11 @@ public class ChainListener implements Se
         // Retrieve or create the Catalog instance we may be updating
         Catalog<String, Object, ServletWebContext> catalog = null;
         if (attr != null) {
+
+            /* Assume that we are getting an object of the type Catalog from the context's
+             * attribute because that is the historical contract. */
             catalog = (Catalog<String, Object, ServletWebContext>) context.getAttribute(attr);
+
             if (catalog == null) {
                 catalog = new CatalogBase<String, Object, ServletWebContext>();
             }
@@ -249,74 +252,11 @@ public class ChainListener implements Se
         if (jars == null) {
             jars = new HashSet<String>();
         }
-        String path = null;
-        Iterator<String> paths = jars.iterator();
-        while (paths.hasNext()) {
-
-            path = paths.next();
-            if (!path.endsWith(".jar")) {
-                continue;
-            }
-            URL resourceURL = null;
-            try {
-                URL jarURL = context.getResource(path);
-                resourceURL = new URL("jar:"
-                                      + translate(jarURL.toExternalForm())
-                                      + "!/META-INF/chain-config.xml");
-                InputStream is = null;
-                try {
-                    is = resourceURL.openStream();
-                } catch (Exception e) {
-                      // means there is no such resource
-                }
-                if (is == null) {
-                    if (log.isDebugEnabled()) {
-                        log.debug("Not Found: " + resourceURL);
-                    }
-                    continue;
-                } else {
-                    is.close();
-                }
-                if (log.isDebugEnabled()) {
-                    log.debug("Parsing: " + resourceURL);
-                }
-                parser.parse(resourceURL);
-            } catch (Exception e) {
-                throw new RuntimeException
-                    ("Exception parsing chain config resource '"
-                     + resourceURL.toExternalForm() + "': "
-                     + e.getMessage());
-            }
-        }
-
-    }
+        String path;
 
+        for (String jar : jars) {
 
-    /**
-     * <p>Parse resources found in JAR files in the <code>/WEB-INF/lib</code>
-     * subdirectory (if any).</p>
-     *
-     * @param catalog {@link Catalog} we are populating
-     * @param context <code>ServletContext</code> for this web application
-     * @param parser {@link ConfigParser} to use for parsing
-     *
-     * @deprecated Use the variant that does not take a catalog, on a
-     *  configuration resource containing "catalog" element(s)
-     */
-    @Deprecated
-    private void parseJarResources(Catalog catalog, ServletContext context,
-                                   ConfigParser parser, Log log) {
-
-        @SuppressWarnings( "unchecked" ) // it is known that always returns String inside
-        Set<String> jars = context.getResourcePaths("/WEB-INF/lib");
-        if (jars == null) {
-            jars = new HashSet<String>();
-        }
-        String path = null;
-        Iterator<String> paths = jars.iterator();
-        while (paths.hasNext()) {
-
-            path = paths.next();
+            path = jar;
             if (!path.endsWith(".jar")) {
                 continue;
             }
@@ -324,13 +264,13 @@ public class ChainListener implements Se
             try {
                 URL jarURL = context.getResource(path);
                 resourceURL = new URL("jar:"
-                                      + translate(jarURL.toExternalForm())
-                                      + "!/META-INF/chain-config.xml");
+                        + translate(jarURL.toExternalForm())
+                        + "!/META-INF/chain-config.xml");
                 InputStream is = null;
                 try {
                     is = resourceURL.openStream();
                 } catch (Exception e) {
-                      // means there is no such resource
+                    // means there is no such resource
                 }
                 if (is == null) {
                     if (log.isDebugEnabled()) {
@@ -343,18 +283,17 @@ public class ChainListener implements Se
                 if (log.isDebugEnabled()) {
                     log.debug("Parsing: " + resourceURL);
                 }
-                parser.parse(catalog, resourceURL);
+                parser.parse(resourceURL);
             } catch (Exception e) {
                 throw new RuntimeException
-                    ("Exception parsing chain config resource '"
-                     + resourceURL.toExternalForm() + "': "
-                     + e.getMessage());
+                        ("Exception parsing chain config resource '"
+                                + resourceURL.toExternalForm() + "': "
+                                + e.getMessage());
             }
         }
 
     }
 
-
     /**
      * <p>Translate space character into <code>&pct;20</code> to avoid problems
      * with paths that contain spaces on some JVMs.</p>

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesGetLocaleCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesGetLocaleCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesGetLocaleCommand.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesGetLocaleCommand.java Fri Jun 29 13:29:34 2012
@@ -17,19 +17,16 @@
 package org.apache.commons.chain2.web.faces;
 
 
-import java.util.Locale;
-
-import javax.faces.context.FacesContext;
-
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.web.AbstractGetLocaleCommand;
 
+import javax.faces.context.FacesContext;
+import java.util.Locale;
+
 
 /**
  * <p>Concrete implementation of {@link AbstractGetLocaleCommand} for
  * the JavaServer Faces API.</p>
- *
- * @param <C> Type of the context associated with this command
  */
 
 public class FacesGetLocaleCommand
@@ -47,9 +44,9 @@ public class FacesGetLocaleCommand
      */
     protected Locale getLocale(FacesWebContext context) {
 
-    FacesContext fcontext = (FacesContext)
-        context.get("context");
-    return (fcontext.getViewRoot().getLocale());
+        FacesContext fcontext = (FacesContext)context.get("context");
+
+        return (fcontext.getViewRoot().getLocale());
 
     }
 

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesSetLocaleCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesSetLocaleCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesSetLocaleCommand.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/faces/FacesSetLocaleCommand.java Fri Jun 29 13:29:34 2012
@@ -17,18 +17,17 @@
 package org.apache.commons.chain2.web.faces;
 
 
-import java.util.Locale;
-import javax.faces.context.FacesContext;
-
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.web.AbstractSetLocaleCommand;
 
+import javax.faces.context.FacesContext;
+import java.util.Locale;
+
 
 /**
  * <p>Concrete implementation of {@link AbstractSetLocaleCommand} for
  * the JavaServer Faces API.</p>
  *
- * @param <C> Type of the context associated with this command
  */
 
 public class FacesSetLocaleCommand
@@ -46,11 +45,9 @@ public class FacesSetLocaleCommand
      */
     protected void setLocale(FacesWebContext context, Locale locale) {
 
-    FacesContext fcontext = (FacesContext)
-        context.get("context");
-    fcontext.getViewRoot().setLocale(locale);
+        FacesContext fcontext = (FacesContext)context.get("context");
+        fcontext.getViewRoot().setLocale(locale);
 
     }
 
-
 }

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletGetLocaleCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletGetLocaleCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletGetLocaleCommand.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletGetLocaleCommand.java Fri Jun 29 13:29:34 2012
@@ -17,18 +17,17 @@
 package org.apache.commons.chain2.web.portlet;
 
 
-import java.util.Locale;
-import javax.portlet.PortletRequest;
-
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.web.AbstractGetLocaleCommand;
 
+import javax.portlet.PortletRequest;
+import java.util.Locale;
+
 
 /**
  * <p>Concrete implementation of {@link AbstractGetLocaleCommand} for
  * the Portlet API.</p>
  *
- * @param <C> Type of the context associated with this command
  */
 
 public class PortletGetLocaleCommand
@@ -46,9 +45,8 @@ public class PortletGetLocaleCommand
      */
     protected Locale getLocale(PortletWebContext context) {
 
-    PortletRequest request = (PortletRequest)
-        context.get("request");
-    return (request.getLocale());
+        PortletRequest request = (PortletRequest)context.get("request");
+        return (request.getLocale());
 
     }
 

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletSetLocaleCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletSetLocaleCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletSetLocaleCommand.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletSetLocaleCommand.java Fri Jun 29 13:29:34 2012
@@ -17,18 +17,18 @@
 package org.apache.commons.chain2.web.portlet;
 
 
-import java.util.Locale;
-//import javax.portlet.PortletResponse;
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.web.AbstractSetLocaleCommand;
 
+import java.util.Locale;
+
+//import javax.portlet.PortletResponse;
+
 
 /**
  * <p>Concrete implementation of {@link AbstractSetLocaleCommand} for
  * the Portlet API.</p>
  *
- * @param <C> Type of the context associated with this command
- *
  */
 
 public class PortletSetLocaleCommand
@@ -46,10 +46,10 @@ public class PortletSetLocaleCommand
      */
     protected void setLocale(PortletWebContext context, Locale locale) {
 
-    // PortletResponse response = (PortletResponse)
-    //    context.get("response");
-    //  response.setLocale(locale);
-    // Not supported by the Portlet API
+        // PortletResponse response = (PortletResponse)
+        //    context.get("response");
+        //  response.setLocale(locale);
+        // Not supported by the Portlet API
 
     }
 

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletWebContext.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletWebContext.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletWebContext.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/portlet/PortletWebContext.java Fri Jun 29 13:29:34 2012
@@ -17,14 +17,14 @@
 package org.apache.commons.chain2.web.portlet;
 
 
-import java.util.Collections;
-import java.util.Map;
+import org.apache.commons.chain2.web.WebContext;
+
 import javax.portlet.PortletContext;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
 import javax.servlet.http.Cookie;
-
-import org.apache.commons.chain2.web.WebContext;
+import java.util.Collections;
+import java.util.Map;
 
 
 /**
@@ -41,7 +41,7 @@ public class PortletWebContext extends W
 
 
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = -6928446126906631819L;
 
@@ -375,6 +375,4 @@ public class PortletWebContext extends W
 
     }
 
-
-
 }

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ChainProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ChainProcessor.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ChainProcessor.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ChainProcessor.java Fri Jun 29 13:29:34 2012
@@ -17,17 +17,16 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import java.io.IOException;
+import org.apache.commons.chain2.Catalog;
+import org.apache.commons.chain2.CatalogFactory;
+import org.apache.commons.chain2.Command;
+import org.apache.commons.chain2.web.ChainServlet;
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.chain2.Catalog;
-import org.apache.commons.chain2.CatalogFactory;
-import org.apache.commons.chain2.Command;
-import org.apache.commons.chain2.web.ChainServlet;
+import java.io.IOException;
 
 
 /**
@@ -176,13 +175,12 @@ public class ChainProcessor extends Chai
      * @exception ServletException if a servlet exception occurs
      */
     @Override
-    public void service(HttpServletRequest request,
-                        HttpServletResponse response)
+    public void service(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
 
         ServletWebContext context =
             new ServletWebContext(getServletContext(), request, response);
-        Catalog<String, Object, ServletWebContext> theCatalog = null;
+        Catalog<String, Object, ServletWebContext> theCatalog;
 
         if (attribute != null) {
             ServletContext servletContext = getServletContext();
@@ -198,8 +196,7 @@ public class ChainProcessor extends Chai
                 Catalog<String, Object, ServletWebContext> attributeCatalog =
                      (Catalog<String, Object, ServletWebContext>)testAttribute;
                 theCatalog = attributeCatalog;
-            }
-            else {
+            } else {
                 String msg = "The object stored as the attribute [" +
                         attribute + "] was not of the expected type [" +
                         "Catalog]";

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java Fri Jun 29 13:29:34 2012
@@ -17,13 +17,13 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.Command;
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.generic.LookupCommand;
 
+import javax.servlet.http.HttpServletRequest;
+
 
 /**
  * <p>{@link Command} that uses the "path info" component of the request URI
@@ -34,7 +34,6 @@ import org.apache.commons.chain2.generic
  * an environment, a request for the context-relative URI "/execute/foo"
  * would cause the "/foo" command to be loaded and executed.</p>
  *
- * @param <C> Type of the context associated with this command
  * @author Craig R. McClanahan
  */
 
@@ -125,7 +124,8 @@ public class PathInfoMapper extends Look
         /* Assume that the object returned will be a catalog because of chain's
          * historical contract. */
         @SuppressWarnings("unchecked")
-        Catalog<String, Object, ServletWebContext> catalog = (Catalog<String, Object, ServletWebContext>) context.get(getCatalogName());
+        Catalog<String, Object, ServletWebContext> catalog =
+                (Catalog<String, Object, ServletWebContext>) context.get(getCatalogName());
         if (catalog == null) {
             catalog = super.getCatalog(context);
         }

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java Fri Jun 29 13:29:34 2012
@@ -17,13 +17,13 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.Command;
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.generic.LookupCommand;
 
+import javax.servlet.http.HttpServletRequest;
+
 
 /**
  * <p>{@link Command} that uses a specified request parameter
@@ -35,7 +35,6 @@ import org.apache.commons.chain2.generic
  * "/foo.execute?command=bar" would cause the "/bar" command to be loaded
  * and executed.</p>
  *
- * @param <C> Type of the context associated with this command
  * @author Craig R. McClanahan
  */
 
@@ -150,7 +149,8 @@ public class RequestParameterMapper
         /* Assume that the returned value will be null or of a valid catalog
          * type according to chain's historical contract. */
         @SuppressWarnings("unchecked")
-        Catalog<String, Object, ServletWebContext> catalog = (Catalog<String, Object, ServletWebContext>) context.get(getCatalogKey());
+        Catalog<String, Object, ServletWebContext> catalog =
+                (Catalog<String, Object, ServletWebContext>) context.get(getCatalogKey());
 
         if (catalog == null) {
             catalog = super.getCatalog(context);

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletGetLocaleCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletGetLocaleCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletGetLocaleCommand.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletGetLocaleCommand.java Fri Jun 29 13:29:34 2012
@@ -17,19 +17,17 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import java.util.Locale;
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.web.AbstractGetLocaleCommand;
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.Locale;
+
 
 /**
  * <p>Concrete implementation of {@link AbstractGetLocaleCommand} for
  * the Servlet API.</p>
  *
- * @param <C> Type of the context associated with this command
- *
  */
 
 public class ServletGetLocaleCommand
@@ -47,9 +45,9 @@ public class ServletGetLocaleCommand
      */
     protected Locale getLocale(ServletWebContext context) {
 
-    HttpServletRequest request = (HttpServletRequest)
-        context.get("request");
-    return (request.getLocale());
+        HttpServletRequest request = (HttpServletRequest)
+            context.get("request");
+        return (request.getLocale());
 
     }
 

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java Fri Jun 29 13:29:34 2012
@@ -17,13 +17,13 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.Command;
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.generic.LookupCommand;
 
+import javax.servlet.http.HttpServletRequest;
+
 
 /**
  * <p>{@link Command} that uses the "servlet path" component of the request URI
@@ -34,7 +34,6 @@ import org.apache.commons.chain2.generic
  * an environment, a request for a context relative URI of "/foo.execute"
  * would cause the "/foo.execute" command to be loaded and executed.</p>
  *
- * @param <C> Type of the context associated with this command
  * @author Craig R. McClanahan
  */
 
@@ -91,7 +90,7 @@ public class ServletPathMapper extends L
      * <p>Look up the servlet path information for this request, and use it to
      * select an appropriate {@link Command} to be executed.
      *
-     * @param context Context for the current request
+     * @param swcontext Context for the current request
      * @return The name of the {@link Command} instance
      *
      * @since Chain 1.2

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletSetLocaleCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletSetLocaleCommand.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletSetLocaleCommand.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletSetLocaleCommand.java Fri Jun 29 13:29:34 2012
@@ -17,19 +17,17 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import java.util.Locale;
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.commons.chain2.Context;
 import org.apache.commons.chain2.web.AbstractSetLocaleCommand;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.Locale;
+
 
 /**
  * <p>Concrete implementation of {@link AbstractSetLocaleCommand} for
  * the Servlet API.</p>
  *
- * @param <C> Type of the context associated with this command
- *
  */
 
 public class ServletSetLocaleCommand
@@ -47,9 +45,9 @@ public class ServletSetLocaleCommand
      */
     protected void setLocale(ServletWebContext context, Locale locale) {
 
-    HttpServletResponse response = (HttpServletResponse)
-        context.get("response");
-    response.setLocale(locale);
+        HttpServletResponse response = (HttpServletResponse)
+            context.get("response");
+        response.setLocale(locale);
 
     }
 

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletWebContext.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletWebContext.java?rev=1355373&r1=1355372&r2=1355373&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletWebContext.java (original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletWebContext.java Fri Jun 29 13:29:34 2012
@@ -17,13 +17,13 @@
 package org.apache.commons.chain2.web.servlet;
 
 
-import java.util.Map;
+import org.apache.commons.chain2.web.WebContext;
+
 import javax.servlet.ServletContext;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.chain2.web.WebContext;
+import java.util.Map;
 
 
 /**
@@ -38,10 +38,6 @@ import org.apache.commons.chain2.web.Web
 
 public class ServletWebContext extends WebContext {
 
-
-    /**
-     * 
-     */
     private static final long serialVersionUID = 5852676730841544890L;
 
 
@@ -383,5 +379,4 @@ public class ServletWebContext extends W
     }
 
 
-
 }



Mime
View raw message