diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java index d19d46ccfb4..61ec31b2699 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -64,7 +64,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable(size); - for (; size > 0; size--) { + for (int i = 0; i < size; i++) { this.versions.add(Version.readVersion(in)); } @@ -75,7 +75,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable(size); - for (; size > 0; size--) { + for (int i = 0; i < size; i++) { this.plugins.add(PluginInfo.readFromStream(in)); } } @@ -477,7 +477,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable(size); - for (; size > 0; size--) { + for (int i = 0; i < size; i++) { this.versions.addTo(JvmVersion.readJvmVersion(in), in.readVInt()); } this.threads = in.readVLong(); @@ -664,6 +664,4 @@ public class ClusterStatsNodes implements ToXContent, Writeable