You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2018/07/26 21:33:01 UTC

httpcomponents-core git commit: [HTTPCORE-547] Update org.apache.hc.core5.http.message.HeaderGroup.removeHeaders(String) to return a boolean.

Repository: httpcomponents-core
Updated Branches:
  refs/heads/master 308d558f0 -> aa4c3f08d


[HTTPCORE-547] Update
org.apache.hc.core5.http.message.HeaderGroup.removeHeaders(String) to
return a boolean.

Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/aa4c3f08
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/aa4c3f08
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/aa4c3f08

Branch: refs/heads/master
Commit: aa4c3f08d0d501c10ecd61d755d0992b3d836a2d
Parents: 308d558
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 26 15:32:57 2018 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 26 15:32:57 2018 -0600

----------------------------------------------------------------------
 RELEASE_NOTES.txt                                         |  3 +++
 .../org/apache/hc/core5/http/message/HeaderGroup.java     | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/aa4c3f08/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 823cf2b..965c667 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -43,6 +43,9 @@ adds several incremental improvements.
 * HTTPCORE-546: Update org.apache.hc.core5.http.message.HeaderGroup.removeHeader(Header) to return a boolean  
   Contributed by Gary Gregory <ggregory at apache.org>
 
+* HTTPCORE-547: Update org.apache.hc.core5.http.message.HeaderGroup.removeHeaders(String) to return a boolean
+  Contributed by Gary Gregory <ggregory at apache.org>
+
 Release 5.0-BETA2
 -------------------
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/aa4c3f08/httpcore5/src/main/java/org/apache/hc/core5/http/message/HeaderGroup.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/message/HeaderGroup.java b/httpcore5/src/main/java/org/apache/hc/core5/http/message/HeaderGroup.java
index d17cd3a..59098fb 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/message/HeaderGroup.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/message/HeaderGroup.java
@@ -380,19 +380,23 @@ public class HeaderGroup implements MessageHeaders, Serializable {
      * Removes all headers with a given name in this group.
      *
      * @param name      the name of the headers to be removed.
-     *
+     * @return <code>true</code> if any header was removed as a result of this call.
+     * 
      * @since 5.0
      */
-    public void removeHeaders(final String name) {
+    public boolean removeHeaders(final String name) {
         if (name == null) {
-            return;
+            return false;
         }
+        boolean removed = false;
         for (final Iterator<Header> iterator = headerIterator(); iterator.hasNext(); ) {
             final Header header = iterator.next();
             if (header.getName().equalsIgnoreCase(name)) {
                 iterator.remove();
+                removed = true;
             }
         }
+        return removed;
     }
 
     @Override