http://codereview.appspot.com/25063/diff/1/18 File java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java (right): http://codereview.appspot.com/25063/diff/1/18#newcode145 Line 145: Multimap<String, String> headerCopy = Multimaps.newTreeMultimap(String.CASE_INSENSITIVE_ORDER, null); Multimap is ...
16 years, 11 months ago
(2009-03-05 00:41:02 UTC)
#1
http://codereview.appspot.com/25063/diff/1/18
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java
(right):
http://codereview.appspot.com/25063/diff/1/18#newcode145
Line 145: Multimap<String, String> headerCopy =
Multimaps.newTreeMultimap(String.CASE_INSENSITIVE_ORDER, null);
Multimap is the right choice (for one thing, we weren't in fact cloning the
lists for each header name), but I think we want to keep insertion order of the
header values, not sort (which "null" will do here). That means using the
formidable
Multimaps.newMultimap(Collection, Supplier<Collection>>) API
http://codereview.appspot.com/25063/diff/1/17
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponseBuilder.java
(right):
http://codereview.appspot.com/25063/diff/1/17#newcode37
Line 37: private Multimap<String, String> headers = new
TreeMultimap<String,String>(String.CASE_INSENSITIVE_ORDER, null);
ditto
http://codereview.appspot.com/25063/diff/1/22
File java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/GadgetSpec.java
(right):
http://codereview.appspot.com/25063/diff/1/22#newcode25
Line 25: import com.google.common.collect.*;
I'm no fan of .* imports, nor is most of the Shindig code. YMMV.
Issue 25063: Google Collections 0.9 and Multimap Http Headers
(Closed)
Created 16 years, 11 months ago by Paul Lindner
Modified 15 years, 9 months ago
Reviewers: awiner
Base URL: https://svn.apache.org/repos/asf/incubator/shindig/trunk/
Comments: 3