You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Alan Woodward (Jira)" <ji...@apache.org> on 2021/09/30 13:03:00 UTC

[jira] [Commented] (LUCENE-9325) Sort and SortField are not immutable

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

Alan Woodward commented on LUCENE-9325:
---------------------------------------

Picking this one up again: I've opened [https://github.com/apache/lucene/pull/338] to make `Sort` final.  `SortField` is a bit more complicated so I'll do that separately.

> Sort and SortField are not immutable
> ------------------------------------
>
>                 Key: LUCENE-9325
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9325
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The `Sort` and `SortField` classes are currently mutable, which makes them dangerous to use in multiple threads.  In particular, you can set an index sort on an IndexWriterConfig and then change its internal sort fields while the index is being written to.
> We should make all member fields on these classes final, and in addition we should make `Sort` final itself.



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

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