commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1164254 - /commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/impl/CatalogBase.java
Date Thu, 01 Sep 2011 20:23:51 GMT
Author: simonetripodi
Date: Thu Sep  1 20:23:50 2011
New Revision: 1164254

URL: http://svn.apache.org/viewvc?rev=1164254&view=rev
Log:
fixed checkstyle violation: Variable 'commands' must be private and have accessor methods.
Variable 'commands' set final

Modified:
    commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/impl/CatalogBase.java

Modified: commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/impl/CatalogBase.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/impl/CatalogBase.java?rev=1164254&r1=1164253&r2=1164254&view=diff
==============================================================================
--- commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/impl/CatalogBase.java
(original)
+++ commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/impl/CatalogBase.java
Thu Sep  1 20:23:50 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.chain.impl;
 
+import static java.util.Collections.unmodifiableMap;
 
 import java.util.Iterator;
 import java.util.Map;
@@ -45,7 +46,7 @@ public class CatalogBase implements Cata
     /**
      * <p>The map of named {@link Command}s, keyed by name.
      */
-    protected Map<String, Command<? extends Context>> commands = new ConcurrentHashMap<String,
Command<? extends Context>>();
+    private final Map<String, Command<? extends Context>> commands = new ConcurrentHashMap<String,
Command<? extends Context>>();
 
 
     // --------------------------------------------------------- Constructors
@@ -102,6 +103,15 @@ public class CatalogBase implements Cata
 
     }
 
+    /**
+     * Returns the map of named {@link Command}s, keyed by name.
+     *
+     * @return The map of named {@link Command}s, keyed by name.
+     */
+    public Map<String, Command<? extends Context>> getCommands()
+    {
+        return unmodifiableMap(commands);
+    }
 
     /**
      * <p>Return an <code>Iterator</code> over the set of named commands



Mime
View raw message