hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1544905 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
Date Sun, 24 Nov 2013 03:35:20 GMT
Author: sebb
Date: Sun Nov 24 03:35:18 2013
New Revision: 1544905

URL: http://svn.apache.org/r1544905
Log:
Document why the for-each loop is not used here

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java?rev=1544905&r1=1544904&r2=1544905&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
Sun Nov 24 03:35:18 2013
@@ -190,6 +190,9 @@ public class HeaderGroup implements Clon
      * @return the first header or <code>null</code>
      */
     public Header getFirstHeader(final String name) {
+        // HTTPCORE-361 : we don't use the for-each syntax, i.e. 
+        //     for (Header header : headers)
+        // as that creates an Iterator that needs to be garbage-collected
         for (int i = 0; i < this.headers.size(); i++) {
             final Header header = this.headers.get(i);
             if (header.getName().equalsIgnoreCase(name)) {



Mime
View raw message