[ 
https://issues.apache.org/jira/browse/SOLR-8392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17133721#comment-17133721
 ] 

David Smiley commented on SOLR-8392:
------------------------------------

Thanks Mike!  I like the assertions.

I noticed a special case on the empty string that has me scratching my head 
(and yours too I see with the appropriate addition of the comment).  Git blame 
points to [~noble.paul]  see 
https://github.com/apache/lucene-solr/blob/fb98f30a61f929326105718d2d284d761ac1b6e3/solr/core/src/java/org/apache/solr/core/RequestParams.java#L91
   What is that about?  We we copy the array for values when the key is 
non-empty, shouldn't we do the same when the key is empty?

BTW as a small optimization, we might not copy the values array if the size is 
zero.  I'm not sure if that would happen in practice though.

> SolrParam.get(String) returns String and shouldn't be used in other 
> instanceof checks
> -------------------------------------------------------------------------------------
>
>                 Key: SOLR-8392
>                 URL: https://issues.apache.org/jira/browse/SOLR-8392
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mike Drob
>            Assignee: Mike Drob
>            Priority: Major
>             Fix For: master (9.0)
>
>         Attachments: SOLR-8392.patch, SOLR-8392.patch
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> There's a couple of places where we declare the return type of 
> solrParams.get() as an Object and then do instanceof checks for other types. 
> Since we know it will be a String, we can simplify this logic in several 
> places.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to