From c33f894846989694f6d6fdc250ae396a88545c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Fri, 3 Feb 2017 16:16:51 +0100 Subject: [PATCH] Fixing compilation problem in Eclipse (#22956) --- .../http/netty4/Netty4HttpRequest.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpRequest.java b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpRequest.java index c3b37ef7be8..f3099db08e9 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpRequest.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpRequest.java @@ -31,6 +31,7 @@ import org.elasticsearch.rest.RestRequest; import org.elasticsearch.transport.netty4.Netty4Utils; import java.net.SocketAddress; +import java.util.AbstractMap; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -199,23 +200,8 @@ public class Netty4HttpRequest extends RestRequest { @Override public Set>> entrySet() { - return httpHeaders.names().stream().map(k -> new Entry>() { - - @Override - public String getKey() { - return k; - } - - @Override - public List getValue() { - return httpHeaders.getAll(k); - } - - @Override - public List setValue(List value) { - throw new UnsupportedOperationException("modifications are not supported"); - } - }).collect(Collectors.toSet()); + return httpHeaders.names().stream().map(k -> new AbstractMap.SimpleImmutableEntry<>(k, httpHeaders.getAll(k))) + .collect(Collectors.toSet()); } } }