From 7cacfa0769e2a5f52dd70f9fd535081ad6bbc6b4 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 14 May 2015 14:57:09 -0700 Subject: [PATCH] Change includes/excludes back to null based for now, since it complicates serialization and causes a number of test failures. --- .../index/mapper/internal/SourceFieldMapper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java index 26513ddaeb6..45e5f26f568 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java @@ -222,8 +222,8 @@ public class SourceFieldMapper extends AbstractFieldMapper implements Ro this.enabled = enabled; this.compress = compress; this.compressThreshold = compressThreshold; - this.includes = includes == null ? Strings.EMPTY_ARRAY : includes; - this.excludes = excludes == null ? Strings.EMPTY_ARRAY : excludes; + this.includes = includes; + this.excludes = excludes; this.format = format; this.formatContentType = format == null ? null : XContentType.fromRestContentType(format); this.complete = enabled && includes == null && excludes == null; @@ -234,12 +234,12 @@ public class SourceFieldMapper extends AbstractFieldMapper implements Ro } public String[] excludes() { - return excludes; + return this.excludes != null ? this.excludes : Strings.EMPTY_ARRAY; } public String[] includes() { - return includes; + return this.includes != null ? this.includes : Strings.EMPTY_ARRAY; } public boolean isComplete() { @@ -433,10 +433,10 @@ public class SourceFieldMapper extends AbstractFieldMapper implements Ro if (this.enabled != sourceMergeWith.enabled) { mergeResult.addConflict("Cannot update enabled setting for [_source]"); } - if (Arrays.equals(includes, sourceMergeWith.includes) == false) { + if (Arrays.equals(includes(), sourceMergeWith.includes()) == false) { mergeResult.addConflict("Cannot update includes setting for [_source]"); } - if (Arrays.equals(excludes, sourceMergeWith.excludes) == false) { + if (Arrays.equals(excludes(), sourceMergeWith.excludes()) == false) { mergeResult.addConflict("Cannot update excludes setting for [_source]"); } } else {