psalagnac commented on code in PR #3834:
URL: https://github.com/apache/solr/pull/3834#discussion_r2491500362
##########
solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java:
##########
@@ -388,9 +378,9 @@ public Replica copyWith(PerReplicaStates.State state) {
}
public Replica copyWith(State state) {
- Replica r = new Replica(name, propMap, collection, shard);
- r.setState(state);
- return r;
+ Map<String, Object> newProps = new LinkedHashMap<>(propMap);
Review Comment:
Yes, since we don't want to touch the current replica. I think a `Replica`
instance should be immutable (unfortunately, it is not fully). This change does
a small step in this direction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]