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

Uwe Schindler commented on SOLR-17027:
--------------------------------------

Hey, stupid question: why discuss about zero-sized vs. predefined length.

We're on Java 11+, so the modern, typesafe way is this: 
{{Collection#toArray(String[]::new)}} or {{Collection#toArray(Foobar[]::new)}}. 
And it has best performance as there are no allocations.

> Removing list.toArray calls with pre sized arrays
> -------------------------------------------------
>
>                 Key: SOLR-17027
>                 URL: https://issues.apache.org/jira/browse/SOLR-17027
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Kevin Risden
>            Priority: Minor
>             Fix For: main (10.0), 9.5
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Removing list.toArray calls with pre sized arrays
> https://www.baeldung.com/java-collection-toarray-methods



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to