You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2012/10/14 13:55:33 UTC

svn commit: r1398060 - in /httpcomponents/httpcore/branches/4.2.x: RELEASE_NOTES.txt httpcore/src/main/java/org/apache/http/message/HeaderGroup.java httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java

Author: olegk
Date: Sun Oct 14 11:55:32 2012
New Revision: 1398060

URL: http://svn.apache.org/viewvc?rev=1398060&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/branches/4.2.x/RELEASE_NOTES.txt
    httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
    httpcomponents/httpcore/branches/4.2.x/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java

Modified: httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt?rev=1398060&r1=1398059&r2=1398060&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt Sun Oct 14 11:55:32 2012
@@ -1,12 +1,22 @@
 Changes since Release 4.2.2
 =======
 
+* [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> 
 
 * [HTTPCORE-313] ContentType#parse now ignores empty attributes. HttpEntityUtils#toString now 
-  throws checked I/O exception if it  encounters an unsupported charset. 
+  throws checked I/O exception if it encounters an unsupported charset. 
+
+* [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> 
+
+* [HTTPCORE-313] ContentType#parse now ignores empty and blank charset attributes. 
+  HttpEntityUtils#toString now throws checked I/O exception ifit  encounters an unsupported charset. 
   Contributed by Oleg Kalnichevski <olegk at apache.org>
 
 

Modified: httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java?rev=1398060&r1=1398059&r2=1398060&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java (original)
+++ httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/message/HeaderGroup.java Sun Oct 14 11:55:32 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/branches/4.2.x/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java?rev=1398060&r1=1398059&r2=1398060&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java (original)
+++ httpcomponents/httpcore/branches/4.2.x/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java Sun Oct 14 11:55:32 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());