commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1076181 - in /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3: Digester.java internal/DigesterImpl.java rule/CallMethodRule.java rule/CallParamRule.java rule/ObjectParamRule.java rule/PathCallParamRule.java
Date Wed, 02 Mar 2011 11:56:13 GMT
Author: simonetripodi
Date: Wed Mar  2 11:56:12 2011
New Revision: 1076181

URL: http://svn.apache.org/viewvc?rev=1076181&view=rev
Log:
changed the parameters stack methods signature, no more casts needed

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/DigesterImpl.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallMethodRule.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallParamRule.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/ObjectParamRule.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/PathCallParamRule.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java?rev=1076181&r1=1076180&r2=1076181&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java
Wed Mar  2 11:56:12 2011
@@ -313,7 +313,7 @@ public interface Digester extends Conten
      * <p>The parameters stack is used to store <code>CallMethodRule</code>
parameters. 
      * See {@link #params}.</p>
      */
-    Object peekParams();
+    Object[] peekParams();
 
     /**
      * <p>Return the n'th object down the parameters stack, where 0 is the top element
@@ -325,7 +325,7 @@ public interface Digester extends Conten
      * @param n Index of the desired element, where 0 is the top of the stack,
      *  1 is the next element down, and so on.
      */
-    Object peekParams(int n);
+    Object[] peekParams(int n);
 
     /**
      * <p>Push a new object onto the top of the parameters stack.</p>
@@ -335,7 +335,7 @@ public interface Digester extends Conten
      *
      * @param object The new object
      */
-    void pushParams(Object object);
+    void pushParams(Object[] object);
 
     /**
      * <p>Pop the top object off of the parameters stack, and return it.  If there
are
@@ -344,7 +344,7 @@ public interface Digester extends Conten
      * <p>The parameters stack is used to store <code>CallMethodRule</code>
parameters. 
      * See {@link #params}.</p>
      */
-    Object popParams();
+    Object[] popParams();
 
     /**
      * Get the most current namespaces for all prefixes.

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/DigesterImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/DigesterImpl.java?rev=1076181&r1=1076180&r2=1076181&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/DigesterImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/DigesterImpl.java
Wed Mar  2 11:56:12 2011
@@ -86,7 +86,7 @@ public final class DigesterImpl implemen
      * The parameters stack being utilized by CallMethodRule and
      * CallParamRule rules.
      */
-    private final Stack<Object> params = new Stack<Object>();
+    private final Stack<Object[]> params = new Stack<Object[]>();
 
     /**
      * Stack whose elements are List objects, each containing a list of
@@ -394,7 +394,7 @@ public final class DigesterImpl implemen
     /**
      * {@inheritDoc}
      */
-    public Object peekParams() {
+    public Object[] peekParams() {
         try {
             return this.params.peek();
         } catch (EmptyStackException e) {
@@ -406,7 +406,7 @@ public final class DigesterImpl implemen
     /**
      * {@inheritDoc}
      */
-    public Object peekParams(int n) {
+    public Object[] peekParams(int n) {
         int index = (this.params.size() - 1) - n;
         if (index < 0) {
             this.log.warn("Empty stack (returning null)");
@@ -423,7 +423,7 @@ public final class DigesterImpl implemen
     /**
      * {@inheritDoc}
      */
-    public void pushParams(Object object) {
+    public void pushParams(Object[] object) {
         if (this.log.isTraceEnabled()) {
             this.log.trace("Pushing params");
         }
@@ -433,7 +433,7 @@ public final class DigesterImpl implemen
     /**
      * {@inheritDoc}
      */
-    public Object popParams() {
+    public Object[] popParams() {
         try {
             if (this.log.isTraceEnabled()) {
                 this.log.trace("Popping params");

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallMethodRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallMethodRule.java?rev=1076181&r1=1076180&r2=1076181&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallMethodRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallMethodRule.java
Wed Mar  2 11:56:12 2011
@@ -190,10 +190,10 @@ public class CallMethodRule extends Rule
     @Override
     public void end(String namespace, String name) throws Exception {
         // Retrieve or construct the parameter values array
-        Object parameters[] = null;
+        Object[] parameters = null;
         if (this.paramCount > 0) {
 
-            parameters = (Object[]) this.getDigester().popParams();
+            parameters = this.getDigester().popParams();
 
             if (this.getDigester().getLog().isTraceEnabled()) {
                 Formatter formatter = new Formatter("[CallMethodRule]");

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallParamRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallParamRule.java?rev=1076181&r1=1076180&r2=1076181&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallParamRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/CallParamRule.java
Wed Mar  2 11:56:12 2011
@@ -112,7 +112,7 @@ public class CallParamRule extends Rule 
         // if this CallParamRule is reused in subsequent nesting.
 
         if (param != null) {
-            Object parameters[] = (Object[]) this.getDigester().peekParams();
+            Object[] parameters = this.getDigester().peekParams();
             parameters[this.paramIndex] = param;
         }
     }
@@ -137,7 +137,7 @@ public class CallParamRule extends Rule 
     public void end(String namespace, String name) {
         if (this.bodyTextStack != null && !this.bodyTextStack.empty()) {
             // what we do now is push one parameter onto the top set of parameters
-            Object parameters[] = (Object[]) this.getDigester().peekParams();
+            Object[] parameters = this.getDigester().peekParams();
             parameters[this.paramIndex] = this.bodyTextStack.pop();
         }
     }

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/ObjectParamRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/ObjectParamRule.java?rev=1076181&r1=1076180&r2=1076181&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/ObjectParamRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/ObjectParamRule.java
Wed Mar  2 11:56:12 2011
@@ -72,7 +72,7 @@ public class ObjectParamRule extends Rul
     @Override
     public void begin(String namespace, String name, Attributes attributes) throws Exception
{
         Object anAttribute = null;
-        Object parameters[] = (Object[]) this.getDigester().peekParams();
+        Object[] parameters = this.getDigester().peekParams();
 
         if (this.attributeName != null) {
             anAttribute = attributes.getValue(attributeName);

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/PathCallParamRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/PathCallParamRule.java?rev=1076181&r1=1076180&r2=1076181&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/PathCallParamRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rule/PathCallParamRule.java
Wed Mar  2 11:56:12 2011
@@ -58,7 +58,7 @@ public class PathCallParamRule extends R
         String param = getDigester().getMatch();
 
         if (param != null) {
-            Object parameters[] = (Object[]) this.getDigester().peekParams();
+            Object[] parameters = this.getDigester().peekParams();
             parameters[this.paramIndex] = param;
         }
     }



Mime
View raw message