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.
This commit is contained in:
Christoph Büscher 2020-01-02 14:28:50 +01:00
parent ab5a69d1e2
commit 1599af8428
1 changed files with 4 additions and 1 deletions

View File

@ -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++;