Use utility
This commit is contained in:
parent
aa06433868
commit
ffa5b27c75
|
@ -64,7 +64,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -76,6 +75,7 @@ import java.util.function.Function;
|
|||
import static java.util.Collections.emptySet;
|
||||
import static java.util.Collections.unmodifiableSet;
|
||||
import static org.elasticsearch.common.collect.MapBuilder.newMapBuilder;
|
||||
import static org.elasticsearch.common.util.set.Sets.newHashSetCopyWith;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -288,10 +288,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
|
|||
}
|
||||
mappers = newMapBuilder(mappers).put(mapper.type(), mapper).map();
|
||||
if (mapper.parentFieldMapper().active()) {
|
||||
Set<String> parentTypesCopy = new HashSet<String>();
|
||||
parentTypesCopy.addAll(parentTypes);
|
||||
parentTypesCopy.add(mapper.parentFieldMapper().type());
|
||||
parentTypes = unmodifiableSet(parentTypesCopy);
|
||||
parentTypes = unmodifiableSet(newHashSetCopyWith(parentTypes, mapper.parentFieldMapper().type()));
|
||||
}
|
||||
assert assertSerialization(mapper);
|
||||
return mapper;
|
||||
|
|
Loading…
Reference in New Issue