Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2013-09-08 21:02:24 +0000
committerSimone Bordet2013-09-08 21:02:24 +0000
commit400f0ce5a29d5d8e65ef8bb918026c1461a5111a (patch)
treefec69fc23839d3fa2b49b995b95060a2cf43ee3f
parent092fb2d36a807307fc22759c7794e3cc3f2f5d34 (diff)
downloadorg.eclipse.jetty.project-400f0ce5a29d5d8e65ef8bb918026c1461a5111a.tar.gz
org.eclipse.jetty.project-400f0ce5a29d5d8e65ef8bb918026c1461a5111a.tar.xz
org.eclipse.jetty.project-400f0ce5a29d5d8e65ef8bb918026c1461a5111a.zip
Made remove() methods return the removed value.
-rw-r--r--jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
index c6b6762aa0..c8f3b4f23e 100644
--- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
+++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
@@ -18,10 +18,6 @@
package org.eclipse.jetty.http;
-import static org.eclipse.jetty.util.QuotedStringTokenizer.isQuoted;
-import static org.eclipse.jetty.util.QuotedStringTokenizer.quoteOnly;
-
-import java.io.IOException;
import java.nio.ByteBuffer;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -47,12 +43,13 @@ import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.DateCache;
import org.eclipse.jetty.util.LazyList;
import org.eclipse.jetty.util.QuotedStringTokenizer;
-import org.eclipse.jetty.util.StringMap;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.Trie;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
+import static org.eclipse.jetty.util.QuotedStringTokenizer.isQuoted;
+
/**
* HTTP Fields. A collection of HTTP header and or Trailer fields.
@@ -649,14 +646,15 @@ public class HttpFields implements Iterable<HttpField>
*
* @param name the field to remove
*/
- public void remove(HttpHeader name)
+ public HttpField remove(HttpHeader name)
{
for (int i=_fields.size();i-->0;)
{
HttpField f=_fields.get(i);
if (f.getHeader()==name)
- _fields.remove(i);
+ return _fields.remove(i);
}
+ return null;
}
/**
@@ -664,14 +662,15 @@ public class HttpFields implements Iterable<HttpField>
*
* @param name the field to remove
*/
- public void remove(String name)
+ public HttpField remove(String name)
{
for (int i=_fields.size();i-->0;)
{
HttpField f=_fields.get(i);
if (f.getName().equalsIgnoreCase(name))
- _fields.remove(i);
+ return _fields.remove(i);
}
+ return null;
}
/**

Back to the top