From 27067de69911f32ef29b4f084e6559f149235361 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Tue, 14 Jul 2020 10:44:24 +0100 Subject: [PATCH] Make MappedFieldType#meta final (#59383) The MappedFieldType#updateMeta method was used for testing equality checks, but we no longer need these after #59212 , so we can remove this method and make meta final. --- .../java/org/elasticsearch/index/mapper/FieldMapper.java | 1 - .../org/elasticsearch/index/mapper/MappedFieldType.java | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index 9d21c4a76b7..30f38ce16d8 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -324,7 +324,6 @@ public abstract class FieldMapper extends Mapper implements Cloneable { FieldType other = mergeWith.fieldType; MappedFieldType otherm = mergeWith.mappedFieldType; - this.mappedFieldType.updateMeta(otherm.meta()); boolean indexed = fieldType.indexOptions() != IndexOptions.NONE; boolean mergeWithIndexed = other.indexOptions() != IndexOptions.NONE; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java index 098bfd40efd..55c130652d0 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java @@ -64,10 +64,10 @@ public abstract class MappedFieldType { private final boolean docValues; private final boolean isIndexed; private final TextSearchInfo textSearchInfo; + private final Map meta; private float boost; private NamedAnalyzer indexAnalyzer; private boolean eagerGlobalOrdinals; - private Map meta; public MappedFieldType(String name, boolean isIndexed, boolean hasDocValues, TextSearchInfo textSearchInfo, Map meta) { setBoost(1.0f); @@ -348,13 +348,6 @@ public abstract class MappedFieldType { return meta; } - /** - * Associate metadata with this field. - */ - public void updateMeta(Map meta) { - this.meta = meta; - } - /** * Returns information on how any text in this field is indexed *