fix generics compile error in Eclipse

Eclipse compiler needs a hint to tell it the generics for the comparator function

Original commit: elastic/x-pack-elasticsearch@b3d71d3465
This commit is contained in:
Colin Goodheart-Smithe 2017-01-05 16:23:16 +00:00
parent 70aa238327
commit 8fdeedf61d
1 changed files with 3 additions and 2 deletions

View File

@ -39,6 +39,7 @@ import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
/**
* Scheduler configuration options. Describes where to proactively pull input
@ -98,7 +99,7 @@ public class SchedulerConfig extends ToXContentToBytes implements Writeable {
while (p.nextToken() != XContentParser.Token.END_OBJECT) {
parsedScriptFields.add(new SearchSourceBuilder.ScriptField(new QueryParseContext(p, ParseFieldMatcher.STRICT)));
}
Collections.sort(parsedScriptFields, Comparator.comparing(f -> f.fieldName()));
Collections.sort(parsedScriptFields, Comparator.comparing((Function<SearchSourceBuilder.ScriptField, String>) f -> f.fieldName()));
return parsedScriptFields;
}, SCRIPT_FIELDS);
PARSER.declareInt(Builder::setScrollSize, SCROLL_SIZE);
@ -431,7 +432,7 @@ public class SchedulerConfig extends ToXContentToBytes implements Writeable {
public void setScriptFields(List<SearchSourceBuilder.ScriptField> scriptFields) {
List<SearchSourceBuilder.ScriptField> sorted = new ArrayList<>(scriptFields);
Collections.sort(sorted, Comparator.comparing(f -> f.fieldName()));
Collections.sort(sorted, Comparator.comparing((Function<SearchSourceBuilder.ScriptField, String>) f -> f.fieldName()));
this.scriptFields = sorted;
}