[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15938251#comment-15938251 ] David Smiley commented on SOLR-9184: [~koji] Welcome back to committing to Solr :-) > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Assignee: Koji Sekiguchi >Priority: Minor > Fix For: 6.6 > > Attachments: SOLR-9184.patch, SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15937823#comment-15937823 ] ASF subversion and git services commented on SOLR-9184: --- Commit bcd452c6a1026bcec814e355b8366c9b4ece49e0 in lucene-solr's branch refs/heads/branch_6x from koji [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=bcd452c ] SOLR-9184: Add a static convenience method ModifiableSolrParams#of(SolrParams) which returns the same instance if it already is modifiable, otherwise creates a new ModifiableSolrParams instance. > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Assignee: Koji Sekiguchi >Priority: Minor > Attachments: SOLR-9184.patch, SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15937779#comment-15937779 ] ASF subversion and git services commented on SOLR-9184: --- Commit 583fec1a58b41a0562529e6228a29728a790d87c in lucene-solr's branch refs/heads/master from koji [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=583fec1 ] SOLR-9184: Add a static convenience method ModifiableSolrParams#of(SolrParams) which returns the same instance if it already is modifiable, otherwise creates a new ModifiableSolrParams instance. > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Assignee: Koji Sekiguchi >Priority: Minor > Attachments: SOLR-9184.patch, SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15935705#comment-15935705 ] Koji Sekiguchi commented on SOLR-9184: -- I think this is almost ready. How about adding assertNotSame for the first test? > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Priority: Minor > Attachments: SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15316174#comment-15316174 ] David Smiley commented on SOLR-9184: +1 to this. Solr should use this internally at any applicable spot where it's doing the instanceof check today. > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Priority: Minor > Attachments: SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15314218#comment-15314218 ] Jörg Rathlev commented on SOLR-9184: Sorry about removing the first patch file. I accidentally left a println added for debugging in the first version and removed it. This change simply adds a static factory method, it does not propose to modify the existing constructor. I agree that intentional use of the copy constructor is a valid use case that must be supported. > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Priority: Minor > Attachments: SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-9184) Add convenience method to ModifiableSolrParams
[ https://issues.apache.org/jira/browse/SOLR-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15314206#comment-15314206 ] Shawn Heisey commented on SOLR-9184: There's no need to remove previous patches. Jira automatically handles marking the old ones differently than the newest one with the same filename. Having previous versions of a patch available helps to understand the thought processes of the person who created the patches -- we prefer to keep that history, even if the older patches are blatantly wrong. Although I like this change, it probably should be restricted to master (7.0-SNAPSHOT) because it could break existing code. There are likely people who intentionally use the constructor to *copy* one MSP object, creating a new one that can be modified independently of the original. If we change that behavior in a minor release, any user who depends on that behavior will have a broken program after upgrading SolrJ. There might even be instances in the Solr main or test code that rely on this behavior -- all uses must be reviewed. > Add convenience method to ModifiableSolrParams > -- > > Key: SOLR-9184 > URL: https://issues.apache.org/jira/browse/SOLR-9184 > Project: Solr > Issue Type: Improvement > Components: SolrJ >Reporter: Jörg Rathlev >Priority: Minor > Attachments: SOLR-9184.patch > > > Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which > returns the same instance if it already is modifiable, otherwise creates a > new {{ModifiableSolrParams}} instance. > Rationale: when writing custom SearchComponents, we find that we often need > to ensure that the SolrParams are modifiable. The copy constructor of > ModifiableSolrParams always creates a copy, even if the SolrParms already are > modifiable. > Alternatives: The method could also be added as a convenience method in > SolrParams itself, which already has static helper methods for wrapDefaults > and wrapAppended. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org