@NotThreadSafe public class


extends Object
implements Comparator<T>
   ↳ com.atlassian.jira.issue.comparator.UserCachingComparator

Class Overview

This comparator tries to compare two users based on their 'best name' ie their full name if possible, otherwise their username.

This comparator completely ignores case, using the specified locale to make sure that we correctly sort i18n characters. It uses locale-sensitive collation, which is very expensive in CPU time. To minimise the overhead of this, it caches the collation keys for users internally. See http://docs.oracle.com/javase/tutorial/i18n/text/perform.html for more information about collation keys and their performance implications.

WARNING: This class is NOT thread safe and caches information potentially about all users. You should not reuse instances of this class beyond the scope of a single servlet/rest/web request.


Public Constructors
UserCachingComparator(Locale locale)
Public Methods
int compare(ApplicationUser user1, ApplicationUser user2)
Inherited Methods
From class java.lang.Object
From interface java.util.Comparator

Public Constructors

public UserCachingComparator (Locale locale)

public UserCachingComparator ()

Public Methods

public int compare (ApplicationUser user1, ApplicationUser user2)