Skip to content

Commit

Permalink
Fix Mutable Data Structure in SnapshotsInProgress (#76505) (#76523)
Browse files Browse the repository at this point in the history
The feature info instances shouldn't be mutable to prevent accidental bugs down the line.
  • Loading branch information
original-brownbear committed Aug 14, 2021
1 parent 377517a commit b658b24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ private Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, St
this.partial = partial;
this.indices = org.elasticsearch.core.Map.copyOf(indices);
this.dataStreams = org.elasticsearch.core.List.copyOf(dataStreams);
this.featureStates = Collections.unmodifiableList(featureStates);
this.featureStates = org.elasticsearch.core.List.copyOf(featureStates);
this.startTime = startTime;
this.shards = shards;
this.repositoryStateId = repositoryStateId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ public class SnapshotFeatureInfo implements Writeable, ToXContentObject {

public SnapshotFeatureInfo(String pluginName, List<String> indices) {
this.pluginName = pluginName;
this.indices = indices;
this.indices = org.elasticsearch.core.List.copyOf(indices);
}

public SnapshotFeatureInfo(final StreamInput in) throws IOException {
this.pluginName = in.readString();
this.indices = in.readStringList();
this(in.readString(), in.readStringList());
}

@Override
Expand Down

0 comments on commit b658b24

Please sign in to comment.