diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java index b13701a60f243..3a62392b6beaf 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.xpack.ml.job.results; -import org.elasticsearch.Version; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -127,12 +126,8 @@ public AutodetectResult(StreamInput in) throws IOException { } else { this.modelPlot = null; } - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { - if (in.readBoolean()) { - this.annotation = new Annotation(in); - } else { - this.annotation = null; - } + if (in.readBoolean()) { + this.annotation = new Annotation(in); } else { this.annotation = null; } @@ -168,9 +163,7 @@ public void writeTo(StreamOutput out) throws IOException { writeNullable(modelSnapshot, out); writeNullable(modelSizeStats, out); writeNullable(modelPlot, out); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { - writeNullable(annotation, out); - } + writeNullable(annotation, out); writeNullable(categoryDefinition, out); writeNullable(flushAcknowledgement, out); writeNullable(forecast, out);