Просмотр исходного кода

Remove some unneeded eclipse workarounds (#47987)

Christoph Büscher 5 лет назад
Родитель
Сommit
111d7c2bf7

+ 1 - 3
server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java

@@ -310,9 +310,7 @@ public class FieldCapabilities implements Writeable, ToXContentObject {
 
         FieldCapabilities build(boolean withIndices) {
             final String[] indices;
-            /* Eclipse can't deal with o -> o.name, maybe because of
-             * https://bugs.eclipse.org/bugs/show_bug.cgi?id=511750 */
-            Collections.sort(indiceList, Comparator.comparing((IndexCaps o) -> o.name));
+            Collections.sort(indiceList, Comparator.comparing(o -> o.name));
             if (withIndices) {
                 indices = indiceList.stream()
                     .map(caps -> caps.name)

+ 1 - 0
server/src/main/java/org/elasticsearch/gateway/GatewayAllocator.java

@@ -20,6 +20,7 @@
 package org.elasticsearch.gateway;
 
 import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
+
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.message.ParameterizedMessage;

+ 2 - 3
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowStats.java

@@ -114,9 +114,8 @@ public class AutoFollowStats implements Writeable, ToXContentObject {
         numberOfFailedFollowIndices = in.readVLong();
         numberOfFailedRemoteClusterStateRequests = in.readVLong();
         numberOfSuccessfulFollowIndices = in.readVLong();
-        // note: the casts to the following Writeable.Reader<T> instances are needed by some IDEs (e.g. Eclipse 4.8) as a compiler help
-        recentAutoFollowErrors = new TreeMap<>(in.readMap(StreamInput::readString,
-            in1 -> new Tuple<>(in1.readZLong(), in1.readException())));
+        recentAutoFollowErrors = new TreeMap<>(
+                in.readMap(StreamInput::readString, in1 -> new Tuple<>(in1.readZLong(), in1.readException())));
         autoFollowedClusters = new TreeMap<>(in.readMap(StreamInput::readString, AutoFollowedCluster::new));
     }