Skip to content

Commit 12a618c

Browse files
author
Christoph Büscher
committed
Fix Eclipse compilation in DataFrameDataExtractorTests (#48942)
1 parent 1ed5682 commit 12a618c

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/extractor/DataFrameDataExtractorTests.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.xpack.core.ml.dataframe.analyses.OutlierDetectionTests;
2929
import org.elasticsearch.xpack.core.ml.dataframe.analyses.Regression;
3030
import org.elasticsearch.xpack.ml.extractor.DocValueField;
31+
import org.elasticsearch.xpack.ml.extractor.ExtractedField;
3132
import org.elasticsearch.xpack.ml.extractor.ExtractedFields;
3233
import org.elasticsearch.xpack.ml.extractor.SourceField;
3334
import org.elasticsearch.xpack.ml.test.SearchHitBuilder;
@@ -295,9 +296,10 @@ public void testIncludeSourceIsFalseAndNoSourceFields() throws IOException {
295296
}
296297

297298
public void testIncludeSourceIsFalseAndAtLeastOneSourceField() throws IOException {
299+
// Explicit cast of ExtractedField args necessary for Eclipse due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=530915
298300
extractedFields = new ExtractedFields(Arrays.asList(
299-
new DocValueField("field_1", Collections.singleton("keyword")),
300-
new SourceField("field_2", Collections.singleton("text"))));
301+
(ExtractedField) new DocValueField("field_1", Collections.singleton("keyword")),
302+
(ExtractedField) new SourceField("field_2", Collections.singleton("text"))));
301303

302304
TestExtractor dataExtractor = createExtractor(false, false);
303305

@@ -391,16 +393,17 @@ public void testMissingValues_GivenShouldInclude() throws IOException {
391393
}
392394

393395
public void testGetCategoricalFields() {
396+
// Explicit cast of ExtractedField args necessary for Eclipse due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=530915
394397
extractedFields = new ExtractedFields(Arrays.asList(
395-
new DocValueField("field_boolean", Collections.singleton("boolean")),
396-
new DocValueField("field_float", Collections.singleton("float")),
397-
new DocValueField("field_double", Collections.singleton("double")),
398-
new DocValueField("field_byte", Collections.singleton("byte")),
399-
new DocValueField("field_short", Collections.singleton("short")),
400-
new DocValueField("field_integer", Collections.singleton("integer")),
401-
new DocValueField("field_long", Collections.singleton("long")),
402-
new DocValueField("field_keyword", Collections.singleton("keyword")),
403-
new SourceField("field_text", Collections.singleton("text"))));
398+
(ExtractedField) new DocValueField("field_boolean", Collections.singleton("boolean")),
399+
(ExtractedField) new DocValueField("field_float", Collections.singleton("float")),
400+
(ExtractedField) new DocValueField("field_double", Collections.singleton("double")),
401+
(ExtractedField) new DocValueField("field_byte", Collections.singleton("byte")),
402+
(ExtractedField) new DocValueField("field_short", Collections.singleton("short")),
403+
(ExtractedField) new DocValueField("field_integer", Collections.singleton("integer")),
404+
(ExtractedField) new DocValueField("field_long", Collections.singleton("long")),
405+
(ExtractedField) new DocValueField("field_keyword", Collections.singleton("keyword")),
406+
(ExtractedField) new SourceField("field_text", Collections.singleton("text"))));
404407
TestExtractor dataExtractor = createExtractor(true, true);
405408

406409
assertThat(dataExtractor.getCategoricalFields(OutlierDetectionTests.createRandom()), empty());

0 commit comments

Comments
 (0)