You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by jeme <gi...@git.apache.org> on 2017/09/15 07:29:32 UTC

[GitHub] lucenenet pull request #:

Github user jeme commented on the pull request:

    https://github.com/apache/lucenenet/commit/34ef2ce56c48beeb36e3a608c5339b84b36a5414#commitcomment-24318879
  
    Does this make any sense to change?... The only thing it does is making the dictionary readonly for the ReplicatorService. If we desired that then we could just wrap it in the constructor
    
    If the desired is to make it impossible to change the "shards/indexes" after the replicator is started, this doesn't do that the one providing you with the dictionary can still change the internal structure:
    
    ```
    Dictionary<string, string> dict = ...;
    ReadOnlyDictionary<string, string> rdict = new ReadOnlyDictionary<string, string>(dict);
    dict["addmee"] = "YES"; // Readonly dictionary changed because the underlying dictionary was.
    ```
    
    So if that is the desire, we need to copy the content instead.


---