You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adrien Grand (JIRA)" <ji...@apache.org> on 2017/11/29 08:46:00 UTC
[jira] [Resolved] (LUCENE-4977) Forbidden-apis: avoid calls to
Collections.sort
[ https://issues.apache.org/jira/browse/LUCENE-4977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adrien Grand resolved LUCENE-4977.
----------------------------------
Resolution: Invalid
Invalid as arraylists now sort in place.
> Forbidden-apis: avoid calls to Collections.sort
> -----------------------------------------------
>
> Key: LUCENE-4977
> URL: https://issues.apache.org/jira/browse/LUCENE-4977
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Adrien Grand
> Priority: Minor
>
> Collections.sort works by dumping its content into an array, sorting it with Arrays.sort and then getting the elements back into the list. On the contrary, CollectionUtil has the ability to sort in-place when the list supports random-access, this is more memory-efficient and maybe even faster in some cases.
> We could use the forbidden-apis tool to prevent our code from calling Collections.sort.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org