Fix FieldCapabilities compilation in Eclipse (#23855)

Eclipse can't deal with the generics, maybe the fixed but
unreleased https://bugs.eclipse.org/bugs/show_bug.cgi?id=511750
This commit is contained in:
Nik Everett 2017-03-31 12:10:15 -04:00 committed by GitHub
parent ebd74f09cf
commit ba62229f47
1 changed files with 3 additions and 1 deletions

View File

@ -227,7 +227,9 @@ public class FieldCapabilities implements Writeable, ToXContent {
FieldCapabilities build(boolean withIndices) { FieldCapabilities build(boolean withIndices) {
final String[] indices; final String[] indices;
Collections.sort(indiceList, Comparator.comparing(o -> o.name)); /* 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));
if (withIndices) { if (withIndices) {
indices = indiceList.stream() indices = indiceList.stream()
.map(caps -> caps.name) .map(caps -> caps.name)