From 1599af8428ebf247f54cecd6be4f3af4f354428c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 2 Jan 2020 14:28:50 +0100 Subject: [PATCH] Fix type conversion problem in Eclipse (#50549) Eclipse 4.13 shows a type mismatch error in the affected line because it cannot correctly infer the boolean return type for the method call. Assigning return value to a local variable resolves this problem. --- .../elasticsearch/xpack/ml/integration/ClassificationIT.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java index 632a4ee794e..6b2e2730b03 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java @@ -6,6 +6,7 @@ package org.elasticsearch.xpack.ml.integration; import com.google.common.collect.Ordering; + import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.action.admin.indices.get.GetIndexAction; import org.elasticsearch.action.admin.indices.get.GetIndexRequest; @@ -192,7 +193,9 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertTopClasses(resultsObject, numTopClasses, dependentVariable, dependentVariableValues); // Let's just assert there's both training and non-training results - if (getFieldValue(resultsObject, "is_training")) { + // + boolean isTraining = getFieldValue(resultsObject, "is_training"); + if (isTraining) { trainingRowsCount++; } else { nonTrainingRowsCount++;