diff --git a/core/src/main/java/org/elasticsearch/search/fetch/fielddata/FieldDataFieldsFetchSubPhase.java b/core/src/main/java/org/elasticsearch/search/fetch/fielddata/FieldDataFieldsFetchSubPhase.java index 0c4e6d2cfa0..1ec0a98b1fa 100644 --- a/core/src/main/java/org/elasticsearch/search/fetch/fielddata/FieldDataFieldsFetchSubPhase.java +++ b/core/src/main/java/org/elasticsearch/search/fetch/fielddata/FieldDataFieldsFetchSubPhase.java @@ -45,7 +45,7 @@ import java.util.Map; public class FieldDataFieldsFetchSubPhase implements FetchSubPhase { public static final String[] NAMES = {"fielddata_fields", "fielddataFields"}; - public static final ContextFactory CONTEXT_FACTORY = new ContextFactory() { + public static final ContextFactory CONTEXT_FACTORY = new ContextFactory() { @Override public String getName() { @@ -53,7 +53,7 @@ public class FieldDataFieldsFetchSubPhase implements FetchSubPhase { } @Override - public FetchSubPhaseContext newContextInstance() { + public FieldDataFieldsContext newContextInstance() { return new FieldDataFieldsContext(); } }; @@ -86,7 +86,7 @@ public class FieldDataFieldsFetchSubPhase implements FetchSubPhase { @Override public void hitExecute(SearchContext context, HitContext hitContext) { - for (FieldDataFieldsContext.FieldDataField field : ((FieldDataFieldsContext)context.getFetchSubPhaseContext(CONTEXT_FACTORY)).fields()) { + for (FieldDataFieldsContext.FieldDataField field : context.getFetchSubPhaseContext(CONTEXT_FACTORY).fields()) { if (hitContext.hit().fieldsOrNull() == null) { hitContext.hit().fields(new HashMap(2)); } diff --git a/core/src/test/java/org/elasticsearch/search/fetch/FetchSubPhasePluginTests.java b/core/src/test/java/org/elasticsearch/search/fetch/FetchSubPhasePluginTests.java index d713d99774e..5579768ac9f 100644 --- a/core/src/test/java/org/elasticsearch/search/fetch/FetchSubPhasePluginTests.java +++ b/core/src/test/java/org/elasticsearch/search/fetch/FetchSubPhasePluginTests.java @@ -117,7 +117,7 @@ public class FetchSubPhasePluginTests extends ElasticsearchIntegrationTest { public static class TermVectorsFetchSubPhase implements FetchSubPhase { - public static final ContextFactory CONTEXT_FACTORY = new ContextFactory() { + public static final ContextFactory CONTEXT_FACTORY = new ContextFactory() { @Override public String getName() { @@ -125,7 +125,7 @@ public class FetchSubPhasePluginTests extends ElasticsearchIntegrationTest { } @Override - public FetchSubPhaseContext newContextInstance() { + public TermVectorsFetchContext newContextInstance() { return new TermVectorsFetchContext(); } }; @@ -158,7 +158,7 @@ public class FetchSubPhasePluginTests extends ElasticsearchIntegrationTest { @Override public void hitExecute(SearchContext context, HitContext hitContext) { - String field = ((TermVectorsFetchContext) context.getFetchSubPhaseContext(CONTEXT_FACTORY)).getField(); + String field = context.getFetchSubPhaseContext(CONTEXT_FACTORY).getField(); if (hitContext.hit().fieldsOrNull() == null) { hitContext.hit().fields(new HashMap());