hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1398061 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt httpcore/src/main/java/org/apache/http/message/HeaderGroup.java httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java
Date Sun, 14 Oct 2012 11:57:43 GMT
Author: olegk
Date: Sun Oct 14 11:57:42 2012
New Revision: 1398061

URL: http://svn.apache.org/viewvc?rev=1398061&view=rev
Log:
HTTPCORE-316: HeaderGroup#clone removes headers from the original object
Contributed by Markus Thies <markus at dr-thies.com>

Modified:
    httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java

Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=1398061&r1=1398060&r2=1398061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Sun Oct 14 11:57:42 2012
@@ -1,5 +1,8 @@
 Changes in trunk
 
+* [HTTPCORE-316] HeaderGroup#clone removes headers from the original object.
+  Contributed by Markus Thies <markus at dr-thies.com> 
+
 * [HTTPCORE-315] AbstractNIOConnPool fails to correctly deallocate connection if it is immediately

   released from the session request callback causing a resource leak.
   Contributed by Scott Stanton <snstanton at gmail.com> 

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=1398061&r1=1398060&r2=1398061&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 Oct 14 11:57:42 2012
@@ -290,10 +290,7 @@ public class HeaderGroup implements Clon
 
     @Override
     public Object clone() throws CloneNotSupportedException {
-        HeaderGroup clone = (HeaderGroup) super.clone();
-        clone.headers.clear();
-        clone.headers.addAll(this.headers);
-        return clone;
+        return super.clone();
     }
 
     @Override

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java?rev=1398061&r1=1398060&r2=1398061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java
Sun Oct 14 11:57:42 2012
@@ -179,6 +179,7 @@ public class TestHeaderGroup {
         Header[] headers2 = clone.getAllHeaders();
         Assert.assertNotNull(headers1);
         Assert.assertNotNull(headers2);
+        Assert.assertEquals(3, headers2.length);
         Assert.assertEquals(headers1.length, headers2.length);
         for (int i = 0; i < headers1.length; i++) {
             Assert.assertEquals(headers1[i].getName(), headers2[i].getName());



Mime
View raw message