Source:
<code>public SnapshotsInProgress(StreamInput in) throws IOException { Entry[] entries = new Entry[in.readVInt()]; for (int i = 0; i < entries.length; i++) { Snapshot snapshot = new Snapshot(in); boolean includeGlobalState = in.readBoolean(); boolean partial = in.readBoolean(); State state = State.fromValue(in.readByte()); int indices = in.readVInt(); List<IndexId> indexBuilder = new ArrayList<>(); for (int j = 0; j < indices; j++) { indexBuilder.add(new IndexId(in.readString(), in.readString())); } long startTime = in.readLong(); ImmutableOpenMap.Builder<ShardId, ShardSnapshotStatus> builder = ImmutableOpenMap.builder(); int shards = in.readVInt(); for (int j = 0; j < shards; j++) { ShardId shardId = new ShardId(in); builder.put(shardId, new ShardSnapshotStatus(in)); } long repositoryStateId = in.readLong(); final String failure = in.readOptionalString(); final Map<String, Object> userMetadata = in.readMap(); final Version version; if (in.getVersion().onOrAfter(VERSION_IN_SNAPSHOT_VERSION)) { version = Version.readVersion(in); } else { version = in.readBoolean() ? SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION : SnapshotsService.OLD_SNAPSHOT_FORMAT; } <START> List<String> dataStreams = Collections.emptyList(); <END> if (in.getVersion().onOrAfter(DATA_STREAMS_IN_SNAPSHOT)){ dataStreams = Arrays.asList(in.readStringArray()); } entries[i] = new Entry(snapshot, includeGlobalState, partial, state, Collections.unmodifiableList(indexBuilder), dataStreams, startTime, repositoryStateId, builder.build(), failure, userMetadata, version ); } this.entries = Arrays.asList(entries); }</code><technical_language>NIT: refactor this a cleaner to: java final List<String> dataStreams; if (in.getVersion().onOrAfter(DATA_STREAMS_IN_SNAPSHOT)){ dataStreams = Arrays.asList(in.readStringArray()); } else { dataStreams = Collections.emptyList(); }</technical_language>

Target:
public SnapshotsInProgress(StreamInput in) throws IOException { Entry[] entries = new Entry[in.readVInt()]; for (int i = 0; i < entries.length; i++) { Snapshot snapshot = new Snapshot(in); boolean includeGlobalState = in.readBoolean(); boolean partial = in.readBoolean(); State state = State.fromValue(in.readByte()); int indices = in.readVInt(); List<IndexId> indexBuilder = new ArrayList<>(); for (int j = 0; j < indices; j++) { indexBuilder.add(new IndexId(in.readString(), in.readString())); } long startTime = in.readLong(); ImmutableOpenMap.Builder<ShardId, ShardSnapshotStatus> builder = ImmutableOpenMap.builder(); int shards = in.readVInt(); for (int j = 0; j < shards; j++) { ShardId shardId = new ShardId(in); builder.put(shardId, new ShardSnapshotStatus(in)); } long repositoryStateId = in.readLong(); final String failure = in.readOptionalString(); final Map<String, Object> userMetadata = in.readMap(); final Version version; if (in.getVersion().onOrAfter(VERSION_IN_SNAPSHOT_VERSION)) { version = Version.readVersion(in); } else { version = in.readBoolean() ? SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION : SnapshotsService.OLD_SNAPSHOT_FORMAT; } entries[i] = new Entry(snapshot, includeGlobalState, partial, state, Collections.unmodifiableList(indexBuilder), startTime, repositoryStateId, builder.build(), failure, userMetadata, version ); } this.entries = Arrays.asList(entries); }