From 797628e4dc22bbfb41ebe9601b142b0ac9b51f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Sun, 14 Jul 2019 11:20:43 +0200 Subject: [PATCH] Change version condition after backport Change AnalyzeAction response serialization version condition after #44284 has been backported --- .../action/admin/indices/analyze/AnalyzeAction.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java index 65c8e4bb760cc..91fc34433541b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java @@ -302,7 +302,7 @@ public Response(List tokens, DetailAnalyzeResponse detail) { public Response(StreamInput in) throws IOException { super.readFrom(in); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_3_0)) { AnalyzeToken[] tokenArray = in.readOptionalArray(AnalyzeToken::new, AnalyzeToken[]::new); tokens = tokenArray != null ? Arrays.asList(tokenArray) : null; } else { @@ -354,7 +354,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_3_0)) { AnalyzeToken[] tokenArray = null; if (tokens != null) { tokenArray = tokens.toArray(new AnalyzeToken[0]); @@ -722,7 +722,7 @@ public AnalyzeTokenList(String name, AnalyzeToken[] tokens) { AnalyzeTokenList(StreamInput in) throws IOException { name = in.readString(); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_3_0)) { tokens = in.readOptionalArray(AnalyzeToken::new, AnalyzeToken[]::new); } else { int size = in.readVInt(); @@ -767,7 +767,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_3_0)) { out.writeOptionalArray(tokens); } else { if (tokens != null) {