• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision273 (tree)
Time2016-05-03 22:33:58
Authort_nakayama1971

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/DispatchLookupCommand.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/DispatchLookupCommand.java (revision 273)
@@ -14,6 +14,7 @@
1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+
1718 package org.apache.commons.chain2.base;
1819
1920 import org.apache.commons.chain2.CatalogFactory;
@@ -49,34 +50,16 @@
4950 * silently ignored. Otherwise, a lookup failure will trigger an
5051 * <code>IllegalArgumentException</code>.</p>
5152 *
53+ * @version $Id$
5254 * @param <K> the type of keys maintained by the context associated with this catalog
5355 * @param <V> the type of mapped values
5456 * @param <C> Type of the context associated with this command
5557 *
56- * @version $Id$
5758 * @since Chain 1.1
5859 */
5960 public class DispatchLookupCommand<K, V, C extends Context<K, V>>
6061 extends LookupCommand<K, V, C> {
6162
62- // -------------------------------------------------------------- Constructors
63-
64- /**
65- * Create an instance with an unspecified <code>catalogFactory</code> property.
66- * This property can be set later using <code>setProperty</code>, or if it is not set,
67- * the static singleton instance from <code>CatalogFactory.getInstance()</code> will be used.
68- */
69- public DispatchLookupCommand() { super(); }
70-
71- /**
72- * Create an instance and initialize the <code>catalogFactory</code> property
73- * to given <code>factory</code>.
74- * @param factory The Catalog Factory.
75- */
76- public DispatchLookupCommand(CatalogFactory<K, V, C> factory) {
77- super(factory);
78- }
79-
8063 // ------------------------------------------------------- Static Variables
8164
8265 /**
@@ -95,12 +78,32 @@
9578
9679 private String methodKey = null;
9780
81+ // -------------------------------------------------------------- Constructors
82+
9883 /**
84+ * Create an instance with an unspecified <code>catalogFactory</code> property.
85+ * This property can be set later using <code>setProperty</code>, or if it is not set,
86+ * the static singleton instance from <code>CatalogFactory.getInstance()</code> will be used.
87+ */
88+ public DispatchLookupCommand() {
89+ super();
90+ }
91+
92+ /**
93+ * Create an instance and initialize the <code>catalogFactory</code> property
94+ * to given <code>factory</code>.
95+ * @param factory The Catalog Factory.
96+ */
97+ public DispatchLookupCommand(final CatalogFactory<K, V, C> factory) {
98+ super(factory);
99+ }
100+
101+ /**
99102 * Return the method name.
100103 * @return The method name.
101104 */
102105 public String getMethod() {
103- return method;
106+ return this.method;
104107 }
105108
106109 /**
@@ -108,23 +111,23 @@
108111 * @return The Context key for the method name.
109112 */
110113 public String getMethodKey() {
111- return methodKey;
114+ return this.methodKey;
112115 }
113116
114117 /**
115118 * Set the method name.
116- * @param method The method name.
119+ * @param val The method name.
117120 */
118- public void setMethod(String method) {
119- this.method = method;
121+ public void setMethod(final String val) {
122+ this.method = val;
120123 }
121124
122125 /**
123126 * Set the Context key for the method name.
124- * @param methodKey The Context key for the method name.
127+ * @param val The Context key for the method name.
125128 */
126- public void setMethodKey(String methodKey) {
127- this.methodKey = methodKey;
129+ public void setMethodKey(final String val) {
130+ this.methodKey = val;
128131 }
129132
130133 // --------------------------------------------------------- Public Methods
@@ -140,9 +143,10 @@
140143 * <code>optional</code> property is set to <code>false</code>
141144 */
142145 @Override
143- public Processing execute(C context) {
146+ public Processing execute(final C context) {
144147 if (this.getMethod() == null && this.getMethodKey() == null) {
145- throw new IllegalStateException("Neither 'method' nor 'methodKey' properties are defined");
148+ throw new IllegalStateException(
149+ "Neither 'method' nor 'methodKey' properties are defined");
146150 }
147151
148152 Command<K, V, C> command = getCommand(context);
@@ -152,19 +156,21 @@
152156 Method methodObject = extractMethod(command, context);
153157 Object obj = methodObject.invoke(command, getArguments(context));
154158
155- if(obj instanceof Processing) {
159+ if (obj instanceof Processing) {
156160 Processing result = (Processing) obj;
157161 return result;
158162 }
159163 return Processing.CONTINUE;
160164
161- } catch (NoSuchMethodException e) {
162- throw new DispatchException("Error extracting method from context", e, context, this);
163- } catch (IllegalAccessException e) {
165+ } catch (final NoSuchMethodException e) {
166+ throw new DispatchException(
167+ "Error extracting method from context", e, context, this);
168+ } catch (final IllegalAccessException e) {
164169 throw new DispatchException("Error accessing method", e, context, this);
165- } catch (InvocationTargetException e) {
170+ } catch (final InvocationTargetException e) {
166171 Throwable cause = e.getTargetException();
167- throw new DispatchException("Error in reflected dispatched command", cause, context, this);
172+ throw new DispatchException(
173+ "Error in reflected dispatched command", cause, context, this);
168174 }
169175 }
170176 return Processing.CONTINUE;
@@ -195,7 +201,7 @@
195201 * @param context The context associated with the request
196202 * @return the method arguments to be used
197203 */
198- protected Object[] getArguments(C context) {
204+ protected Object[] getArguments(final C context) {
199205 return new Object[] {context};
200206 }
201207
@@ -216,7 +222,8 @@
216222 * specified name.
217223 * @throws NullPointerException if no methodName can be determined
218224 */
219- private Method extractMethod(Command<K, V, C> command, C context) throws NoSuchMethodException {
225+ private Method extractMethod(final Command<K, V, C> command, final C context)
226+ throws NoSuchMethodException {
220227 String methodName = this.getMethod();
221228
222229 if (methodName == null) {
@@ -229,13 +236,12 @@
229236
230237 Method theMethod = null;
231238
232- synchronized (methods) {
233- theMethod = methods.get(methodName);
239+ synchronized (this.methods) {
240+ theMethod = this.methods.get(methodName);
234241
235242 if (theMethod == null) {
236- theMethod = command.getClass().getMethod(methodName,
237- getSignature());
238- methods.put(methodName, theMethod);
243+ theMethod = command.getClass().getMethod(methodName, getSignature());
244+ this.methods.put(methodName, theMethod);
239245 }
240246 }
241247
--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/LookupCommand.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/LookupCommand.java (revision 273)
@@ -14,6 +14,7 @@
1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+
1718 package org.apache.commons.chain2.base;
1819
1920 import org.apache.commons.chain2.Catalog;
@@ -42,14 +43,22 @@
4243 * silently ignored. Otherwise, a lookup failure will trigger an
4344 * <code>IllegalArgumentException</code>.</p>
4445 *
46+ * @version $Id$
47+ *
4548 * @param <K> Context key type
4649 * @param <V> Context value type
4750 * @param <C> Type of the context associated with this command
48- *
49- * @version $Id$
5051 */
5152 public class LookupCommand<K, V, C extends Map<K, V>> implements Filter<K, V, C> {
5253
54+ private CatalogFactory<K, V, C> catalogFactory = null;
55+ private String catalogName = null;
56+ private String name = null;
57+ private String nameKey = null;
58+ private boolean optional = false;
59+ private boolean ignoreExecuteResult = false;
60+ private boolean ignorePostprocessResult = false;
61+
5362 // -------------------------------------------------------------- Constructors
5463
5564 /**
@@ -70,24 +79,22 @@
7079 *
7180 * @since Chain 1.1
7281 */
73- public LookupCommand(CatalogFactory<K, V, C> factory) {
82+ public LookupCommand(final CatalogFactory<K, V, C> factory) {
7483 this.catalogFactory = factory;
7584 }
7685
7786 // -------------------------------------------------------------- Properties
7887
79- private CatalogFactory<K, V, C> catalogFactory = null;
80-
8188 /**
8289 * <p>Set the {@link CatalogFactoryBase} from which lookups will be
8390 * performed.</p>
8491 *
85- * @param catalogFactory The Catalog Factory.
92+ * @param factory The Catalog Factory.
8693 *
8794 * @since Chain 1.1
8895 */
89- public void setCatalogFactory(CatalogFactory<K, V, C> catalogFactory) {
90- this.catalogFactory = catalogFactory;
96+ public void setCatalogFactory(final CatalogFactory<K, V, C> factory) {
97+ this.catalogFactory = factory;
9198 }
9299
93100 /**
@@ -100,8 +107,6 @@
100107 return this.catalogFactory;
101108 }
102109
103- private String catalogName = null;
104-
105110 /**
106111 * <p>Return the name of the {@link Catalog} to be searched, or
107112 * <code>null</code> to search the default {@link Catalog}.</p>
@@ -115,14 +120,12 @@
115120 * <p>Set the name of the {@link Catalog} to be searched, or
116121 * <code>null</code> to search the default {@link Catalog}.</p>
117122 *
118- * @param catalogName The new {@link Catalog} name or <code>null</code>
123+ * @param val The new {@link Catalog} name or <code>null</code>
119124 */
120- public void setCatalogName(String catalogName) {
121- this.catalogName = catalogName;
125+ public void setCatalogName(final String val) {
126+ this.catalogName = val;
122127 }
123128
124- private String name = null;
125-
126129 /**
127130 * <p>Return the name of the {@link Command} that we will look up and
128131 * delegate execution to.</p>
@@ -136,14 +139,12 @@
136139 * <p>Set the name of the {@link Command} that we will look up and
137140 * delegate execution to.</p>
138141 *
139- * @param name The new command name
142+ * @param val The new command name
140143 */
141- public void setName(String name) {
142- this.name = name;
144+ public void setName(final String val) {
145+ this.name = val;
143146 }
144147
145- private String nameKey = null;
146-
147148 /**
148149 * <p>Return the context attribute key under which the {@link Command}
149150 * name is stored.</p>
@@ -157,14 +158,12 @@
157158 * <p>Set the context attribute key under which the {@link Command}
158159 * name is stored.</p>
159160 *
160- * @param nameKey The new context attribute key
161+ * @param val The new context attribute key
161162 */
162- public void setNameKey(String nameKey) {
163- this.nameKey = nameKey;
163+ public void setNameKey(final String val) {
164+ this.nameKey = val;
164165 }
165166
166- private boolean optional = false;
167-
168167 /**
169168 * <p>Return <code>true</code> if locating the specified command
170169 * is optional.</p>
@@ -177,14 +176,12 @@
177176 /**
178177 * <p>Set the optional flag for finding the specified command.</p>
179178 *
180- * @param optional The new optional flag
179+ * @param val The new optional flag
181180 */
182- public void setOptional(boolean optional) {
183- this.optional = optional;
181+ public void setOptional(final boolean val) {
182+ this.optional = val;
184183 }
185184
186- private boolean ignoreExecuteResult = false;
187-
188185 /**
189186 * <p>Return <code>true</code> if this command should ignore
190187 * the return value from executing the looked-up command.
@@ -197,7 +194,7 @@
197194 * @since Chain 1.1
198195 */
199196 public boolean isIgnoreExecuteResult() {
200- return ignoreExecuteResult;
197+ return this.ignoreExecuteResult;
201198 }
202199
203200 /**
@@ -207,17 +204,15 @@
207204 * <p>If you are looking up a chain which may be "aborted" and
208205 * you do not want this class to stop chain processing, then this
209206 * value should be set to <code>true</code></p>
210- * @param ignoreReturn <code>true</code> if result of the
207+ * @param val <code>true</code> if result of the
211208 * looked up Command should be ignored.
212209 *
213210 * @since Chain 1.1
214211 */
215- public void setIgnoreExecuteResult(boolean ignoreReturn) {
216- this.ignoreExecuteResult = ignoreReturn;
212+ public void setIgnoreExecuteResult(final boolean val) {
213+ this.ignoreExecuteResult = val;
217214 }
218215
219- private boolean ignorePostprocessResult = false;
220-
221216 /**
222217 * <p>Return <code>true</code> if this command is a Filter and
223218 * should ignore the return value from executing the looked-up Filter's
@@ -231,7 +226,7 @@
231226 * @since Chain 1.1
232227 */
233228 public boolean isIgnorePostprocessResult() {
234- return ignorePostprocessResult;
229+ return this.ignorePostprocessResult;
235230 }
236231
237232 /**
@@ -241,13 +236,13 @@
241236 * <p>If you are looking up a Filter which may be "aborted" and
242237 * you do not want this class to stop chain processing, then this
243238 * value should be set to <code>true</code></p>
244- * @param ignorePostprocessResult <code>true</code> if result of the
239+ * @param val <code>true</code> if result of the
245240 * looked up Filter's <code>postprocess()</code> method should be ignored.
246241 *
247242 * @since Chain 1.1
248243 */
249- public void setIgnorePostprocessResult(boolean ignorePostprocessResult) {
250- this.ignorePostprocessResult = ignorePostprocessResult;
244+ public void setIgnorePostprocessResult(final boolean val) {
245+ this.ignorePostprocessResult = val;
251246 }
252247
253248 // ---------------------------------------------------------- Filter Methods
@@ -269,10 +264,11 @@
269264 * <code>CONTINUE</code> if no command is found or if the command
270265 * is found but the <code>ignoreExecuteResult</code> property of this
271266 * instance is <code>true</code>
272- * @throws org.apache.commons.chain2.ChainException if and error occurs in the looked-up Command.
267+ * @throws org.apache.commons.chain2.ChainException
268+ * if and error occurs in the looked-up Command.
273269 */
274270 @Override
275- public Processing execute(C context) {
271+ public Processing execute(final C context) {
276272 Command<K, V, C> command = getCommand(context);
277273 if (command != null) {
278274 Processing result = command.execute(context);
@@ -298,7 +294,7 @@
298294 * case <code>IllegalArgumentException</code> will be thrown.
299295 */
300296 @Override
301- public boolean postprocess(C context, Exception exception) {
297+ public boolean postprocess(final C context, final Exception exception) {
302298 Command<K, V, C> command = getCommand(context);
303299 if (command != null) {
304300 if (command instanceof Filter) {
@@ -321,28 +317,26 @@
321317 *
322318 * @since Chain 1.2
323319 */
324- protected Catalog<K, V, C> getCatalog(C context) {
320+ protected Catalog<K, V, C> getCatalog(final C context) {
325321 CatalogFactory<K, V, C> lookupFactory = this.catalogFactory;
326322 if (lookupFactory == null) {
327323 lookupFactory = CatalogFactoryBase.getInstance();
328324 }
329325
330- String catalogName = getCatalogName();
326+ String ctlg = getCatalogName();
331327 Catalog<K, V, C> catalog = null;
332- if (catalogName == null) {
328+ if (ctlg == null) {
333329 // use default catalog
334330 catalog = lookupFactory.getCatalog();
335331 } else {
336- catalog = lookupFactory.getCatalog(catalogName);
332+ catalog = lookupFactory.getCatalog(ctlg);
337333 }
334+
338335 if (catalog == null) {
339- if (catalogName == null) {
340- throw new IllegalArgumentException
341- ("Cannot find default catalog");
336+ if (ctlg == null) {
337+ throw new IllegalArgumentException("Cannot find default catalog");
342338 }
343- throw new IllegalArgumentException
344- ("Cannot find catalog '" + catalogName + "'");
345-
339+ throw new IllegalArgumentException("Cannot find catalog '" + ctlg + "'");
346340 }
347341
348342 return catalog;
@@ -357,23 +351,20 @@
357351 * can be found and the <code>optional</code> property is set
358352 * to <code>false</code>
359353 */
360- protected Command<K, V, C> getCommand(C context) {
354+ protected Command<K, V, C> getCommand(final C context) {
361355 Catalog<K, V, C> catalog = getCatalog(context);
362356
363357 Command<K, V, C> command;
364- String name = getCommandName(context);
365- if (name != null) {
366- command = catalog.getCommand(name);
358+ String cmd = getCommandName(context);
359+ if (cmd != null) {
360+ command = catalog.getCommand(cmd);
367361 if (command == null && !isOptional()) {
368- if (catalogName == null) {
369- throw new IllegalArgumentException
370- ("Cannot find command '" + name
371- + "' in default catalog");
362+ if (this.catalogName == null) {
363+ throw new IllegalArgumentException(
364+ "Cannot find command '" + cmd + "' in default catalog");
372365 }
373- throw new IllegalArgumentException
374- ("Cannot find command '" + name
375- + "' in catalog '" + catalogName + "'");
376-
366+ throw new IllegalArgumentException("Cannot find command '" + cmd
367+ + "' in catalog '" + this.catalogName + "'");
377368 }
378369 return command;
379370 }
@@ -388,12 +379,12 @@
388379 *
389380 * @since Chain 1.2
390381 */
391- protected String getCommandName(C context) {
392- String name = getName();
393- if (name == null) {
394- name = (String) context.get(getNameKey());
382+ protected String getCommandName(final C context) {
383+ String ret = getName();
384+ if (ret == null) {
385+ ret = (String) context.get(getNameKey());
395386 }
396- return name;
387+ return ret;
397388 }
398389
399390 }
--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/CopyCommand.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/CopyCommand.java (revision 273)
@@ -14,6 +14,7 @@
1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+
1718 package org.apache.commons.chain2.base;
1819
1920 import java.util.Map;
@@ -25,11 +26,11 @@
2526 * <p>Copy a specified literal value, or a context attribute stored under
2627 * the <code>fromKey</code> (if any), to the <code>toKey</code>.</p>
2728 *
29+ * @version $Id$
30+ *
2831 * @param <K> the type of keys maintained by the context associated with this command
2932 * @param <V> the type of mapped values
3033 * @param <C> Type of the context associated with this command
31- *
32- * @version $Id$
3334 */
3435 public class CopyCommand<K, V, C extends Map<K, V>> implements Command<K, V, C> {
3536
@@ -36,6 +37,7 @@
3637 // -------------------------------------------------------------- Properties
3738
3839 private K fromKey = null;
40+ private K toKey = null;
3941
4042 /**
4143 * <p>Return the context attribute key for the source attribute.</p>
@@ -48,14 +50,12 @@
4850 /**
4951 * <p>Set the context attribute key for the source attribute.</p>
5052 *
51- * @param fromKey The new key
53+ * @param val The new key
5254 */
53- public void setFromKey(K fromKey) {
54- this.fromKey = fromKey;
55+ public void setFromKey(final K val) {
56+ this.fromKey = val;
5557 }
5658
57- private K toKey = null;
58-
5959 /**
6060 * <p>Return the context attribute key for the destination attribute.</p>
6161 * @return The destination attribute key.
@@ -67,10 +67,10 @@
6767 /**
6868 * <p>Set the context attribute key for the destination attribute.</p>
6969 *
70- * @param toKey The new key
70+ * @param val The new key
7171 */
72- public void setToKey(K toKey) {
73- this.toKey = toKey;
72+ public void setToKey(final K val) {
73+ this.toKey = val;
7474 }
7575
7676 // ---------------------------------------------------------- Filter Methods
@@ -84,7 +84,7 @@
8484 * @throws org.apache.commons.chain2.ChainException in the if an error occurs during execution.
8585 */
8686 @Override
87- public Processing execute(C context) {
87+ public Processing execute(final C context) {
8888 if (containsKeys(context)) {
8989 V value = context.get(getFromKey());
9090 context.put(getToKey(), value);
@@ -92,7 +92,7 @@
9292 return Processing.CONTINUE;
9393 }
9494
95- private boolean containsKeys(C context) {
95+ private boolean containsKeys(final C context) {
9696 return context.containsKey(getFromKey()) && context.containsKey(getToKey());
9797 }
9898
--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/RemoveCommand.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/RemoveCommand.java (revision 273)
@@ -14,6 +14,7 @@
1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+
1718 package org.apache.commons.chain2.base;
1819
1920 import org.apache.commons.chain2.Command;
@@ -23,11 +24,11 @@
2324 /**
2425 * <p>Remove any context attribute stored under the <code>fromKey</code>.</p>
2526 *
27+ * @version $Id$
28+ *
2629 * @param <K> the type of keys maintained by the context associated with this catalog
2730 * @param <V> the type of mapped values
2831 * @param <C> Type of the context associated with this command
29- *
30- * @version $Id$
3132 */
3233 public class RemoveCommand<K, V, C extends Context<K, V>> implements Command<K, V, C> {
3334
@@ -46,10 +47,10 @@
4647 /**
4748 * <p>Set the context attribute key for the attribute.</p>
4849 *
49- * @param fromKey The new key
50+ * @param val The new key
5051 */
51- public void setFromKey(K fromKey) {
52- this.fromKey = fromKey;
52+ public void setFromKey(final K val) {
53+ this.fromKey = val;
5354 }
5455
5556 // ---------------------------------------------------------- Filter Methods
@@ -63,7 +64,7 @@
6364 * @throws org.apache.commons.chain2.ChainException if and error occurs.
6465 */
6566 @Override
66- public Processing execute(C context) {
67+ public Processing execute(final C context) {
6768 context.remove(getFromKey());
6869 return Processing.CONTINUE;
6970 }
--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/DispatchCommand.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/DispatchCommand.java (revision 273)
@@ -14,6 +14,7 @@
1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+
1718 package org.apache.commons.chain2.base;
1819
1920 import org.apache.commons.chain2.Command;
@@ -30,15 +31,21 @@
3031 * For use by developers who prefer to group related functionality into a single class
3132 * rather than an inheritance family.
3233 *
34+ * @version $Id$
3335 * @param <K> the type of keys maintained by the context associated with this command
3436 * @param <V> the type of mapped values
3537 * @param <C> Type of the context associated with this command
3638 *
3739 * @since Chain 1.1
38- * @version $Id$
3940 */
4041 public abstract class DispatchCommand<K, V, C extends Context<K, V>> implements Command<K, V, C> {
4142
43+ /**
44+ * The base implementation expects dispatch methods to take a <code>Context</code>
45+ * as their only argument.
46+ */
47+ private static final Class<?>[] DEFAULT_SIGNATURE = new Class<?>[] {Context.class};
48+
4249 /** Cache of methods */
4350 private final Map<String, Method> methods = new WeakHashMap<>();
4451
@@ -49,39 +56,36 @@
4956 private String methodKey = null;
5057
5158 /**
52- * The base implementation expects dispatch methods to take a <code>Context</code>
53- * as their only argument.
54- */
55- static final Class<?>[] DEFAULT_SIGNATURE = new Class<?>[] {Context.class};
56- /**
5759 * Look up the method specified by either "method" or "methodKey" and invoke it,
5860 * returning a {@link Processing} value as interpreted by <code>evaluateResult</code>.
5961 * @param context The Context to be processed by this Command.
6062 * @return the result of method being dispatched to.
6163 * @throws IllegalStateException if neither 'method' nor 'methodKey' properties are defined
62- * @throws DispatchException if any is thrown by the invocation. Note that if invoking the method
64+ * @throws DispatchException if any is thrown by the invocation.
65+ * Note that if invoking the method
6366 * results in an InvocationTargetException, the cause of that exception is thrown instead of
64- * the exception itself, unless the cause is an <code>Error</code> or other <code>Throwable</code>
65- * which is not an <code>Exception</code>.
67+ * the exception itself, unless the cause is an <code>Error</code>
68+ * or other <code>Throwable</code> which is not an <code>Exception</code>.
6669 */
6770 @Override
68- public Processing execute(C context) {
71+ public Processing execute(final C context) {
6972 if (this.getMethod() == null && this.getMethodKey() == null) {
70- throw new IllegalStateException("Neither 'method' nor 'methodKey' properties are defined ");
73+ throw new IllegalStateException(
74+ "Neither 'method' nor 'methodKey' properties are defined ");
7175 }
7276
7377 try {
7478 Method methodObject = extractMethod(context);
75- return evaluateResult(methodObject.invoke(this,
76- getArguments(context)));
79+ return evaluateResult(methodObject.invoke(this, getArguments(context)));
7780
78- } catch (NoSuchMethodException e) {
81+ } catch (final NoSuchMethodException e) {
7982 throw new DispatchException("Error extracting method from context", e, context, this);
80- } catch (IllegalAccessException e) {
83+ } catch (final IllegalAccessException e) {
8184 throw new DispatchException("Error accessing method", e, context, this);
82- } catch (InvocationTargetException e) {
85+ } catch (final InvocationTargetException e) {
8386 Throwable cause = e.getTargetException();
84- throw new DispatchException("Error in reflected dispatched command", cause, context, this);
87+ throw new DispatchException(
88+ "Error in reflected dispatched command", cause, context, this);
8589 }
8690 }
8791
@@ -95,13 +99,14 @@
9599 * @throws NoSuchMethodException if no method can be found under the specified name.
96100 * @throws NullPointerException if no methodName cannot be determined
97101 */
98- protected Method extractMethod(C context) throws NoSuchMethodException {
102+ protected Method extractMethod(final C context) throws NoSuchMethodException {
99103 String methodName = this.getMethod();
100104
101105 if (methodName == null) {
102106 Object methodContextObj = context.get(this.getMethodKey());
103107 if (methodContextObj == null) {
104- throw new NullPointerException("No value found in context under " + this.getMethodKey());
108+ throw new NullPointerException(
109+ "No value found in context under " + this.getMethodKey());
105110 }
106111 methodName = methodContextObj.toString();
107112 }
@@ -108,12 +113,12 @@
108113
109114 Method theMethod = null;
110115
111- synchronized (methods) {
112- theMethod = methods.get(methodName);
116+ synchronized (this.methods) {
117+ theMethod = this.methods.get(methodName);
113118
114119 if (theMethod == null) {
115120 theMethod = getClass().getMethod(methodName, getSignature());
116- methods.put(methodName, theMethod);
121+ this.methods.put(methodName, theMethod);
117122 }
118123 }
119124
@@ -127,8 +132,8 @@
127132 * @param obj The result of the method execution
128133 * @return The evaluated result/
129134 */
130- protected Processing evaluateResult(Object obj) {
131- if(obj instanceof Processing) {
135+ protected Processing evaluateResult(final Object obj) {
136+ if (obj instanceof Processing) {
132137 Processing result = (Processing) obj;
133138 return result;
134139 }
@@ -141,7 +146,7 @@
141146 * @return The method signature.
142147 */
143148 protected Class<?>[] getSignature() {
144- return DEFAULT_SIGNATURE;
149+ return DEFAULT_SIGNATURE.clone();
145150 }
146151
147152 /**
@@ -153,7 +158,7 @@
153158 * @param context The Context being processed by this Command.
154159 * @return The method arguments.
155160 */
156- protected Object[] getArguments(C context) {
161+ protected Object[] getArguments(final C context) {
157162 return new Object[] {context};
158163 }
159164
@@ -162,7 +167,7 @@
162167 * @return The method name.
163168 */
164169 public String getMethod() {
165- return method;
170+ return this.method;
166171 }
167172
168173 /**
@@ -170,23 +175,23 @@
170175 * @return The Context key for the method name.
171176 */
172177 public String getMethodKey() {
173- return methodKey;
178+ return this.methodKey;
174179 }
175180
176181 /**
177182 * Set the method name.
178- * @param method The method name.
183+ * @param val The method name.
179184 */
180- public void setMethod(String method) {
181- this.method = method;
185+ public void setMethod(String val) {
186+ this.method = val;
182187 }
183188
184189 /**
185190 * Set the Context key for the method name.
186- * @param methodKey The Context key for the method name.
191+ * @param val The Context key for the method name.
187192 */
188- public void setMethodKey(String methodKey) {
189- this.methodKey = methodKey;
193+ public void setMethodKey(final String val) {
194+ this.methodKey = val;
190195 }
191196
192197 }
--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/DispatchException.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/DispatchException.java (revision 273)
@@ -14,6 +14,7 @@
1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+
1718 package org.apache.commons.chain2.base;
1819
1920 import org.apache.commons.chain2.ChainException;
@@ -23,7 +24,8 @@
2324
2425 /**
2526 * Runtime Exception that wraps an underlying exception thrown during the
26- * execution of a {@link org.apache.commons.chain2.Command} or {@link org.apache.commons.chain2.Chain}.
27+ * execution of a {@link org.apache.commons.chain2.Command}
28+ * or {@link org.apache.commons.chain2.Chain}.
2729 *
2830 * @version $Id$
2931 */
@@ -31,19 +33,22 @@
3133
3234 /** serialVersionUID */
3335 private static final long serialVersionUID = 20120724L;
36+
3437 /**
3538 * @param message String
3639 */
37- public DispatchException(String message) {
40+ public DispatchException(final String message) {
3841 super(message);
3942 }
43+
4044 /**
4145 * @param message String
4246 * @param cause Throwable
4347 */
44- public DispatchException(String message, Throwable cause) {
48+ public DispatchException(final String message, final Throwable cause) {
4549 super(message, cause);
4650 }
51+
4752 /**
4853 * @param <K> K
4954 * @param <V> V
@@ -53,8 +58,8 @@
5358 * @param context C
5459 * @param failedCommand Command
5560 */
56- public <K, V, C extends Map<K, V>> DispatchException(String message, Throwable cause,
57- C context, Command<K, V, C> failedCommand) {
61+ public <K, V, C extends Map<K, V>> DispatchException(final String message,
62+ final Throwable cause, final C context, final Command<K, V, C> failedCommand) {
5863 super(message, cause, context, failedCommand);
5964 }
6065
--- trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/OverrideCommand.java (revision 272)
+++ trunk/apache/commons-chain2/src/main/java/org/apache/commons/chain2/base/OverrideCommand.java (revision 273)
@@ -26,11 +26,11 @@
2626 /**
2727 * <p>Override any context attribute stored under the <code>key</code> with <code>value</code>.</p>
2828 *
29+ * @version $Id$
30+ *
2931 * @param <K> the type of keys maintained by the context associated with this catalog
3032 * @param <V> the type of mapped values
3133 * @param <C> Type of the context associated with this command
32- *
33- * @version $Id$
3434 */
3535 public class OverrideCommand<K, V, C extends Map<K, V>> implements Command<K, V, C> {
3636
@@ -44,16 +44,16 @@
4444 * @return The context attribute key.
4545 */
4646 public K getKey() {
47- return key;
47+ return this.key;
4848 }
4949
5050 /**
5151 * <p>Set the context attribute key for the attribute to override.</p>
5252 *
53- * @param key The new key
53+ * @param val The new key
5454 */
55- public void setKey(K key) {
56- this.key = key;
55+ public void setKey(final K val) {
56+ this.key = val;
5757 }
5858
5959 /**
@@ -61,16 +61,16 @@
6161 * @return The value.
6262 */
6363 public V getValue() {
64- return value;
64+ return this.value;
6565 }
6666
6767 /**
6868 * <p>Set the value that should override context attribute with key <code>key</code>.</p>
6969 *
70- * @param value The new value
70+ * @param val The new value
7171 */
72- public void setValue(V value) {
73- this.value = value;
72+ public void setValue(final V val) {
73+ this.value = val;
7474 }
7575
7676 // ---------------------------------------------------------- Filter Methods
@@ -83,7 +83,7 @@
8383 * @throws org.apache.commons.chain2.ChainException if and error occurs.
8484 */
8585 @Override
86- public Processing execute(C context) {
86+ public Processing execute(final C context) {
8787 if (context.containsKey(getKey())) {
8888 context.put(getKey(), getValue());
8989 }