hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r554903 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol: BasicHttpProcessor.java HttpRequestInterceptorList.java HttpResponseInterceptorList.java
Date Tue, 10 Jul 2007 10:54:22 GMT
Author: rolandw
Date: Tue Jul 10 03:54:17 2007
New Revision: 554903

URL: http://svn.apache.org/viewvc?view=rev&rev=554903
Log:
disabled magic number behaviour when adding with index

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpResponseInterceptorList.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java?view=diff&rev=554903&r1=554902&r2=554903
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
Tue Jul 10 03:54:17 2007
@@ -82,11 +82,11 @@
         }
 
         if (this.requestInterceptors == null) {
+            if (index > 0) {
+                throw new IndexOutOfBoundsException(String.valueOf(index));
+            }
             this.requestInterceptors = new ArrayList();
         }
-        if (index > this.requestInterceptors.size()) {
-            index = this.requestInterceptors.size();
-        }
         this.requestInterceptors.add(index, itcp);
     }
     
@@ -96,15 +96,15 @@
         if (index < 0) {
             throw new IndexOutOfBoundsException(String.valueOf(index));
         }
-         if (itcp == null) {
+        if (itcp == null) {
             return;
         }
 
         if (this.responseInterceptors == null) {
+            if (index > 0) {
+                throw new IndexOutOfBoundsException(String.valueOf(index));
+            }
             this.responseInterceptors = new ArrayList();
-        }
-        if (index > this.responseInterceptors.size()) {
-            index = this.responseInterceptors.size();
         }
         this.responseInterceptors.add(index, itcp);
     }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java?view=diff&rev=554903&r1=554902&r2=554903
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpRequestInterceptorList.java
Tue Jul 10 03:54:17 2007
@@ -61,9 +61,7 @@
      * Inserts a request interceptor at the specified index.
      *
      * @param itcp      the request interceptor to add
-     * @param index     the index to insert the interceptor at.
-     *                  If the index exceeds the size of the list,
-     *                  the interceptor is appended at the end of the list.
+     * @param index     the index to insert the interceptor at
      */
     void addRequestInterceptor(HttpRequestInterceptor itcp, int index);
     

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpResponseInterceptorList.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpResponseInterceptorList.java?view=diff&rev=554903&r1=554902&r2=554903
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpResponseInterceptorList.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpResponseInterceptorList.java
Tue Jul 10 03:54:17 2007
@@ -62,9 +62,7 @@
      * Inserts a response interceptor at the specified index.
      *
      * @param itcp      the response interceptor to add
-     * @param index     the index to insert the interceptor at.
-     *                  If the index exceeds the size of the list,
-     *                  the interceptor is appended at the end of the list.
+     * @param index     the index to insert the interceptor at
      */
     void addResponseInterceptor(HttpResponseInterceptor itcp, int index);
     



Mime
View raw message