Author: markt
Date: Tue Sep 18 13:12:20 2012
New Revision: 1387136
URL: http://svn.apache.org/viewvc?rev=1387136&view=rev
Log:
Code clean-up
- add 'final' as prompted by the UCDetector
Modified:
tomcat/trunk/java/org/apache/tomcat/util/digester/CallParamRule.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/CallParamRule.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/CallParamRule.java?rev=1387136&r1=1387135&r2=1387136&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/CallParamRule.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/CallParamRule.java Tue
Sep 18 13:12:20 2012
@@ -51,9 +51,7 @@ public class CallParamRule extends Rule
* @param paramIndex The zero-relative parameter number
*/
public CallParamRule(int paramIndex) {
-
this(paramIndex, null);
-
}
@@ -66,10 +64,7 @@ public class CallParamRule extends Rule
*/
public CallParamRule(int paramIndex,
String attributeName) {
-
- this.paramIndex = paramIndex;
- this.attributeName = attributeName;
-
+ this(attributeName, paramIndex, 0, false);
}
@@ -80,10 +75,7 @@ public class CallParamRule extends Rule
* @param fromStack should this parameter be taken from the top of the
stack?
*/
public CallParamRule(int paramIndex, boolean fromStack) {
-
- this.paramIndex = paramIndex;
- this.fromStack = fromStack;
-
+ this(null, paramIndex, 0, fromStack);
}
/**
@@ -95,36 +87,42 @@ public class CallParamRule extends Rule
* The zeroth object is the top of the stack, 1 is the next object down
and so on.
*/
public CallParamRule(int paramIndex, int stackIndex) {
+ this(null, paramIndex, stackIndex, true);
+ }
+ private CallParamRule(String attributeName, int paramIndex, int stackIndex,
+ boolean fromStack) {
+ this.attributeName = attributeName;
this.paramIndex = paramIndex;
- this.fromStack = true;
this.stackIndex = stackIndex;
+ this.fromStack = fromStack;
}
+
// ----------------------------------------------------- Instance Variables
/**
* The attribute from which to save the parameter value
*/
- protected String attributeName = null;
+ protected final String attributeName;
/**
* The zero-relative index of the parameter we are saving.
*/
- protected int paramIndex = 0;
+ protected final int paramIndex;
/**
* Is the parameter to be set from the stack?
*/
- protected boolean fromStack = false;
+ protected final boolean fromStack;
/**
* The position of the object from the top of the stack
*/
- protected int stackIndex = 0;
+ protected final int stackIndex;
/**
* Stack is used to allow nested body text to be processed.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]