From 1ad64a97ecd7bb2b2066c21ef59879b61e26f2e1 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 7 Jan 2015 12:48:30 -0800 Subject: [PATCH] Mappings: Remove includeExisting flag from adding ObjectMapper and FieldMapper listeners This flag is unused by the 2 places that add these listeners. --- .../org/elasticsearch/index/mapper/DocumentMapper.java | 10 ++-------- .../org/elasticsearch/index/mapper/MapperService.java | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java b/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java index 443cdaa54b2..d6b369ccd28 100644 --- a/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java @@ -666,11 +666,8 @@ public class DocumentMapper implements ToXContent { } } - public void addFieldMapperListener(FieldMapperListener fieldMapperListener, boolean includeExisting) { + public void addFieldMapperListener(FieldMapperListener fieldMapperListener) { fieldMapperListeners.add(fieldMapperListener); - if (includeExisting) { - traverse(fieldMapperListener); - } } public void traverse(FieldMapperListener listener) { @@ -702,11 +699,8 @@ public class DocumentMapper implements ToXContent { } } - public void addObjectMapperListener(ObjectMapperListener objectMapperListener, boolean includeExisting) { + public void addObjectMapperListener(ObjectMapperListener objectMapperListener) { objectMapperListeners.add(objectMapperListener); - if (includeExisting) { - traverse(objectMapperListener); - } } public void traverse(ObjectMapperListener listener) { diff --git a/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/src/main/java/org/elasticsearch/index/mapper/MapperService.java index 7cbc13ec1cd..5c32b8cdae9 100755 --- a/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -352,12 +352,12 @@ public class MapperService extends AbstractIndexComponent { FieldMapperListener.Aggregator fieldMappersAgg = new FieldMapperListener.Aggregator(); mapper.traverse(fieldMappersAgg); addFieldMappers(fieldMappersAgg.mappers); - mapper.addFieldMapperListener(fieldMapperListener, false); + mapper.addFieldMapperListener(fieldMapperListener); ObjectMapperListener.Aggregator objectMappersAgg = new ObjectMapperListener.Aggregator(); mapper.traverse(objectMappersAgg); addObjectMappers(objectMappersAgg.mappers.toArray(new ObjectMapper[objectMappersAgg.mappers.size()])); - mapper.addObjectMapperListener(objectMapperListener, false); + mapper.addObjectMapperListener(objectMapperListener); for (DocumentTypeListener typeListener : typeListeners) { typeListener.beforeCreate(mapper);