commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1066069 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Date Tue, 01 Feb 2011 15:33:38 GMT
Author: simonetripodi
Date: Tue Feb  1 15:33:38 2011
New Revision: 1066069

URL: http://svn.apache.org/viewvc?rev=1066069&view=rev
Log:
caught and reported negative index when invoking callParamPath().ofIndex(int)

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java?rev=1066069&r1=1066068&r2=1066069&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Tue Feb  1 15:33:38 2011
@@ -520,6 +520,11 @@ final class RulesBinderImpl implements R
                     }
 
                     public PathCallParamBuilder ofIndex(int paramIndex) {
+                        if (paramIndex < 0) {
+                            addError("{forPattern(\"%s\").callParamPath().ofIndex(int)} negative
index argument not allowed",
+                                    keyPattern);
+                        }
+
                         this.paramIndex = paramIndex;
                         return this;
                     }



Mime
View raw message