Skip to content

Commit

Permalink
Make JdkMapDiff return immutable map (#88250)
Browse files Browse the repository at this point in the history
  • Loading branch information
grcevski authored Jul 6, 2022
1 parent 8e0137e commit 55fd4c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -242,7 +243,7 @@ public Map<K, T> apply(Map<K, T> map) {
builder.put(upsert.getKey(), upsert.getValue());
}

return builder;
return Collections.unmodifiableMap(builder);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ public Metadata apply(Metadata part) {
builder.indices(updatedIndices);
builder.templates(templates.apply(part.templates));
builder.customs(customs.apply(part.customs));
builder.put(Collections.unmodifiableMap(immutableStateMetadata.apply(part.immutableStateMetadata)));
return builder.build(true);
builder.put(immutableStateMetadata.apply(part.immutableStateMetadata));
return builder.build();
}
}

Expand Down

0 comments on commit 55fd4c6

Please sign in to comment.